Mainpage
Searchform
History
Versions
Categories
Contents
Deutsch
SuSE Linux: Version 5.0
Any unecessary connect should be avoided. This is achieved by queuing
the mails first and let them be delivered afterwards. First you should edit
the sendmail startup script in /sbin/init.d/sendmail
and remove
the parameter "-q30m"
. If this parameter exists the queue will
be emptied every 30 minutes.
First you should create a m4
which serves as a template for
sendmail. Create a file /etc/sendmail.config/cf/linux.smtp-off.mc
:
include(`../m4/cf.m4') VERSIONID(`linux for smtp-only(offline) setup')dnl OSTYPE(linux)dnl define(`confDEF_USER_ID', `daemon:daemon')dnl define(`confTRUSTED_USERS', `uucp mdom wwwrun')dnl define(`QUEUE_DIR', `/var/mqueue')dnl define(`PROCMAIL_MAILER_PATH', `/usr/bin/procmail')dnl define(`confSERVICE_SWITCH_FILE',`/etc/service.switch')dnl define(`confUSERDB_SPEC',`/etc/userdb.db')dnl define(`confHOSTS_FILE',`/etc/hosts')dnl define(`confSAFE_QUEUE',`True')dnl define(`confCON_EXPENSIVE',`True')dnl define(`SMTP_MAILER_FLAGS',`e')dnl FEATURE(local_procmail)dnl FEATURE(nocanonify)dnl FEATURE(nouucp)dnl FEATURE(nodns)dnl FEATURE(always_add_domain)dnl FEATURE(masquerade_envelope)dnl MAILER(local)dnl MAILER(procmail)dnl MAILER(smtp)dnlFor a detailed description of the entries please have a look at the sendmail documentation. Here we only mention some of them roughly:
confCON_EXPENSIVE
: SMTP_MAILER_FLAGS
: confSAFE_QUEUE
: confUSERDB_SPEC
: always_add_domain, masquerade_envelope
:confSERVICE_SWITCH_FILE
: nocanonify, nodns
: confTRUSTED_USERS
:
Next the file /etc/service.switch
should be created
(see entry sendmail using SMTP but no DNS:
hosts files aliases files
The next step is to create a database which allocates email addresses to local users. There are two lines a user:
:mailname
email address
:maildrop
Loginname
anna:mailname anna.sampleuser@provider.de anna.sampleuser@provider.de:maildrop anna
Now you are able to generate the configuration files, or to convert them into
a format readable by sendmail, respectively.
Here comes the template for the sendmail configuration file. Since this
procedure will overwrite the SMTP template from the sendmail package it is
recommended to save it first!
mv /etc/sendmail.smtp.cf /etc/sendmail.smtp.cf.CDROMthereafter create a new template:
cd /etc/sendmail.config/cf m4 < linux.smtp-off.mc > /etc/sendmail.smtp.cfNow we have to deal with the user database (UserDB):
makemap btree /etc/userdb.db < /etc/userdbNow we do have a template. All additional work may be done with YaST. Invoke YaST and choose
Administering the system -> change configuration fileThere are some variables to control sendmails behaviour:
SENDMAIL_TYPE="smtp"
: SENDMAIL_SMARTHOST="relay:mail.provider.de"
: relay:
configures a "mailer"
that is given in the sendmail configuration.
There should be an entry for mail.provider.de
in
/etc/hosts
although it's only needed for actually sending
the mails. You may just enter the domain name provider.de
then a request to the nameserver will be sent asking for the
mailserver.
SENDMAIL_LOCALHOST="localhost"
: localhost
.
SENDMAIL_RELAY=""
: SMTP="yes"
: =
und "
) is of course not set
by YaST.
Well, that's all as far as configuration is concerned. You only need to restart sendmail.
/sbin/init.d/sendmail stop /sbin/init.d/sendmail start
Of course you need to test your configuration.
We just start a test:
/usr/sbin/sendmail -bv anna.sampleuser@provider.deThe result should resemble
anna.sampleuser@provider.de... deliverable: mailer relay, host mail.provider.de,user anna.sampleuser@provider.deIf this ran smoothly you may risk a first run. First just use a "tiny" mail agent as
mail
or mailx
We just send a uname -a
.
Start being the user given in the Userdb. Just send a mail to your account:
uname -a | mailx -s TEST anna.sampleuser@provider.deNow two files in
/var/mqueue
will be created by sendmail.
There is one starting with df that contains the message body
( in this case the output of uname -a
. The second file starting
with qf
contains the header information. Here the following lines
are of interest:
$_anna@localhost Sanna RPFD:anna.sampleuser@provider.de H?P?Return-Path: <anna.sampleuser@provider.de> H?F?From: "Anna M." <anna.sampleuser@provider.de> HTo: anna.sampleuser@provider.deNow the mail (or even more) may be send:
sendmail -qThere are two logfiles that contain information on how (or if) the message(s) was sent:
/var/log/mail
and /var/log/messages
.
The mail may now be fetched by fetchmail.
Be aware that this stupid tool (mail
) is not very useful for
mailing as it changes the mail header and adds a return path which contains
the local login and hostname. To avoid this just use a mature mail program as
pine
(e.g.). They are able to hand the correct information to
sendmail and everything will run smoothly.
For certain mail agents (e.g. pine
) you have to tell not to
change the header ( the From line). There is an alternative. Just enter the
users listed in the Userdb as "trusted". This might be done in the m4 makro in
confTRUSTED_USERS
or in /etc/sendmail.smtp.cf
.
##################### # Trusted users # ##################### # this is equivalent to setting class "t" #Ft/etc/sendmail.ct Troot Tdaemon Tuucp mdom wwwrun TannaThere is no sense in changing the sendmail configuration file
/etc/sendmail.cf
as this will be (re)created
with each run of YaST or SuSEconfig respectively.
/etc/sendmail.smtp.cf
for SMTP or in
/etc/sendmail.uucp.cf
for UUCP respectively.
/etc/service.switch
) for separating the columns.
See also:
/etc/sendmail.cf
/etc/sendmail.cf
Keywords: MAIL, SENDMAIL, SMTP, OFFLINE
Feedback welcome: Send Mail to mt@suse.de (Please give the following subject: SDB-smt_sendmail
)
Mainpage
Searchform
History
Versions
Categories
Contents
Deutsch