Linux installation configuration sendmail implementing mail delivery

Source: Internet
Author: User
Tags imap dovecot

SendMail Configuration

Yum-y Update SendMail SENDMAIL-CF

SendMail Related Directory
1. Profile directory:/etc/mail
2. Record file:/var/log/maillog
3. Provisional catalogue of received letters:/var/spool/mail/
4. The temporary catalogue of the letters sent:/var/spool/mqueue/

Back up first, then modify

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

Remove the setting 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 ')

Adding the source filtering mechanism of advertising sources

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 ', ' "" $&{client_addr rejected} "based on external blacklist-s EE also http://www.111cn.net/"') DNL

Configure Prevention Ads

Yum Install Milter-greylist

VI/ETC/MAIL/SENDMAIL.MC, in feature (' DNSBL ' ...) Description after adding

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

Avoid the machines within the range of relay send mail Only two times a time

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 the break 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 below that is safe and secure (you will not send a letter)

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

When the Sendmail.mc file is finished, the correct sendmail.cf is generated.

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

To avoid problems that cause MX loop back, you must log in the server's host name and all host aliases

Vi/etc/mail/local-host-names

Set the scope (RELAY) of the transfer letter (for Outlook Messenger) and block the advertising letter 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 Letter Filtering 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 Letter Filtering mechanism
# in principle, the probability of miscalculation is higher, because some electronic periodicals are sent using the relevant programs, so special letters will be transferred to a specific file for future manual confirmation. After the confirmation is correct, then change the setting to/dev/null, so that the letter can be deleted directly, so as to avoid the waste of hard disk space.
# Filter the fake 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.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
# Filtering advertising letters to send software (1)
: 0 Hbw
* ^x-library: (indy.*| dynamailer.*)
/home/mailfilter/spam.library
# Filtering advertising letters to send software (2)
: 0 Hbw
* ^x-mailer: (dynamailer.*| Ehoopost.*| Mail bomber.*| Quicksender.*|made from pascual|ret.*| foxmail*)
/home/mailfilter/spam.mailer

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

After setting up, compile in the directory

Cd/etc/mail
Make all
Service SendMail Restar

Dovecot (POP, IMAP)

Install software 111cn.net

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

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

Reboot

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


SendMail can't send mail normally

e-mail content is as follows:

From: =?utf-8? b?5b2x6keg5l+x5lmq6yoo?= <webmaster@m.wokan.cc>
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: <20100513073621.1981D20E333@linux-qebs.site>
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.

Not found, not familiar with its configuration, the Internet did not find a way

Run YaST Delete, 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 ' xhq6632@126.com

Oh, Roger, and normal.

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.