Sendmail configuration detailed software package sendmaili386sendmail-cfi386sendmail-develi386sendmail-doci386m4dovecot (pop3 server) preparations before procmail configuration: 1, synchronization time 2, set the host name vimetchosts1921680249 sendmail configuration detailed software package sendmail. preparation of i386sendmail-cf.i386sendmail-devel.i386sendmail-doc.i386m4dovecot (pop3 server) procmail configuration before: 1, synchronization time 2, set the host name # vim/etc/hosts192.168.0.249 station249.example.com configuration Directory:/etc/mailsendmail. mcsendmail. cflocal-host-namesaccess Example 1: The simplest mail system Only the local machine can send emails to the local machine [root @ station249 mail] # telnet 127.0.0.1 25 Trying 127.0.0.1... connected to localhost. localdomain (127.0.0.1 ). escape character is '^]'. 220 station249.example.com ESMTP Sendmail 8.13.8/8.13.8; Sun, 12 Sep 2010 22:58:14 + 0800 helo moto250 station249.example.com Hello localhost. localdomain [127.0.0.1], pleased to meet youmail from: root@station249.example.com250 2.1.0 root@station249.exam Ple.com... sender okrcpt to: user1@station249.example.com250 2.1.5 user1@station249.example.com... recipient okdata354 Enter mail, end ". "on a line by itselfThis is contentsEnd.250 2.0.0 o8CEwEIE014102 Message accepted for deliveryquit221 2.0.0 station249.example.com closing connectionConnection closed by foreign host. check whether user1 has received the email # cat/var/mail/user1 Example 2: allow other machines to connect to send the email (the mail recipient is a user on the email server) Note: The current "other machines" can only be users in the same domain or in the same network segment # vim/etc/mail/sendmail. mc DAEMON_OPTIONS ('Port = smtp, Addr = 0.0.0.0, Name = MTA ') dnl # m4/etc/mail/sendmail. mc>/etc/mail/sendmail. cf # service sendmail restart iptables setting # iptables-a input-p tcp -- dport 25-j ACCEPT # iptables-a input-p udp -- dport 25-j ACCEPT Example 3: allow logon from the local machine and other IP addresses to send emails. the email can be a solution for other domains: enable smtp verification 1. configure DAEMON_OPTIONS ('Port = submission, Name = MSA, M = Ea ') dnlTRUST_AUTH_MECH ('external DIGEST-MD5 CRAM-MD5 login plain') dnldefine ('confauth _ MECHANISMS ', 'external GSSAPI DIGEST-MD5 CRAM-MD5 login plain ') dnl # m4/etc/mail/sendmail. mc>/etc/mail/sendmail. cf 2. install and verify the supported software package # yum install cyrus-sasl *-y 3. restart related services # service sendmail restart # service saslauthd restart # service dovecot restart # chkconfig... on verification whether smtp verification is supported [root @ php rhce_env] # te Lnet 192.168.0.249 25 Trying 192.168.0.249... connected to station249.example.com (192.168.0.249 ). escape character is '^]'. 220 station249.example.com ESMTP Sendmail 8.13.8/8.13.8; Sun, 12 Sep 2010 23:20:30 + 0800 ehlo station249.example.com # Hello station254.example.com [192.168.0.254], pleased to meet you250-ENHANCEDSTATUSCODES250-PIPELINING250-8BITMIME250-SIZE250-DSN 250-ETRN250-AUTH GSSAPI DIGEST-MD5 CRAM-MD5 login plain # ---- see AUTH keyword 250-DELIVERBY250 HELP Example 4: only allow users in the local machine and example.com domain to log on and send external mail questions. The intention is to enable the relay function for users of a certain IP address. What is relay? That is, emails can be sent to other domains # vim/etc/mail/accessConnect: 127.0.0.1 RELAY <--- there is no Connect: example.com RELAY <--- add a line # makemap hash/etc/mail/access. db </etc/mail/access Example 5: support for short domain name # vim/etc/mail/local-host-namesstation249.example.comexample.com example 6: set pop3s, imaps software package dovecot service dovecot in general, dovecot service only supports pop3 (110), imap (143) Protocol # mutt-f pop: // user1@station249.example.com set pop3s (995), imaps (993 )# Vim/etc/dovecot. confprotocols = imap imaps pop3 pop3s ssl_cert_file =/etc/pki/tls/certs/localhost. crtssl_key_file =/etc/pki/tls/private/localhost. keyssl_key_password = 123456 generate the key File: # cd/etc/pki/tls/certs/# make localhost. key <--- enter the password # mkke localhost. crt # cp localhost. key .. /private/# service dovecot restart iptables set iptables-a input-p tcp-m multiport -- dports 110,143,993,995-j ACCEPTipt Ables-a input-p udp-m multiport -- dports 110,143,993,995-j ACCEPT verification # mutt-f pops: // The user1@station249.example.com limit only allows users in the example.com domain to receive mail using pop3/imap and so on. First, determine which network segment of example.com is iptables-a input-p tcp-s 192.168.0.0/24-m multiport -- dports 110,143,993,995-j ACCEPTiptables-a input-p udp-s 192.168.0.0/24-m multiport -- dports 110,143,993,995-j ACCEPT
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service