Other often asked questions about sendmail

Last Update 2003-02-22


Which sendmail version do I run?

To find out which version of sendmail is installed on your system, you can try the following commands:

sendmail -d0.4 -bv root
should tell you its version and some basic settings.

telnet localhost 25
sendmail should greet you with its welcome message and tell you the version of its binary and config file. Enter QUIT to leave this mode.

I can't send mail to users whose accounts have upper case letters.

First: Don't use uppercase letters...: man 5 passwd on a SunOS 4 machine:
     username       is the user's login name.   This  field  con-
                    tains  no  uppercase characters, and must not
                    be more than eight characters in length.
If you really need it, set the flag 'u' for the local mailer. If you don't have sendmail 8.10 you need to change the flags:
define(`LOCAL_MAILER_FLAGS', `urmn9')
sendmail 8.10 provides a better way to do this:
See the Sendmail Installation and Operation Guide:
u   Upper case should be preserved in user  names  for
    this mailer.

If you use procmail as local mailer, make sure you define NO_USER_TO_LOWERCASE_HACK (in config.h?).

cannot alias non-local names

If you get the error: name: cannot alias non-local names when running newaliases (or sendmail -bi), there are several possibilities to check:
  1. Does
    sendmail -bt
    > 3,0 name
    resolve to the local mailer?
  2. Make sure you have the flag F=A for Mlocal in your sendmail.cf. (This applies to sendmail 8.8 and later).

Quota on mail spool?

This is not a sendmail problem, but one of the local delivery agent. Check your Mlocal line in your sendmail.cf. If you have procmail you're settled, it obeys quotas. So you can install quotas on your mailspool (check with your OS version, e.g., man quota), and everything should work. You can also tell procmail to deliver e-mail into the HOME directory of the user, so you have solved several problems at once.

How to limit the size of mail separately for each recipient?

There is no simple solution for this. It might be easy if the sender announces the (correct) size of the e-mail via SIZE= in the MAIL FROM: command. In this case, it would be possible to compare that size against the allowed size for each recipient when those are specified by RCPT TO:. However, if the size isn't given, it can be only determined after all recipients have been given. In that case, the mail might be accepted for some but not for others. Hence the solution to have quota on mail spool might be best. Another (crude) workaround is to define different mails with different size restrictions and select those accordingly to the recipients limitations.

How to route all mail to a single user?

Sometimes you want to route all mail for a domain to a single user. You can do this by a rule like this:
R$+ < @ the.domain. >		$#local $: the-user			all to one user
This usually goes into ruleset 0. Another way is to use the virtual user table FEATURE.

How to route mail to unknown users to one account?

sendmail 8 has a feature to route all mail which ends up as local on the system but isn't a valid account (or alias), to another system (the so-called LUSER_RELAY), see cf/README (from 8.8). However, this feature is disrecommended, since it can break ``working'' addresses if you introduce new local users.

If you want to route all mail to unknown users to one account (instead of giving the standard error reply), you can put in your .mc file the following:

or in some cases:
Something similar can be accomplished for virtual domains.

Class w contains all local addresses

sendmail 8.8 and later includes all local addresses into class w to avoid the well-known config error: mail loops back to myself. If this is not intended, there's an undocumented compile-time-option in 8.8 which is enabled in later version, -D_FFR_DONT_PROBE_INTERFACES_OPTION which enables the option O DontProbeInterfaces in your sendmail.cf. Set it to True to keep sendmail from adding all local addresses to class w.

Map types: makemap/sendmail: Type hash/dbm not supported in this version

sendmail supports several map types. The main types are:
requries the compile flag -DNEWDB. This is the new Berkeley DB package. If your system does not have this pre-installed, or the version installed is not version 2.0 or greater (e.g., is Berkeley DB 1.85 or 1.86), get the current version from http://www.sleepycat.com/.
requries the compile flag -DNDBM. This is the older NDBM implementation.
Make sure the map type you're trying to use is compiled into your version of sendmail and makemap.

How do I change the sender address depending on the recipient?

There are several ways how to do it. One idea is to select different mailers according to the recipient, and then change the rewrite rules for the sender for that mailer. Here's an example: Make a copy of one of the smtp mailers in cf/mailer: mymailer.m4
###  MYSMTP Mailer specification  ###

VERSIONID(`@(#)mysmtp.m4	0.1 (ca) 1998-09-26')

Mmysmtp,		P=[IPC], F=CONCAT(mDFMuX8, SMTP_MAILER_FLAGS), S=mysmtp, R=ifdef(`_ALL_MASQUERADE_', `21/31', `21'), E=\r\n, L=990,
and add something like this:
Rfriend<@some.domain.>$*	$#mysmtp $@ some.domain. $: friend<@some.domain.>$1	
#  sender rewriting for mysmtp
R$+			$: $>51 $1			sender/recipient common
R$* :; <@>		$@				list:; special case
R$*			$: $>61 $1			qualify unqual'ed names
R$* < @ *LOCAL* > $*	$: $1 < @ Domain.For.Friend . > $2		use full name
(or whatever rewriting you need/want) to your .mc file (if you need this for more than one address, use a class for the match).

NOQUEUE: Null connection from host.domain [IP.AD.DD.RESS]

An entry like:
NOQUEUE: Null connection from host.domain [IP.AD.DD.RESS]
in the logfile means that host.domain connected to your MTA but didn't issue any commands. Unless this happens very often, you can ignore this. If it happens very often, it's either someone playing around or it's a network problem.
[(links)] [Hints] [Avoiding UBE] [cf/README] [New]
Copyright © Claus Aßmann Please send comments to: <ca at sendmail.org>
Disclaimer: the information provided may be inaccurate or outdated or incomplete. Please contact me if you find an error.