Home

Search this site:
 

Horshack’s
very
own site

 

This is Bavaria, Germany!
You will find links to Perl,
bootdisks for system administration,
a lot of Linux,
Windows administration
and some personal belongings.
Installing a new Debian system

Installing sendmail & Co. on Debian/Vserver

Vserver cannot handle daemon which bind to * (127.0.0.1 and official IP-addresses). Do what you can to avoid this!

Install Sendmail

You need make to create sendmail.cf from sendmail.mc-file.

# apt-get install make
# apt-get install sendmail

Config local "submitmail"

There are a lot of programs which submit mails via commands like this:

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

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.

Config local smarthost

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

Accept mails for these destination-domains: relaying

Put a line for every destination-domains into /etc/mail/relay-domains:

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.

Accept mails from these mailaddresses, networks

You have to use /etc/mail/access

 [todo]

Deliver some mailaddresses locally

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

 

Installing procmail

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 restart
This 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


Impressum