Linux installation configuration sendmail for mail delivery

Source: Internet
Author: User
Tags imap dovecot

SendMail Configuration

Yum-y Update SendMail SENDMAIL-CF

SendMail Related Categories
1. Configuration file directory:/etc/mail
2. Record:/var/log/maillog
3. Temporary directory of received correspondence:/var/spool/mail/
4. Temporary catalogue of Outgoing letters:/var/spool/mqueue/

Backup first, then modify

Cd/etc/mail
MV SENDMAIL.CF Sendmail.cf.bak

Remove settings that only the server itself can deliver the letter

Vi/etc/mail/sendmail.mc

Daemon_options (' port=smtp,addr=127.0.0.1, Name=mta ') changed to
DNL daemon_options (' port=smtp,addr=127.0.0.1, Name=mta ')

Join the advertising source filtering mechanism

In the following two lines
FEATURE (' blacklist_recipients ') dnl
.
.
Exposed_user (' root ') DNL
Join between

DNL # use DNSBL for spam mail
FEATURE (' DNSBL ', ' rbl.maps.vix.com ', ' Rejected-see http://www.mail-abuse.org/rbl/') dnl
FEATURE (' DNSBL ', ' dul.maps.vix.com ', ' Dialup-see http://www.mail-abuse.org/dul/') dnl
FEATURE (' DNSBL ', ' relays.mail-abuse.org ', ' Open spam relay-see http://www.mail-abuse.org/rss ') dnl
DNL FEATURE (' DNSBL ', ' relays.ordb.org ', ' "Email blocked using Ordb.org-see http://ordb.org" ') DNL
FEATURE (' DNSBL ', ' blackholes.mail-abuse.org ', ' "Spam blocked see:http://mail-abuse.org/cgi-bin/lookup?") $&{CLIENT_ADDR} ') dnl
FEATURE (' DNSBL ', ' bl.spamcop.net ', ' "Spam blocked see:http://spamcop.net/bl.shtml?") $&{CLIENT_ADDR} ') dnl
DNL FEATURE (' DNSBL ', ' dnsbl.sorbs.net ', ' "554 Rejected" $&{client_addr} "found in Dnsbl.sorbs.net" ') DNL
DNL FEATURE (' DNSBL ', ' rbl.softworking.com ', ' "550 Mail from" $&{client_addr} "rejected based on external blacklist-s EE also http://www.111cn.net/"') DNL

Configure Prevent ads

Yum Install Milter-greylist

VI/ETC/MAIL/SENDMAIL.MC, in feature (' DNSBL ' ... Description later added

DNL # use GREYLIST for spam mail
FEATURE (' milter-greylist ') dnl

Avoid the relay within the range of the machine to send more than two times before the letter will be mailed

Vi/etc/mail/greylist.conf

# Your own network, which should not suffer greylisting

List "My network" addr {127.0.0.1/8 163.32.244.0/24}

# This is a list of broken MTAs., with Greylisting. Derived from # http://cvs.puremagic.com/viewcvs/greylisting/schema/whitelist_ip.txt?rev=1.16

List "Broken MTA" addr {

12.5.136.141/32 # Southwest Airlines (unique sender)

12.5.136.142/32 # Southwest Airlines

163.32.250.21/32 # KH Mail server
163.32.250.51/32 # Epass Server
163.32.250.12/32 # Kiecc.server
# You can also list the mail server IP at the bottom of the security (OK not to send advertising letter)

Chkconfig--level 345 milter-greylist on
Service Milter-greylist Start

After you have finished modifying the SENDMAIL.MC file, generate the correct SENDMAIL.CF

Cd/etc/mail
Make-c/etc/mail

To avoid the problem of MX loop back, you must log in the hostname of this server and all host aliases.

Vi/etc/mail/local-host-names

Set the range (RELAY) for forwarding (to help Outlook) and block the ad host (DENY)

Vi/etc/mail/access

Connect:localhost.localdomain RELAY
Connect:localhost RELAY
connect:127.0.0.1 RELAY
connect:163.18.225 RELAY
CONNECT:SGRSMS.SG-RS.COM.HK REJECT
Connect:mail.uhome.net.tw REJECT

After archiving

Make all
Service SendMail Restart

Procmail Advertising Filter Rules
Yum Install Procmail

Vi/etc/procmailrc

Maildir=/var/mail
Verbose=off
Path=/bin:/sbin:/usr/bin:/usr/sbin/:/usr/local/bin:/usr/local/sbin
Logfile=/var/log/procmail.log
# Advertising message filtering mechanism
# in principle, the probability of miscalculation is higher, because some e-periodicals are also used in the relevant programs to send, so in particular, these special micro-letters are transferred to a specific file, in order to manually confirm later. After the confirmation is correct, the setting is then transferred to/dev/null, so that the letter can be deleted directly to avoid the waste of the hard disk space.
# Filter Masquerading Senders
: 0 HBw
#* ^return-path:. * @mail. kh.edu.tw.*
* ^received:from mail.kh.edu.tw. *
*!^received:from mail.kh.edu.tw. *163.32.250.
*!^received:from mail.kh.edu.tw. *163.32.119.
*!^received:from mail.kh.edu.tw. *163.29.241.
*!^received:from mail.kh.edu.tw. *163.29.242.
*!^received:from mail.kh.edu.tw. *163.32. (www.111cn.net) 137.
*!^received:from mail.kh.edu.tw (Localhost.localdomain [127.0.0.1])
*!^received:from 163.32.250.21. *163.32.250.
/home/mailfilter/spam.local
# Filter Advertising message sending software (1)
: 0 HBw
* ^x-library: (indy.*| dynamailer.*)
/home/mailfilter/spam.library
# Filter Advertising message sending software (2)
: 0 HBw
* ^x-mailer: (dynamailer.*| Ehoopost.*| Mail bomber.*| Quicksender.*|made from pascual|ret.*| foxmail*)
/home/mailfilter/spam.mailer

Create a collection directory for the letter filter:
Mkdir/home/mailfilter

After setting, compile to Directory

Cd/etc/mail
Make all
Service SendMail Restar

Dovecot (POP, IMAP)

Installing the Software 111cn.net

Yum-y Install Dovecot
Cp/etc/dovecot.conf/etc/dovecot.conf.bak
Vi/etc/dovecot.conf

protocols = IMAP IMAPS modified to-protocols = POP3
ssl_disable = no modified to-ssl_disable = yes

Restart

/etc/rc.d/init.d/dovecot start
Chkconfig Dovecot on


SendMail not send mail properly

e-mail content is as follows:

From: =?utf-8? b?5b2x6keg5l+x5lmq6yoo?= <[email protected]>
X-priority:3
X-mailer:ucenter_home 2.0
mime-version:1.0
content-type:text/html; Charset=utf-8
Content-transfer-encoding:base64
Message-id: <[email protected]>
Date:thu, 15:36:20 +0800 (CST)
Phrhymxlignlbgxzcgfjaw5npsiwiibjzwxscgfkzgluzz0imjaipg0kphrypjx0zd4ncjx0ywjs
Zsb3awr0ad0intawiibjzwxsc3bhy2luzz0imcigy2vsbhbhzgrpbmc9ijeipg0kphrypjx0zcbi
Z2nvbg9ypsijrky4rtawiibhbglnbj0ibgvmdcigc3r5bgu9imzvbnqtzmftawx5oidsdwnpzgeg
Z3jhbmrljyx0ywhvbwesj2jpdhn0cmvhbsb2zxjhihnhbnmnlghlbhzldgljysxzyw5zlxnlcmlm
o2xpbmutagvpz2h0oje1mcu7y29sb3i6i0zgrjtmb250lxnpemu6mjrwedtmb250lxdlawdoddpi
B2xko3bhzgrpbmc6nhb4ij4mbmjzcdsg5b2x6keg5l+x5lmq6yoopc90ad48l3rypg0kphrypjx0
Zcbiz2nvbg9ypsijrky4rtawij4ncjx0ywjszsb3awr0ad0imtawjsigy2vsbhnwywnpbmc9ijai
igjny29sb3i9iingrkzgrkyiignlbgxwywrkaw5npsiymci+dqo8dhi+phrkihn0ewxlpsjmb250
Lwzhbwlsetonbhvjawrhigdyyw5kzscsdgfob21hlcdiaxrzdhjlyw0gdmvyysbzyw5zjyxozwx2
Zxrpy2esc2fucy1zzxjpzjtsaw5llwhlawdoddoxntalo2nvbg9yoimwmda7zm9udc1zaxploje0
Chg7ij4ncus6sueiseeahoaci+wpi++8mg0kpgjsb2nrcxvvdgu+pgjypjxzdhjvbmc+5y+w5zue
5a+g56cb6yku5lu2pc9zdhjvbmc+pgjypuacqowpqumcgowcqoapkos6poivt+axguwqjueahos4
Iewkqes5i+wghe+8jomamui/h+ecuewhu+s4i+mdoueahomtvuaopemhjee9ruacqoeahowvhueg
ge+8mjxiciavpmh0dha6ly92lndva2fulmnjl2hvbwuvzg8ucghwp2fjpwxvc3rwyxnzd2qmyw1w
o29wpxjlc2v0jmftcdt1awq9mtgmyw1wo2lkpunhmgk3qjxiciavpijlpolmnpzkuirpnalkui3m
Mk/pk77mjqxlvallvi/vvizor7flsiblnldlnydmiyvlt6xnspjotltlildmty/op4jlmajlnldl
Nydmoi/lho3orr/pl64ppgjyic8+5lik6z2i55qe6ag16z2i5omt5bya5zco77ym6l6t5ywl5paw
55qe5a+g56cb5zco5o+q5lqk77ym5lml5zco5oko5y2z5y+v5l2/55so5paw55qe5a+g56cb55m7
5b2v5lqg44ccpgjypjxicj48l2jsb2nrcxvvdgu+dqo8yni+dqo8yni+5b2x6keg5l+x5lmq6yoo
Pgjypjxhighyzwy9imh0dha6ly92lndva2fulmnjl2hvbwuviib0yxjnzxq9il9ibgfuayi+ahr0
cdovl3yud29ryw4uy2mvag9tzs88l2e+dqo8yni+mjaxmc0wns0xmyaxntoznjxicj4ncjxicj7m
ratpgq7ku7bkulrns7vnu5/oh6rliqjlj5hlh7rnmotpgq7ku7bvvizor7fli7/nm7tmjqxlm57l
pi3jgiincjwvdgq+pc90cj48l3rhymxlpg0kpc90zd48l3rypjwvdgfibgu+dqo8l3rkpjwvdhi+
dqo8l3rhymxlpg==

Obviously not, there must be a problem.

Find out why.

No find, no familiarity with its configuration, no method found on the web

Run YaST removed, reinstall

Linux-qebs:/srv/www/htdocs # Rpm-qa | grep sendmail
sendmail-8.14.3-51.5.1.i586

sendmail-bd-q12h

Vi/etc/sendmail.cf

Modify Configuration

Originally for

Timeout.ident=5s

After modification

timeout.ident=0s

/etc/init.d/sendmail status

does not start automatically

/etc/init.d/sendmail restart

SendMail ' AAAA ' [email protected]

Oh, received, and normal.
From:http://www.111cn.net/sys/linux/56538.htm

Linux installation configuration sendmail for mail delivery

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.