This is Bavaria, Germany!
Vserver cannot handle daemon which bind to * (127.0.0.1 and official IP-addresses). Do what you can to avoid this!
You need make to create sendmail.cf from sendmail.mc-file.
# apt-get install make
# apt-get install sendmail
There are a lot of programs which submit mails via commands like this:
sendmail -v root@localhost </dev/null
These mails get submitted to 127.0.0.1:587! /var/log/mail.log shows this. But with vserver running all mails have to be submitted to our our official ip-address. So edit your /etc/mail/submit.mc
dnl Don't send mail to 127.0.0.1 on vserver, use official ip-address instead: dnl FEATURE(`msp', `[127.0.0.1]', `MSA')dnl FEATURE(`msp', `[10.95.81.71]', `MSA')dnl
Then
# make # /etc/int.d/sendmail restart
Send a mail like this:
# mail -s "testsubject" lippmann@zirndorf.de </dev/null
and check the logfile /var/log/mail.log. Mail shall be delivered vial local sendmail daemon.
Every mail to your smarthost smtp.zdf, nothing more. Good for all your child-servers. Put this lines to your /etc/mail/sendmail.mc:
... LOCAL_CONFIG dnl # vserver: do not listen to 127.0.0.1, but only to a right IP dnl # turn off default entry for MSA FEATURE(`no_default_msa')dnl dnl # all my daemons (Port 25, Port 587 for mailsubmission) dnl # shall listen only to this ip-address: DAEMON_OPTIONS(`Name=MTA,Port=25,Addr=10.95.81.71')dnl DAEMON_OPTIONS(`Name=MSA,Port=587,Addr=10.95.81.71')dnl dnl # our smarthost FEATURE(`nullclient', smtp.zdf)dnl LOCAL_CONFIG ## Custom configurations below (will be preserved) |
Doublecheck your /etc/hosts on all vservers: there must not have a line with 127.0.0.1! Something like this:
10.95.81.71 mail2.zdf localhost
Put a line for every destination-domains into /etc/mail/relay-domains:
zirndorf.de zirndorf.net
zdf
The name of my server is tanzwut.zdf, but I accept mails for these two destination-domains visible from the internet and to zdf, our local domain.
You have to use /etc/mail/access
[todo]
Put this into sendmail.mc:
FEATURE(`virtusertable', `hash /etc/mail/virtusertable')dnl
VIRTUSER_DOMAIN_FILE(`/etc/mail/virtual-domains')dnl
Mails to domains in file virtual-domains get checked with lines from virtusertable.
home:/etc/mail# cat virtual-domains
inner.circle.de
home:/etc/mail# cat virtusertable
richard@inner.circle.de
lippmann
martin@inner.circle.de
martinmiller@somewhere.else.com
Procmail delivers spammail directly to a spamfolder in my mailbox.
# apt-get install procmail
Put this line into /etc/mail/sendmail.mc:
FEATURE(`local_procmail')dnl
After that:
# cd /etc/mail # make # /etc/init.d/sendmail restartThis is my personal .procmailrc # ~horshack/.procmailrc # Version 0.02 # # Log all actions to this file, this directory must exist # and be writable by the user himself: # LOGFILE=$HOME/syslog/procrc.log VERBOSE=on LOGABSTRACT=off EXITCODE= # Mail _to_ (or cc, resent whatever) _OR_ ( * 1^0 ) # -> deliver to mail/perl_win32 :0: * 1^0 ^TO_activeperl@listserv\.activestate\.com * 1^0 ^TO_perl-win32-admin@listserv\.activestate\.com * 1^0 ^TO_perl-win32-admin@listserv1\.activestate\.com |/usr/bin/dmail +mail/perl_win32 ### # an autoanswer to a mail with a special subject # the whole mail including headers is sent via STDIN to this program :0: * 1^0 ^Subject: please give me password for msdos-bootdisk | /home/horshack/bin/bootdisk_autoanswer.pl | /usr/bin/dmail # spams are signed with a special header # move these mails directly to a subfolder of my mailfolder :0: * ^X-Spam-Flag: YES |/usr/bin/dmail +mail/spam # move mails with special subjects directly to a subfolder # of my mailfolder :0: * 1^0 ^Subject: feedfindus oberasbach, Status vom * 1^0 ^Subject: feedfindus pfarrkirchen, Status vom * 1^0 ^Subject: feedfindus erding, Status vom * 1^0 ^Subject: feedfindus marktredwitz, Status vom * 1^0 ^Subject: feedfindus selb, Status vom * 1^0 ^Subject: feedfindus wunsiedel, Status vom * 1^0 ^Subject: feedfindus ansbach, Status vom * 1^0 ^Subject: feedfindus kalchreuth, Status vom |/usr/bin/dmail +mail/findus_automail # The rest simply to my mailfolder's inbox :0: | /usr/bin/dmail |