[分享 web 邮件服务器]Postfix + Dovecot-imap + Squirrelmail(Webmail)
发表于 : 2008-12-07 17:00
很久以来,一直在找方法,下面的方法比较简单,小公司已经足够了。
-------------------------------------------------
ubuntu-server-8.04
安装到尾声时
选择[LAMP]因为squirrelmail(webmail)要用到www和php,
还要选择[Mail]这样就可以自动安装好postfix和dovecot-imap
再安装webmail软件
$sudo apt-get install squirrelmail
配置webmail
$sudo squirrelmail-configure
--------------------------------------------------
主目录
选择 d
输入 dovecot --确定系统(webmail)用以读取信箱中邮件的程序
(原来就在这点上被弄糊涂了,其实ubuntu的默认安装就给你搭配好了postfix+dovecot)
选择 r 返回主目录
选择 1
设定一些内容
选择 r 返回主目录
选择 2
domain : yourdomain (应该是那个带尾缀的examlpe.com)
选择 r 返回主目录
选择 10 设置语言
zh_CN
utf-8
选择 r 返回主目录
选择 s (保存)
quit
-------------------------------------------------
修改apache2的设置
$sudo cp /etc/squirrelmail/apache.conf /etc/apache2/sites-enabled/squirrelmail
(将squirrelmail的apache配置文件放在apache2的标准位置,让它能起作用)
-------------------------------------------------
启动 dovecot
$cd /etc/dovecot
$sudo nano dovecot.conf
protocols = imap imaps (一定要有这一行,才启动了服务)
listen = * (这才开启了端口)
mail_location = maildir:~/Maildir(2010-10-01, chucuoshi faxian bixu jiazheyitiao )
######2012-5-1重装###############
#忘了:sudo /etc/init.d/dovecot restart #
######2012-5-1##################
#sudo netstat -nptl #
#没有dovecot的监听端口 #
#dovecot的设置在12.04中可以用默认 #
###############################
-------------------------------------------------
这一段是搬来的,还未理解
$sudo nano /etc/postfix/main.cf
home_mailbox = Maildir/ (注意结尾有斜扛,表示单个文件类型的邮件储存方法)
#mailbox_command = procmail -a "$EXTENSION" (注意要加“#”注释掉这一句,现在还未理解)
------------------------------------------------
这一段也不理解
修改pam认证
$cd /etc/pam.d
$sudo cp common-session common-session.20081207.bak(备份需要改动的文件,以备不时之需)
$sudo nano common-session
session required pam_mkhomedir.so umask=0022 skel=/etc/skel (改成这样,不太懂)
-----------------------------------------------
$cd /etc/skel
$ls skel
Example Maildir (这是两个目录样子,如果没有需添加)
$cd Maildir
$ls Maildir
cur new tmp(这是邮箱的目录样式,如果没有要添加)
-----------------------------------------------
添加帐号(这样添加的帐号都是系统帐号,在这一段应用中略显不足)
$sudo adduser taandtadengdeng
-----------------------------------------------
现在已经可以用了
在浏览器中输入:
http://yourdomain/squirrelmail/
-----------------------------------------------
来源于实践,希望对大家有用。
====================================
==2012-5-1===========================
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = no
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
myhostname = xxxxxxxx(注意这里的xxxxxx要注意是带.com .net .cn的那种)
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = xxxxxxxxx, localhost.localdomain, localhost(注意这里的xxxxxx要注意是带.com .net .cn的那种)
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
#mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
#inet_interfaces = loopback-only
#default_transport = error
#relay_transport = error
###2012-05-01#########################
inet_interfaces = all
home_mailbox = Maildir/
#还有一个发现:以上两行颠倒位置后,会影响dovecot的启动速度
==========================================
-------------------------------------------------
ubuntu-server-8.04
安装到尾声时
选择[LAMP]因为squirrelmail(webmail)要用到www和php,
还要选择[Mail]这样就可以自动安装好postfix和dovecot-imap
再安装webmail软件
$sudo apt-get install squirrelmail
配置webmail
$sudo squirrelmail-configure
--------------------------------------------------
主目录
选择 d
输入 dovecot --确定系统(webmail)用以读取信箱中邮件的程序
(原来就在这点上被弄糊涂了,其实ubuntu的默认安装就给你搭配好了postfix+dovecot)
选择 r 返回主目录
选择 1
设定一些内容
选择 r 返回主目录
选择 2
domain : yourdomain (应该是那个带尾缀的examlpe.com)
选择 r 返回主目录
选择 10 设置语言
zh_CN
utf-8
选择 r 返回主目录
选择 s (保存)
quit
-------------------------------------------------
修改apache2的设置
$sudo cp /etc/squirrelmail/apache.conf /etc/apache2/sites-enabled/squirrelmail
(将squirrelmail的apache配置文件放在apache2的标准位置,让它能起作用)
-------------------------------------------------
启动 dovecot
$cd /etc/dovecot
$sudo nano dovecot.conf
protocols = imap imaps (一定要有这一行,才启动了服务)
listen = * (这才开启了端口)
mail_location = maildir:~/Maildir(2010-10-01, chucuoshi faxian bixu jiazheyitiao )
######2012-5-1重装###############
#忘了:sudo /etc/init.d/dovecot restart #
######2012-5-1##################
#sudo netstat -nptl #
#没有dovecot的监听端口 #
#dovecot的设置在12.04中可以用默认 #
###############################
-------------------------------------------------
这一段是搬来的,还未理解
$sudo nano /etc/postfix/main.cf
home_mailbox = Maildir/ (注意结尾有斜扛,表示单个文件类型的邮件储存方法)
#mailbox_command = procmail -a "$EXTENSION" (注意要加“#”注释掉这一句,现在还未理解)
------------------------------------------------
这一段也不理解
修改pam认证
$cd /etc/pam.d
$sudo cp common-session common-session.20081207.bak(备份需要改动的文件,以备不时之需)
$sudo nano common-session
session required pam_mkhomedir.so umask=0022 skel=/etc/skel (改成这样,不太懂)
-----------------------------------------------
$cd /etc/skel
$ls skel
Example Maildir (这是两个目录样子,如果没有需添加)
$cd Maildir
$ls Maildir
cur new tmp(这是邮箱的目录样式,如果没有要添加)
-----------------------------------------------
添加帐号(这样添加的帐号都是系统帐号,在这一段应用中略显不足)
$sudo adduser taandtadengdeng
-----------------------------------------------
现在已经可以用了
在浏览器中输入:
http://yourdomain/squirrelmail/
-----------------------------------------------
来源于实践,希望对大家有用。
====================================
==2012-5-1===========================
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = no
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
myhostname = xxxxxxxx(注意这里的xxxxxx要注意是带.com .net .cn的那种)
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = xxxxxxxxx, localhost.localdomain, localhost(注意这里的xxxxxx要注意是带.com .net .cn的那种)
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
#mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
#inet_interfaces = loopback-only
#default_transport = error
#relay_transport = error
###2012-05-01#########################
inet_interfaces = all
home_mailbox = Maildir/
#还有一个发现:以上两行颠倒位置后,会影响dovecot的启动速度
==========================================