Currently, we are using sendmail to handle email. There are a number of tricky issues that appear because we have multiple machines redirecting email to one machine.
yum install sendmail yum install sendmail.cf
[root@moog etc]# alternatives --config mta There are 2 programs which provide 'mta'. Selection Command ----------------------------------------------- 1 /usr/sbin/sendmail.postfix *+ 2 /usr/sbin/sendmail.sendmail Enter to keep the current selection[+], or type selection number: 2I also had to do
/etc/init.d/postfix stop /etc/init.d/sendmail start
[root@moog etc]# telnet localhost 25 Trying ::1... telnet: connect to address ::1: Connection refused Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 220 moog.eecs.berkeley.edu ESMTP Sendmail 8.14.4/8.14.4; Mon, 15 Oct 2012 11:24:39 -07 00 expn root expn root 502 5.7.0 Sorry, we do not allow this operation quit quit 221 2.0.0 moog.eecs.berkeley.edu closing connection Connection closed by foreign host.
~www/php/etc/sendmail-moog.mc
is the
.mc file that is used to update /etc/mail/sendmail.cf
.
cd /etc/mail/ cp ~www/php/etc/sendmail-moog.mc sendmail.mc m4 sendmail.mc > /tmp/sendmail.cf diff sendmail.cf /tmp/sendmail.cfOnce you are happy with the changes between the old sendmail.cf and the one in tmp:
mv sendmail.cf sendmail.cf.bak cp /tmp/sendmail.cf .Note that
/etc/mail/sendmail.mc
tends to get read
often, so resist the urge to directly edit /etc/mail/sendmail.cw
/etc/mail
are
access
, aliases
, local-host-names
(used to be sendmail.cw).service sendmail restart
root@moog mail]# telnet localhost 25 Trying ::1... telnet: connect to address ::1: Connection refused Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 220 moog.eecs.berkeley.edu ESMTP Sendmail 8.14.4/8.14.4; Mon, 15 Oct 2012 15:16:48 -07 00 expn root 250-2.1.5250 2.1.5 expn trustlocal@trust.eecs.berkeley.edu 250 2.1.5 <"|/home/mailman_4/mail/wrapper_4 post trustlocal"> quit 221 2.0.0 moog.eecs.berkeley.edu closing connection Connection closed by foreign host. [root@moog mail]#
telnet moog.eecs.berkeley.edu 25
works. If it does not, try:
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnlto
DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl
system-config-firewalland check that port 25 is open.
mkdir /etc/mail/old cp -p /etc/mail/* /etc/mail/old cp -p /usr/lib/sendmail /usr/lib/sendmail.MMDDYY
smmsp
user and group.
echo "smmsp:x:25:25:Sendmail Daemon:/nonexistent:/usr/sbin/noshell" >> /etc/passwd echo "smmsp:*LK*:11406::::::" >> /etc/shadow echo "smmsp::25:" >> /etc/group
ftp://ftp.sendmail.org/pub/sendmail
cd sendmail-8.xx.xx; sh Build
Undefined first referenced symbol in file dbm_pagfno map.o dbm_dirfno map.othen temporarily move
/usr/local/include/ndbm.h
and re run sh Build
.
sh Build
ndbm.h
back
sendmail.cf
, you can save the old
sendmail binary, install the new sendmail and then restart:
mv /usr/lib/sendmail /usr/lib/sendmail-X.Y.Z chmod 0000 !$ make install /etc/init.d/sendmail stop /etc/init.d/sendmail startThen use
mconnect
to verify that the new
version is running, and use Mail -v user@hostname
to verify that mail works. If you are not updating sendmail.cf
then you are done.
sendmail.cf
or would like to update it anyway, then
the next step is to set up /etc/mail/sendmail.cf
by
editing sendmail.mc
and running m4 on it.
/usr/cluster/etc/mail/sendmail-andrews.cf
is the sendmail configuration file for andrews.eecs, which
masquerades as chess.eecs, embedded.eecs and trust.eecs. Links in
/etc
and /etc/mail
point to
it. sendmail-andrews.cf
is generated from
/usr/cluster/etc/mail/sendmail-andrews.mc
by running a makefile rule which runs a m4
command in the
cf/cf
directory of the sendmail distribution.
cd cf/cf m4 ../m4/cf.m4 /usr/cluster/etc/mail/sendmail-andrews.mc > /usr/cluster/etc/mail/sendmail-andrews.cfOr
cd cf/cf ln -s /usr/cluster/etc/mail/sendmail-andrews.mc sendmail.mc sh ./Build sendmail.cfThen run diff to compare the generated
sendmail.cffile with the old one:
diff /etc/mail/sendmail.cf sendmail.cfIf there are no changes, then you can go ahead and install the new
sendmail.cf
(see below).
/usr/cluster/etc/mail/sendmail.cf
which is derived from andrews.mc
. The makefile
includes a rule to update it too.
cd cf/cf ln -s /etc/mail/sendmail.mc . # edit /etc/mail/sendmail.mc sh Build sendmail.cfThen compare the
sendmail.cf
that
was created with /etc/mail/sendmail.cf
:
diff /etc/mail/sendmail.cf sendmail.cfIf there are significant differences, then you will need to adjust
sendmail.mc
accordingly
and repeat running sh Build sendmail.cf
When you are happy with the outcome, do
sh Build install-cf
cp obj.*/sendmail/sendmail /usr/lib/sendmail chmod u+s,g+s /usr/lib/sendmail chgrp smmsp /usr/lib/sendmail
gigascale.org
instead of gigascale.eecs.berkeley.edu
.
The way we do this is that we have a MX record set up
in the name server that points mail traffic destined
to gigascale.org to gigascale.eecs.
/usr/cluster/etc/mail/access
contains
the hosts we relay from and the domains and users we
are rejecting email from. Update this file as root, and then
run make
to update access.dir
and access.pag
. I'm not sure if it is necessary
to restart sendmail, but I don't think it is.
To handle double bounces, try setting
DoubleBounceAddress
to nobody
in sendmail.cf
:
# where do errors that occur when sending errors get sent? # Try googling sendmail redirect spam bounce O DoubleBounceAddress=nobodyThen in
/etc/mail/aliases
:
nobody: /dev/null