- 论坛徽章:
- 0
|
协议和端口号:
1. SMTP(25)
2. HTTP(80)
3. POP3(110)
4. IMAP(143)
5. HTTPS(443)
[DONE]
1. Install Postfix
1) sudo apt-get install postfix
2. Configure Hostname
1) sudo vi /etc/hostname
2) 127.0.0.1 mail.example.com localhost
3. Build a LAMP(Linux, Apache, MySQL, PHP) Web Server
1) sudo apt-get install lamp-server^
2) sudo apt-get install php-apc php5-memcache php5-curl php5-gd php-xml-parser
4. Configure PHP
1) sudo vi /etc/php5/apache2/php.ini
=> expose_php = Off
5. Configure Apache
1) sudo vi /etc/apache2/conf.d/security
=> ServerTokens Prod => ServerSignature Off
2) sudo a2a2enmod rewrite ssl
3) sudo a2ensite default-ssl
4) sudo vi /etc/apache2/sites-available/default
=> DocumentRoot /var/www
<Directory "/">
Options FollowSymLinks
AllowOverride All
</Directory>
5) sudo vi /etc/apache2/sites-available/default-ssl
=> DocumentRoot /var/www
<Directory "/">
Options FollowSymLinks
AllowOverride All
</Directory>
6) sudo vi /var/www/.htaccess
=> RewriteEngine On
=> RewriteCond %{SERVER_PORT} 80
=> RewriteRule ^(.*) https://mail.example.com/$1 [L]
6. Install and Configure Memcached
1) sudo apt-get install memcached
7. Install the Mailserver Packages
1) sudo apt-get install mail-server^
2) sudo apt-get install postfix-mysql dovecot-mysql dovecot-imapd postgrey
3) sudo apt-get install amavis clamav clamav-daemon spamassassin
4) sudo apt-get install php5-imap
5) restart apache2
a) service apache2 restart
6) sudo apt-get install libnet-dns-perl pyzor razor
7) sudo apt-get install arj bzip2 cabextract cpio file gzip nomarch pax unzip zip
8. Create a Mail Database and User in MySQL
1) mysql -uroot -p
2) create database mail;
3) grant all on mail.* to 'mail'@'localhost' identified by 'mailpassword';
9. Install Postfix Admin and the MySQL Schema
1) wget http://downloads.sourceforge.net ... xadmin-2.3.6.tar.gz
2) gunzip postfixadmin-2.3.6.tar.gz
3) tar -xf postfixadmin-2.3.6.tar
4) mv postfixadmin-2.3.6 /var/www/postfixadmin
5) chown -R www-data:www-data /var/www/postfixadmin
6) Following lines in /var/www/postfixadmin/config.inc.php:
a) $CONF['configured'] = true; b) $CONF['postfix_admin_url'] = 'https://mail.example.com/postfixadmin';
c) $CONF['database_type'] = 'mysql';
d) $CONF['database_host'] = 'localhost';
e) $CONF['database_user'] = 'mail';
f) $CONF['database_password'] = 'mailpassword';
g) $CONF['database_name'] = 'mail';
h) $CONF['admin_email'] = 'me@example.com';
i) $CONF['smtp_server'] = 'localhost';
j) $CONF['smtp_port'] = '25';
k) $CONF['encrypt'] = 'md5crypt';
l) $CONF['domain_path'] = 'NO';
m) $CONF['domain_in_mailbox'] = 'YES';
7) Open up a web browser and visit your mail server at:
a) https://mail.example.com/postfixadmin/setup.php
Create a file /var/www/postfixadmin/.htaccess and put the following instructions into it:
=> <Files "setup.php">
=> deny from all
=> </Files>
10. Create the Domain and Accounts in Postfix Admin
1) Navigate to the main Postfix Admin login page:
a) https://mail.example.com/postfixadmin/
[TODO]
1. 不同主机间的E-mail发送
2. 新建E-mail用户
|
|