Chinaunix首页 | 论坛 | 博客
  • 博客访问: 661524
  • 博文数量: 107
  • 博客积分: 4135
  • 博客等级: 上校
  • 技术积分: 1182
  • 用 户 组: 普通用户
  • 注册时间: 2007-09-06 16:01
文章分类

全部博文(107)

文章存档

2020年(2)

2012年(5)

2011年(6)

2010年(23)

2009年(17)

2008年(35)

2007年(19)

我的朋友

分类: LINUX

2008-08-29 13:58:47

安装Postfix

安装

[root@mail /home/down]#tar -zxvf postfix-2.5.4.tar.gz

[root@mail /home/down]#cd postfix-2.5.4

[root@mail /home/down]#make -f Makefile.init makefiles 'CCARGS=-DHAS_MYSQL -I/usr/local/mysql/include -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/local/sasl2/include/sasl -I/usr/local/BerkeleyDB/include -DUSE_TLS -I-DUSE_TLS -I/usr/include/openssl' 'AUXLIBS=-L/usr/local/mysql/lib -lmysqlclient -lz -lm -L/usr/local/sasl2/lib -lsasl2 -L/usr/local/BerkeleyDB/lib -L/usr/lib -lssl -lcrypto'

[root@mail /home/down]#make

[root@mail /home/down]#make install

出现选项

html_directory: [no] /var/www/postfix_html

manpage_directory: [/usr/local/man] /usr/local/postfix/man

其他都默认

 

[root@mail /home/down/postfix-2.5.4]#mkdir -pv /var/mailbox

mkdir: 已创建目录 /var/mailbox

[root@mail /home/down/postfix-2.5.4]#chown -R vmail.vmail /var/mailbox

[root@mail /home/down/postfix-2.5.4]#mv /etc/postfix/main.cf /etc/postfix/main.cf.old

[root@mail /home/down/postfix-2.5.4]#mv /etc/postfix/master.cf /etc/postfix/master.cf.old

 

修改main.cf内容

[root@mail /home/down]#vi /etc/postfix/main.cf

queue_directory = /var/spool/postfix

command_directory = /usr/sbin

daemon_directory = /usr/libexec/postfix

mail_owner = postfix

myhostname = redhat.mail.com

mydomain = mail.com

myorigin = $mydomain

inet_interfaces = all

mydestination =

unknown_local_recipient_reject_code = 550

mynetworks = 192.168.18.0/24, 127.0.0.0/8

 

############################CYRUS-SASL########################

broken_sasl_auth_clients = yes

smtpd_sasl_auth_enable = yes

smtpd_sasl_local_domain = $mydomain

smtpd_sasl_security_options = noanonymous

smtpd_sasl_application_name = smtpd

smtpd_banner = Welcome to our $myhostname ESMTP,Warning: Version not Available!

#############################SASL-END##############################

 

#############################Virtual Mailbox Settings################

virtual_mailbox_base=/var/mailbox

virtual_mailbox_maps=mysql:/etc/postfix/mysql/mysql_virtual_mailbox_maps.cf

virtual_mailbox_domains=mysql:/etc/postfix/mysql/mysql_virtual_domains_maps.cf

virtual_alias_domains=

virtual_alias_maps=mysql:/etc/postfix/mysql/mysql_virtual_alias_maps.cf

virtual_uid_maps=static:1001

virtual_gid_maps=static:1001

virtual_transport=maildrop

maildrop_destination_recipient_limit=1

maildrop_destination_concurrency_limit=1

#################################Mailbox END###########################

 

 

#################################Quota Settings########################

message_size_limit=1433600

virtual_mailbox_limit=20791520

virtual_create_maildirsize=yes

virtual_mailbox_extended=yes

virtual_mailbox_limit_maps=mysql:/etc/postfix/mysql/virtual_mailbox_limit_override=yes

virtual_maildir_limit_message=User's maildir has overdrawn his diskspace quota,try again later.

virtual_overquota_bounce=yes

################################Quota END############################

 

 

################################Amavis Start##########################

content_filter=amavisfeed:[127.0.0.1]:10024

max_use=10

################################Amavis END###########################

debug_peer_level = 2

debugger_command =

         PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin

         xxgdb $daemon_directory/$process_name $process_id & sleep 5

 

sendmail_path = /usr/sbin/sendmail

newaliases_path = /usr/bin/newaliases

mailq_path = /usr/bin/mailq

setgid_group = postdrop

html_directory = /var/www/postfix_html

manpage_directory = /usr/local/postfix/man

sample_directory = /etc/postfix

 

 

 

修改master.cf

smtp inet n - n - - smtpd

pickup fifo n - n 60 1 pickup

cleanup unix n - n - 0 cleanup

qmgr fifo n - n 300 1 qmgr

tlsmgr unix - - n 1000? 1 tlsmgr

rewrite unix - - n - - trivial-rewrite

bounce unix - - n - 0 bounce

defer unix - - n - 0 bounce

trace unix - - n - 0 bounce

verify unix - - n - 1 verify

flush unix n - n 1000? 0 flush

proxymap unix - - n - - proxymap

smtp unix - - n - - smtp

relay unix - - n - - smtp -o fallback_relay=

showq unix n - n - - showq

error unix - - n - - error

retry unix - - n - - error

discard unix - - n - - discard

local unix - n n - - local

virtual unix - n n - - virtual

lmtp unix - - n - - lmtp

anvil unix - - n - 1 anvil

scache unix - - n - 1 scache

maildrop unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/bin/maildrop -w 90 -d ${recipient}

old-cyrus unix - n n - - pipe flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}

cyrus unix - n n - - pipe user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}

uucp unix - n n - - pipe flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)

ifmail unix - n n - - pipe flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)

bsmtp unix - n n - - pipe flags=Fq. user=bsmtp argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient

amavisfeed unix - - n - 2 smtp -o smtp_data_done_timeout=1200 -o smtp_send_xforward_command=yes -o disable_dns_lookups=yes -o max_use=20

127.0.0.1:10025 inet n - n - - smtpd -o content_filter= -o smtpd_delay_reject=no -o smtpd_client_restrictions=permit_mynetworks,reject -o smtpd_helo_restrictions= -o smtpd_sender_restrictions= -o smtpd_recipient_restrictions=permit_mynetworks,reject -o smtpd_data_restrictions=reject_unauth_pipelining -o smtpd_end_of_data_restrictions= -o smtpd_restriction_classes= -o mynetworks=127.0.0.0/8 -o smtpd_error_sleep_time=0 -o smtpd_soft_error_limit=1001 -o smtpd_hard_error_limit=1000 -o smtpd_client_connection_count_limit=0 -o smtpd_client_connection_rate_limit=0 -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_milters -o local_header_rewrite_clients=

 

 

 

添加为支持虚拟域和虚拟用户所用到的配置文件

[root@mail /home/down]#mkdir -pv /etc/postfix/mysql

[root@mail /home/down]#tar zxvf extman-0\[1\]\[1\].2.3.tar.gz

[root@mail /home/down]#cd extman-0.2.3/

[root@mail /home/down/extman-0.2.3]#cd docs/

 

[root@mail /home/down/extman-0.2.3/docs]#cp ./mysql_virtual_alias_maps.cf /etc/postfix/mysql/mysql_virtual_alias_maps.cf

[root@mail /home/down/extman-0.2.3/docs]#cp ./mysql_virtual_limit_maps.cf /etc/postfix/mysql/mysql_virtual_mailbox_limit_maps.cf

[root@mail /home/down/extman-0.2.3/docs]#cp ./mysql_virtual_mailbox_maps.cf /etc/postfix/mysql/mysql_virtual_mailbox_maps.cf

[root@mail /home/down/extman-0.2.3/docs]# cp ./mysql_virtual_domains_maps.cf /etc/postfix/mysql/mysql_virtual_domains_maps.cf

 

安装courier-imap

安装

[root@mail /home/down]#tar jxvf courier-imap-4.2.0.tar.bz2

[root@mail /home/down]#cd courier-imap-4.2.0

[root@mail /home/down/courier-imap-4.2.0]#export COURIERAUTHCONFIG=/usr/local/authlib/bin/courierauthconfig

 

[root@mail /home/down/courier-imap-4.2.0]#./configure --prefix=/usr/local/imap --with-redhat --disable-root-check --enable-unicode=utf-8,iso-8859-1,gb2312,gbk,gb18030 --with-trashquota --with-dirsync --with-mysql-libs=/usr/lib/mysql --with-mysql-includes=/usr/include/mysql --with-authmysql --with-authmysql=yes --disable-root-check

[root@mail /home/down/courier-imap-4.2.0]#make

[root@mail /home/down/courier-imap-4.2.0]#make install

[root@mail /home/down/courier-imap-4.2.0]#make install-configure

 

编辑配置文件启用pop3imap

[root@mail /home/down/courier-imap-4.2.0]#vi /usr/local/imap/etc/pop3d

POP3DSTART=YES   //140

[root@mail /home/down/courier-imap-4.2.0]#vi /usr/local/imap/etc/imapd

IMAPDSTART=YES

 

启动及加入自动运行队列

[root@mail /home/down/courier-imap-4.2.0]#cp courier-imap.sysvinit /usr/local/imap/sbin/imapd

[root@mail /home/down/courier-imap-4.2.0]#chmod +x /usr/local/imap/sbin/imapd

[root@mail /home/down/courier-imap-4.2.0]#/usr/local/imap/sbin/imapd start

Starting Courier-IMAP server: imap pop3

[root@mail /home/down/courier-imap-4.2.0]#cp courier-imap.sysvinit /etc/rc.d/init.d/courier-imapd

[root@mail /home/down/courier-imap-4.2.0]#chmod 755 /etc/rc.d/init.d/courier-imapd

[root@mail /home/down/courier-imap-4.2.0]#chkconfig --add courier-imapd

[root@mail /home/down/courier-imap-4.2.0]#chkconfig --level 2345 courier-imapd on

[root@mail /home/down/courier-imap-4.2.0]#

阅读(1936) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~