This documentation also features the following items:
Important note for sendmail experts: this document refers to the
sendmail configuration as it is used by LLL and LTNB, and is a
functional description. I am fully aware that by manually tweaking
sendmail.cf, you can obtain different precedences between the various
config files. Moreover, this is a functionaly description:
the order of checks as performed by the sendmail.cf rules may
not be the same as represented, however, the system behaves as if
files were checked in the order presented.
Overview
--- linux.mc.rpmnew Wed Sep 6 01:17:10 2000 +++ linux.mc Sat Mar 3 07:52:08 2001 @@ -119,7 +119,7 @@ dnl to accept further hostnames as local email, add them here or put dnl them into the `/etc/mail/sendmail.cw' file. dnl -dnl FEATURE(`use_cw_file')dnl +FEATURE(`use_cw_file')dnl dnl dnl This FEATURE enables (open)ldap and requires some arguments. For dnl information see http://www.stanford.edu/~bbense/ldap/. Note that thisEnable the sendmail.cw file (needed for serving mail to multiple domains).
@@ -159,9 +159,9 @@ dnl for rejecting well known spammers dnl (see http://maps.vix.com/ and http://www.orbs.org/). dnl -dnl FEATURE(`dnsbl')dnl +FEATURE(`dnsbl')dnl dnl FEATURE(`dnsbl',`dul.maps.vix.com',` Mail from $&{client_addr} rejected - dul; see http://maps.vix.com')dnl -dnl FEATURE(`dnsbl',`relays.orbs.org', ` Mail from $&{client_addr} rejected - open relay; see http://www.orbs.org')dnl +FEATURE(`dnsbl',`relays.orbs.org', ` Mail from $&{client_addr} rejected - open relay; see http://www.orbs.org')dnl dnl dnl dnl Just add the local domain if the email address doesn't have oneEnable spam filtering features
@@ -188,6 +188,11 @@ dnl MASQUERADE_DOMAIN(`otherdmain.notused')dnl dnl FEATURE(`limited_masquerade')dnl dnl +dnl +dnl use procmail for local mail delivery. the exact pathname is given above. +dnl +FEATURE(`local_procmail')dnl +dnl dnl These mailers are available. per default only smtp is used. You have dnl to add entries to /etc/mail/mailertable to enable one of the other dnl mailers.Deliver local mail via procmail. Allows users more customization options via their .procmailrc file.
@@ -218,3 +223,20 @@ dnl dnl Cw localhost www.domain.notused dnl + +dnl LTNB specific stuff +define(`confCONNECTION_RATE_THROTTLE', `3')dnl +dnl +dnl Settings recommended by http://sendmail.net/?feed=dostips +dnl +define(`confMIN_FREE_BLOCKS', `4000')dnl +define(`confMAX_MESSAGE_SIZE', 1000000)dnl +define(`confAUTO_REBUILD', False)dnl +define(`confREFUSE_LA', 8)dnl +dnl +dnl MAX_DAEMON_CHILDREN recommended is 40 for 128MB of Ram: take half of +dnl it, as lots of other stuff is running on Pollux too +define(`confMAX_DAEMON_CHILDREN', 12)dnl +dnl define(`confMAX_HEADERS_LENGTH', 32)dnl Not supported yet +define(`confMAX_MIME_HEADER_LENGTH', 1024)dnl +define(`confMAX_RCPTS_PER_MESSAGE', 100)dnlSet resource limits (number of connections, minimum available disk space, max spawned processed, ...) in order to prevent sendmail from crashing under unusual load. Such unusual load may happen as a result of a deliberate cracking attempts (some student had attempted to set up a mail loop to do this last year), or inadvertantly (when reconnecting network after a week long outage, some computers have a huge amount of mail to postmaster piled up, which they unload at once when reconnecting).
Linux.mc is not directly read by sendmail. Rather, it has to be convered into /etc/sendmail.cf using the following command:
m4 </etc/mai/linux.mc >/etc/sendmail.cf
address code message
address | This is the e-mail address of the spammer to be
blocked. Either the complete address (just4me17@usa.net),
or just the domain (usa.net). If only the domain is
indicated, all mails from that domain are rejected.
|
code | an error code to return to the sending mailer, usually 550 |
message | an error message to return to the sending
mailer. Chose any witty comment that you like.
|
susan@bfg.com 550 Please keep your spam to yourself s431@aol.com 550 Please keep your spam to yourself excte.com 550 Please keep your spam to yourself doctor.com 550 Doctor, whenever I eat Hormel products, I feel a strong urge to throw up violently. What can I do about this?
Aliases may have more than one target, and may be spread over several lines (each line having a blank in the first column is considered as a continuation) Example:
pe: Jean-Paul.Gedgen, Alain.Rassel, Alain.Knaff, Ramon.Kirsch, Charles.Lopes, Michel.Stoltz, Pierre.Fattebene, Marc.Teusch Mike.BorschetteTargets themselves are expanded. If you don't want to further expand targets, prepend with a backslash (\). Example:
root: joe, \root
jpg Jean-Paul.Gedgen mstoltz Michel.Stoltz arassel Alain.Rassel aknaff Alain.Knaff rkirsch Ramon.Kirsch ejpg Eleve.Jpg emstoltz Stoltz.Michel mteusch Marc.Teusch mborsche Mike.BorschetteThis means that mails sent from jpg have their From address replaced by Jean-Paul.Gedgen, etc. Be sure to have the reverse mapping in aliases or virtusertable, or else those users won't receive replies to their mails. Automatically maintained by webmin, but it should be ok to edit manually if you avoid both login names and aliases covered by webmin.
N.B. When sending mail from a browser, this is actually not used, as the browser himself already sets the long name as sender. As far as I know, this file only comes into play when sending mail from the command line.
francois@knaff.linux.lu fknaff melie@knaff.linux.lu mknaff alain@rassel.lu alain sylvie@rassel.lu speters alainsylvie@rassel.lu speters michel@rassel.lu mrassel david@rassel.lu dbelardi david.belardi@rassel.lu dbelardi
This is useful if our mailer is itself an MX record for another domain, but doesn't handle the mail itself. Without the mailertable, our mailer would look up the target domain using its MX record, which would point to itself, leading to an error.
Example:
ltnb17.ltnb.lu smtp:ltnb17.ltnb.lu hitchhiker.ltnb.lu smtp:[158.64.28.42] nemo.ltnb.lu smtp:[158.64.29.225]This means for instance that mail sent to ltnb17.ltnb.lu will be delivered via SMTP to host ltnb17.ltnb.lu (this is actually not a redundant information: DNS considers mail addresses (MX Records) and IP hosts (A Records) to be distinct. The left hand side refers to the mail address, whereas the right hand side refers to a host).
Mailertable can also be used to specify mail to be delivered local, in addition to sendmail.cf. The advantage is that it allows a more flexible syntax (specifying only domain names rather than full names):
.ltnb.lu local:This says that all mail sent to an address ending in .ltnb.lu is to be considered local. The disadvantage of this approach are the following:
Explanation: Sendmail normally refuses mail where neither the sender nor the recipient is a local user. For example, our sendmail would refuse to relay mails which are sent from a user @www.digital.com to a user at @www.ibm.com. This is done in order to avoid that spammers abuse our mailer to relay their meat products. Obviously mail where either the sender or the recipient is local is accepted, or else we would not be able to communicate. For instance, if an ltnb user sends to ibm.com, the mail is relayed all right. If a digital.com user sends to an ltnb.lu user it is relayed too.
The relay-domains file defines which hosts are considered local. It can contain both domains (mail.ltnb.lu), IP addresses (158.64.28.254), or shorthands thereof (158.64.28.). Two kinds of domains need to be included (which often overlap):
158.64.28.
158.64.29.
These match any IP address which start with 158.64.28. or
158.64.29.
ltnb.lu
This matches any domain which ends in ltnb.lu
N.B. Addresses used in virtusertable must also be set in sendmail.cw . Addresses relayed using mailertable should not be set in sendmail.cw. In summary, if an MX record point to our mailer, the corresponding address should be either in sendmail.cw or in mailertable.
Unlike relay-domains, domains listed in sendmail.cw
are interpreted as exact matches; for example
ltnb17.ltnb.lu would not match ltnb.lu.
When are two domains identical for sendmail?
If an address A is a CNAME for another name B, all occurrences of A
are considered by sendmail to be equivalent to B. A does in that case
not be mentioned separately in sendmail.cw, mailertable or
virtusertable.
However, if an address C is an MX Record pointing to D, both are considered different, and C should definately be set either in sendmail.cw or in mailertable. In that case, it doesn't even matter whether D is a CNAME for something else or not.
When setting domains equivalent via CNAMES, be careful though that it
cuts both ways: If you set for instance www.estuaires.ltnb.lu to be a
CNAME for www.ltnb.lu, this means that sendmail will have no way of
distinguishing between webmaster@www.estuaires.ltnb.lu and
webmaster@www.ltnb.lu !
Adding a new domain for sendmail
When adding a new domain for sendmail, the following actions need to
be performed: