# rpm -ihv sendmail-8.11.6-3.i386.rpm # rpm -ihv sendmail-doc-8.11.6-3.i386.rpm # rpm -ihv sendmail-cf-8.11.6-3.i386.rpm # rpm -ihv imap-2000c-15.i386.rpm # rpm -ihv imap-devel-2000c-15.i386.rpm
| Path | |
|---|---|
| /etc/mail/sendmail.mc | |
| /etc/mail/access | |
| /etc/mail/local-host-names | |
| /etc/mail/relay-domains |
divert(-1) dnl This is the sendmail macro config file. If you make changes to this file, dnl you need the sendmail-cf rpm installed and then have to generate a dnl new /etc/sendmail.cf by running the following command: dnl dnl m4 /etc/mail/sendmail.mc > /etc/sendmail.cf dnl include(`/usr/share/sendmail-cf/m4/cf.m4') VERSIONID(`linux setup for Red Hat Linux')dnl OSTYPE(`linux') define(`confDEF_USER_ID',``8:12'')dnl define(`confAUTO_REBUILD')dnl define(`confTO_CONNECT', `1m')dnl define(`confTRY_NULL_MX_LIST',true)dnl define(`confDONT_PROBE_INTERFACES',true)dnl define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl define(`ALIAS_FILE', `/etc/aliases')dnl define(`UUCP_MAILER_MAX', `2000000')dnl define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl define(`confAUTH_OPTIONS', `A')dnl FEATURE(`no_default_msa',`dnl')dnl FEATURE(`smrsh',`/usr/sbin/smrsh')dnl FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl FEATURE(redirect)dnl FEATURE(always_add_domain)dnl FEATURE(use_cw_file)dnl FEATURE(use_ct_file)dnl FEATURE(local_procmail,`',`procmail -t -Y -a $h -d $u')dnl FEATURE(`access_db',`hash -o /etc/mail/access.db')dnl FEATURE(`blacklist_recipients')dnl EXPOSED_USER(`root')dnl DAEMON_OPTIONS(`port=smtp,Addr=202.144.158.205, Name=MTA') FEATURE(`accept_unresolvable_domains')dnl MAILER(smtp)dnl MAILER(procmail)dnl Cwlocalhost.localdomain MASQUERADE_AS(yourdomain.bt) MASQUERADE_DOMAIN(yourdomain.bt) FEATURE(masquerade_entire_domain) FEATURE(masquerade_envelope)
# Check the /usr/share/doc/sendmail-8.11.6/README.cf file for a description # of the format of this file. (search for access_db in that file) # The /usr/share/doc/sendmail-8.11.6/README.cf is part of the sendmail-doc # package. # # by default we allow relaying from localhost... # localhost.localdomain RELAY # localhost RELAY # 127.0.0.1 RELAY
192.168.0. 202.144.158.
# local-host-names - include all aliases for your machine here. yourhost.yourdomain.bt
# ntsysv
# m4 /etc/mail/sendmail.mc > /etc/sendmail.cf # makemap hash /etc/mail/access.db < /etc/mail/access # /etc/init.d/sendmail restart
# tail /var/log/message
... Jun 6 22:28:45 yourname sendmail: sendmail shutdown succeeded Jun 6 22:28:47 yourname sendmail: sendmail startup succeeded
# telnet yourhost.yourdomain.bt 110 Trying 202.144.158.205... Connected to yourhost.yourdomain.bt. Escape character is '^]'. +OK POP3 yourhost v6.50 server ready hoge -ERR Unknown command in AUTHORIZATION state USER youruser +OK User name accepted, password please PASS ******** +OK Mailbox open, 15 messages LIST 1 15086 2 13874 3 10065 4 15055 5 17742 6 15442 7 9176 8 9052 9 1471 10 37106 11 14620 12 8343 13 7457 14 14941 15 1418 . QUIT +OK Sayonara Connection closed by foreign host.
# sendmail -bt -f /etc/sendmail.cf ADDRESS TEST MODE (ruleset 3 NOT automatically invoked) Enter <ruleset> <address> > 0 youruser parse input: youruser Parse0 input: youruser Parse0 returns: youruser ParseLocal input: youruser ParseLocal returns: youruser Parse1 input: youruser Parse1 returns: $# local $: youruser parse returns: $# local $: youruser > 0 youruser@yourdomain.bt parse input: youruser @ yourdomain . bt Parse0 input: youruser @ yourdomain . bt Parse0 returns: youruser @ yourdomain . bt ParseLocal input: youruser @ yourdomain . bt ParseLocal returns: youruser @ yourdomain . bt Parse1 input: youruser @ yourdomain . bt Parse1 returns: $# local $: youruser @ yourdomain . bt parse returns: $# local $: youruser @ yourdomain . bt >
... erohard.com REJECT americanbranding.easywinning.com REJECT lists.zoanmail.com REJECT vmadmin.com REJECT
# makemap hash /etc/mail/access.db < /etc/mail/access
# /etc/init.d/sendmail restart
BLACKLIST=$HOME/.blacklist :0 h *$ ? test -s $BLACKLIST * ? (formail -x From: -x Reply-To: -x Sender: -x From | fgrep -iqf $BLACKLIST) /dev/null
OnlineCasinoFun@vmadmin.com aeb@americanbranding.easywinning.com jackpot@workdaydeals.net free-pix@erohard.com
... group1: user1, user2, user3, . . . ...
# newaliases
forwarduser@somewhere.bt