Install/Configure Postfix2008/12/14 |
Install and Configure Postfix for SMTP Server.
|
|
[1] | Install and Configure Postfix |
[root@mail ~]# yum -y install postfix [root@mail ~]# vi /etc/postfix/main.cf # line 76: uncomment and specify hostname myhostname = mail.srv.world # line 83: uncomment and specify domain name mydomain = srv.world # line 99: uncomment myorigin = $mydomain # line 116: change inet_interfaces = all # line 161: add mydestination = $myhostname, localhost.$mydomain, localhost , $mydomain # line 261: uncomment and specify your LAN mynetworks = 127.0.0.0/8, 192.168.0.0/24 # line 416: uncomment (use Maildir) home_mailbox = Maildir/ # line 542: uncomment, line 543: add header_checks = regexp:/etc/postfix/header_checks body_checks = regexp:/etc/postfix/body_checks # add at the bottom: limit an email size 5M message_size_limit = 5242880 # limit mailbox 100M mailbox_size_limit = 104857600 # for SMTP-Auth setting
smtpd_sasl_auth_enable = yes smtpd_sasl_security_options = noanonymous smtpd_sasl_local_domain = $myhostname smtpd_recipient_restrictions = permit_mynetworks, permit_auth_destination, permit_sasl_authenticated, reject [root@mail ~]# vi /etc/postfix/header_checks # add at the head # reject if email address is empty /^From:.*<#.*@.*>/ REJECT /^Return-Path:.*<#.*@.*>/ REJECT # hide Received line /^Received:/ IGNORE [root@mail ~]# vi /etc/postfix/body_checks # reject if includes 'example.com' in mail body /^(|[^>].*)example.com/ REJECT [root@mail ~]# /etc/rc.d/init.d/sendmail stop Shutting down sm-client: [ OK ] Shutting down sendmail: [ OK ] [root@mail ~]# chkconfig sendmail off [root@mail ~]# alternatives --config mta There are 2 programs which provide 'mta'. Selection Command ----------------------------------------------- *+ 1 /usr/sbin/sendmail.sendmail 2 /usr/sbin/sendmail.postfix Enter to keep the current selection[+], or type selection number: 2 [root@mail ~]# /etc/rc.d/init.d/postfix start Starting postfix: [ OK ] [root@mail ~]# /etc/rc.d/init.d/saslauthd start Starting saslauthd: [ OK ] [root@mail ~]# chkconfig postfix on [root@mail ~]# chkconfig saslauthd on
|
Sponsored Link |
|