Pages

Wednesday 6 November 2019

Installation and Configure Postfixadmin-2.93 (2/7)

Installation and Configure Postfixadmin-2.93 (2/7)

# Download postfixadmin-2.93

[root@mailserver ~]# wget http://liquidtelecom.dl.sourceforge.net/project/postfixadmin/postfixadmin/postfixadmin-2.93/postfixadmin-2.93.tar.gz
--2015-11-23 05:36:58-- http://liquidtelecom.dl.sourceforge.net/project/postfixadmin/postfixadmin/postfixadmin-2.93/postfixadmin-2.93.tar.gz
Resolving liquidtelecom.dl.sourceforge.net (liquidtelecom.dl.sourceforge.net)... 197.155.77.8
Connecting to liquidtelecom.dl.sourceforge.net (liquidtelecom.dl.sourceforge.net)|197.155.77.8|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1269907 (1.2M) [application/x-gzip]
Saving to: ‘postfixadmin-2.93.tar.gz’

100%[======================================>] 12,69,907 375KB/s in 3.3s

2015-11-23 05:37:02 (375 KB/s) - ‘postfixadmin-2.93.tar.gz’ saved [1269907/1269907]

[root@mailserver ~]#

[root@mailserver ~]#
[root@mailserver ~]# tar -xvf postfixadmin-2.93.tar.gz --directory=/usr/share
postfixadmin-2.93/
postfixadmin-2.93/GPL-LICENSE.TXT
postfixadmin-2.93/debian/
postfixadmin-2.93/debian/control
postfixadmin-2.93/debian/postfixadmin.examples
....
Output Obmiited 
....
postfixadmin-2.93/VIRTUAL_VACATION/INSTALL.TXT
postfixadmin-2.93/VIRTUAL_VACATION/index.php
postfixadmin-2.93/VIRTUAL_VACATION/vacation.pl
postfixadmin-2.93/smarty.inc.php
[root@mailserver ~]#


[root@mailserver ~]# ls -d /usr/share/postfixadmin-2.93
/usr/share/postfixadmin-2.93
[root@mailserver ~]# 

# Create Soft Link of Postfixadmin-2.93 to postfixadmin in /usr/share directory  

[root@mailserver ~]# ln -s /usr/share/postfixadmin-2.93/ /usr/share/postfixadmin

[root@mailserver ~]# ll -d /usr/share/postfixadmin*
lrwxrwxrwx. 1 root root 29 Nov 23 05:50 /usr/share/postfixadmin -> /usr/share/postfixadmin-2.93/
drwxrwxr-x. 17 centos 1010 4096 Sep 26 15:26 /usr/share/postfixadmin-2.93
[root@mailserver ~]#

# Create Document directory in /usr/share/doc/postfixadmin-2.93

[root@mailserver ~]# mkdir /usr/share/doc/postfixadmin-2.93


[root@mailserver ~]# mv /usr/share/postfixadmin/{ADDITIONS,DOCUMENTS,VIRTUAL_VACATION} /usr/share/doc/postfixadmin-2.93

[root@mailserver ~]# chown root:apache /usr/share/postfixadmin/templates_c/

[root@mailserver ~]# chmod g+w /usr/share/postfixadmin/templates_c/

[root@mailserver ~]# mkdir /etc/postfixadmin

[root@mailserver ~]# touch /etc/postfixadmin/config.local.php

[root@mailserver ~]# chown root:apache /etc/postfixadmin/config.local.php

[root@mailserver ~]# chmod 0640 /etc/postfixadmin/config.local.php

[root@mailserver ~]# ln -s /etc/postfixadmin/config.local.php /usr/share/postfixadmin


# Copy below contain to /etc/postfixadmin/config.local.php file. 
   
[root@mailserver ~]# vim /etc/postfixadmin/config.local.php
[root@mailserver ~]# cat /etc/postfixadmin/config.local.php
<?php
$CONF['configured'] = true;
$CONF['setup_password'] = 'changeme';
$CONF['default_language'] = 'en';
$CONF['database_type'] = 'mysqli';
$CONF['database_host'] = 'localhost';
$CONF['database_user'] = 'mailuser';
$CONF['database_password'] = 'redhat';
$CONF['database_name'] = 'maildb';
$CONF['admin_email'] = 'mailadmin@example.com';
$CONF['page_size'] = '50';
$CONF['default_aliases'] = array (
'MAILER-DAEMON' => 'postmaster@example.com',
'abuse' => 'postmaster@example.com',
'postmaster' => 'hostmaster@example.com',
'webmaster' => 'hostmaster@example.com',
'hostmaster' => 'root@example.com',
'root' => 'admin@example.com'
);
$CONF['domain_path'] = 'YES';
$CONF['domain_in_mailbox'] = 'NO';
$CONF['transport'] = 'YES';
$CONF['transport_options'] = array (
'dovecot', // for virtual accounts
'virtual', // for virtual accounts
'local', // for system accounts
'relay' // for backup mx
);
$CONF['transport_default'] = 'dovecot';
$CONF['vacation'] = 'NO';
$CONF['vacation_control'] = 'NO';
$CONF['vacation_control_admin'] = 'NO';
$CONF['backup'] = 'YES';
$CONF['sendmail'] = 'YES';
$CONF['logging'] = 'YES';
$CONF['fetchmail'] = 'YES';
$CONF['fetchmail_extra_options'] = 'YES';
$CONF['footer_text'] = 'Return to mailserver.example.com';
$CONF['footer_link'] = 'http://mailserver.example.com';
$CONF['used_quotas'] = 'YES';
$CONF['new_quota_table'] = 'YES';
[root@mailserver ~]#

# Create Virtual http conf file in /etc/httpd/conf.d/postfixadmin.conf

[root@mailserver ~]# vim /etc/httpd/conf.d/postfixadmin.conf
[root@mailserver ~]# cat /etc/httpd/conf.d/postfixadmin.conf
#
# postfixadmin - Web based Management tool created for Postfix.
#
# Allows only localhost by default
#
# But allowing postfixadmin to anyone other than localhost should be considered
# dangerous unless properly secured by SSL
Alias /mailadmin /usr/share/postfixadmin
<Directory /usr/share/postfixadmin/>
AddDefaultCharset UTF-8
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require ip 127.0.0.1
Require ip ::1
Require ip 192.168.10.0/24
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Deny from All
# Allow from 127.0.0.1
Allow from ALL
Allow from ::1
Allow from 192.168.10.0/16
</IfModule>
</Directory>
[root@mailserver ~]#

No comments:

Post a Comment