or her mail delivered -- i.e., the mail drop.


UC Berkeley is (was) in the process of setting up their
environment so that mail sent to an unqualified "name" goes to that
person's preferred maildrop; mail sent to "name@host" goes to that
host. The purpose of "FEATURE(notsticky)" is to cause "name@host" to
be looked up in the user database for delivery to the maildrop.



http://www.sleepycat.com/packages/db.1.85.tar.gz.
If you install this library, edit the Makefile to include the
right option (-DNEWDB), and then make sendmail again, you get a
binary which has the database features described in the book and
the documentation provided in the sendmail source archive.


If you're using SGI Irix above 4.x, see
Q2.16 for the patches
you will need to get db 1.85 working on your machine.



always_add_domain
has the same effect. Because of this difference, the user database
does not rewrite these headers.


One solution to this problem is to make the following change in
the sendmail.mc file compiled by m4 into your /etc/sendmail.cf (or
wherever your sendmail.cf file is located) after you have the user
database option installed and working with other MUAs:


Early in the section(s) where you are setting configuration
variables, add the following:


# Define our userdb file for FQDN rewrites
Kuserdb btree -o /etc/userdb.db

And a bit later, before the "MAILER()" entries, but after other
configuration options have been set:

LOCAL_RULE_1
########################################################
### Local Ruleset 1, rewrite sender header & envelope ##
########################################################
#Thanks to Bjart Kvarme <bjart.kvarme@usit.uio.no>
S1
R$- $1 < @ $j . > user => user@localhost
R$- < @ $=w . > $* $: $1 < @ $2 . > $3 ?? $1 user@localhost ?
R$+ ?? $+ $: $1 ?? $(userdb $2 : mailname $: @ $)
R$+ ?? @ $@ $1 Not found
R$+ ?? $+ $>3 $2 Found, rewrite

#NOTE ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^
# Use Tab Characters Use Tab Characters in these regions
# to make three columns (the line with "mailname" only has 2 columns).

Now the user database should re-write messages sent with Pine or
anything else that causes local users to have their address be fully
qualified (both header and envelope sender will be properly
re-written). If this still does not work for you, try adding the
following to either the system-wide pine.conf, pine.conf.fixed, or
your personal .pinerc:


user-domain=localhost


This has been known to help solve the problem for some people.


However, a more elegant (read: m4-based) solution for version 8
sendmail users has yet to be created.



Virtual Hosting page.



Using UUCP Mailers page.



Compiling Sendmail page.



OSTYPE
page for details.


If this is on a Sun workstation, you might also want to take a
look at the local mailer flags in the Sun-supplied sendmail.cf and
compare them to the local mailer flags generated for your version 8
sendmail.cf. If they differ, you might try changing the V8 flags to
match the Sun flags.



FEATURE(masquerade_envelope)

in your sendmail.mc file to change this behavior.
This is discussed in greater detail at the configuration
Masquerading and Relaying page.



ftp://gatekeeper.dec.com/pub/DEC/gwtools/
(with contributions from Paul Vixie).



FEATURE() macros simply change
the definition of internal variables that are referenced in the
MAILER() definitions.


To make sure that everything works as desired, you need to make sure that
OSTYPE() macros are put at the very beginning
of the file, followed by FEATURE() and
HACK() macros, local definitions, and at the
very bottom, the MAILER() definitions.
See the configuration Introduction and Example
page for more details.



Perl Language Home Page.
The O'Reilly book
is also very helpful.


If you don't have Perl, something like the following script should do the
trick:


#!/bin/sh
telnet mail.myisp.com. 25 << __EOF__
EHLO me.mydomain.com
ETRN mydomain.com
QUIT
__EOF__


Note that this is indented for readability, and the real script
would have column position #1 of the file be the first printable
character in each line.


Of course, you'll have to fill in the appropriate details for
"mail.myisp.com", "mydomain.com", etc....



If your ISP doesn't use version 8.8 sendmail, you may have to
cobble together alternative solutions. They may have a "ppplogin"
script that is executed every time your machines dials them up, and
if so, you may be able to have them modified this script so as to
put a "sendmail -qRmydomain.com" in it (which is effectively what
the "ETRN" command does, but in a safer fashion).


Alternatively, they may have a hacked finger daemon, so
that you'd put "finger mydomain.com@theirhost.theirdomain.com"
in your script. Or, they may have some other solution for you.
However, only they would be able to answer what solutions they have
available to them.


Obviously, the easiest and most "standard" solution is to have
them upgrade their system to the most recent stable release of
version 8.8 sendmail.



MetaInfo, Inc..



Allowing
controlled SMTP relaying in Sendmail 8.9 page.



FEATURE(virtusertable)

;
detailed instructions are provided at our
Virtual Hosting with Sendmail page.




Q3.29 -- How can I add a header specifying the actual recipient when having
multiple users in a virtual domain go to a single mailbox?


Date: July 2, 1998


Stuffing multiple user's mail into a single mail box is not a good method of
distributing user mail but if you must do this, the following solution should
allow a tool like fetchmail to separate the messages for individual users.


  1. Use FEATURE(local_procmail) in your .mc file
    so procmail (which you must install separately) will deliver mail to
    the mailbox.

  2. Use FEATURE(virtusertable) to create a virtual user table
    entry for the domain as follows:

    @domain.com domuser+%1

    where domuser is the username of the mailbox you will be using.
  3. Put this in the respective domuser's
    $HOME/.procmailrc:

    DOMAIN=domain.com
    ENV_TO=$1

    :0f
    * ENV_TO ?? .
    | formail -i "X-Envelope-To: "$ENV_TO@$DOMAIN

    :0fE
    | formail -i "X-Envelope-To: UNKNOWN"

    This will insert an X-Envelope-To header with the original
    envelope recipient address when the message is delivered the normal way
    via the virtusertable, and UNKNOWN if for some reason it was
    sent directly to domuser.






    4. GENERAL SENDMAIL ISSUES






ftp://ftp.greatcircle.com/pub/majordomo/.
It is written in Perl and
requires either Perl 4.036, and appears to run with only minor tweaks
under 5.001a or later. Make sure to check out the web interface for
Majordomo called "Mailserv" at
http://iquest.com/~fitz/www/mailserv/
or "LWGate" at
http://www.netspace.org/users/dwb/lwgate.html.
The latest versions of Perl (both 4.x and 5.x) can be found in
http://www.metronet.com/perlinfo/src/.
More information about Perl can be found at
http://www.metronet.com/perlinfo/perl5.html


The latest version of ftpmail can be found at
ftp://src.doc.ic.ac.uk/packages/ftpmail
or any comp.sources.misc archive (volume 37).



ftp://ftp.cs.columbia.edu/pub/hlfsd/README.hlfsd,
while the actual archive of the papers is at
ftp://ftp.cs.columbia.edu/pub/hlfsd/hlfsd-paper.tar.gz
(tar archive, gzip'ed).



ftp://ftp.his.com/pub/brad/sendmail/syslog_stats.
The updated version of ssl has been uploaded to the SMTP Resources
Directory (in
ftp://ftp.is.co.za/networking/mail/tools/),
as well as
ftp://ftp.his.com/pub/brad/sendmail/ssl.
There is also another program (written by Bryan Beecher) at
ftp://ftp.his.com/pub/brad/sendmail/smtpstats.


If you're interested in summarizing POP statistics, there is
ftp://ftp.his.com/pub/brad/sendmail/popstats,
also written by Bryan Beecher.


To see what else is available today, check the Comprehensive Perl
Archive Network
ftp://ftp.funet.fi/pub/languages/perl/CPAN/CPAN
or ftp://ftp.cis.ufl.edu/pub/perl/CPAN/CPAN
for the site nearest you.
For the scripts themselves, look under CPAN/scripts/mailstuff/ at
any CPAN site. For more information, see the comp.lang.perl.* FAQs at
ftp://ftp.cis.ufl.edu:/pub/perl/faq/FAQ or
ftp://rtfm.mit.edu/pub/usenet-by-hierarchy/comp/lang/perl/.


There is also the "Sendmail Statistics Project" which has a web page at
http://www.josnet.se/projects/ssp/.
Although they have
examples online of what the output might look like, it now appears
that this project is either dead or at least indefinitely on hold.
Still, you may be able to talk to the authors in order to get what
code from them you can.



If you're interested in using these kinds of tools to help
you do some near real-time monitoring of your system, you might be
interested in MEWS (Mail Early Warning System). From the README:


If you've ever written a perl script to parse sendmail
log files looking for errors, MEWS might be of interest to
you. If you've ever thought about writing a perl script to
munge sendmail log files, cringed a little and hurriedly
came up with an excuse not to do it, read on.

If you don't have a Solaris 2.5 machine, you can probably
stop reading here.

The Mail Early Warning System (MEWS) gives postmasters
immediate notification of trouble spots on your mail
backbone. It only works with sendmail.

To explain it in a nutshell, whenever sendmail returns a
4xx or 5xx SMTP code, with the MEWS modifications, it also
sends the code over UDP to a daemon which then replays the
error message to interested parties. The man pages go into
a little bit more detail.

If this sounds like something you might be interested in
getting more details about, you can find the MEWS archive at
ftp://ftp.qualcomm.com/pub/people/eamonn/mews.tar.Z.



ftp://ftp.informatik.rwth-aachen.de/pub/packages/procmail/.


Procmail is also the core to a mailing list management package
called "SmartList", so if you've already got procmail, adding
SmartList may be a good option. Some listowners prefer Majordomo,
Listserv, or one of those other programs, but SmartList has more than
a few adherents as well. Your personal tastes will dictate whether
you swear by SmartList or at it.



Q3.22 for more
information.


You also need to designate a
"smart host" or
external relay to handle all mail that you can't deliver locally (this would
be your ISP's mailhost).


You need to configure it so that the smtp mailer is considered
"expensive" by adding the F=e mailer flag and tell sendmail
not to connect to expensive mailers by default by setting the

HoldExpensive
option to True.


You need to add mydomain.com to the sendmail.cw
file or the Cw line in the sendmail.cf. See
Q4.5.


Finally, you need to run a program periodically to check in with your
ISP and get them to deliver any mail they may have queued for you. See
Q3.23.




    5. VENDOR/OS SPECIFIC SENDMAIL ISSUES







5.1 -- Sun Microsystems SunOS/Solaris 1.x/2.x






Q5.1.1 -- How can I solve "line 273: replacement $3 out of bounds"
errors?


Date: March 23, 1996


When I use sendmail V8 with a Sun config file I get lines like:


/etc/sendmail.cf: line 273: replacement $3 out of bounds

the line in question reads:

R$*<@$%y>$* $1<@$2.LOCAL>$3 user@ether

what does this mean? How do I fix it?


V8 doesn't recognize the Sun "$%y" syntax, so as far as it is
concerned, there is only a $1 and a $2 (but no $3) in this line. Read
Rick McCarty's paper on "Converting Standard Sun Config Files to
Sendmail Version 8", in the contrib directory (file
"converting.sun.configs") in the latest version 8 sendmail
distribution for a full discussion of how to do this.




Q5.1.2 -- How can I solve "line 445: bad ruleset 96 (50 max)" errors?


Date: March 23, 1996


When I use sendmail V8 on a Sun, I sometimes get lines like:


/etc/sendmail.cf: line 445: bad ruleset 96 (50 max)

what does this mean? How do I fix it?


You're somehow trying to start up the old Sun sendmail (or
sendmail.mx) with a version 8 sendmail config file, which Sun's
sendmail doesn't like. Check your /etc/rc.local, any procedures that
have been created to stop and re-start the sendmail processes, etc....
Make sure that you've switched everything over to using the new
sendmail. To keep this problem from ever happening again, try the
following (make sure you're logged in as root):


mv /usr/lib/sendmail /usr/lib/sendmail.old
ln -s /usr/local/lib/sendmail.v8 /usr/lib/sendmail