[Gllug] Small send-only mail transport agent

Dave Cridland dave at cridland.net
Wed Mar 6 13:47:09 UTC 2002


On Tue, 2002-03-05 at 14:39, John Edwards wrote:
> On a related topic, has anyone got any suggestions for a mail daemon that 
> will just send email rather than receieve it ? 

Sendmail, but run it with -q 15m instead of -bd. Then it won't serve
[E]SMTP at all. Or run it with just -q, via CRON.

It's very unfashionable to mention sendmail, these days, but it does
work, and does everything. It is a little tricky to get your head around
it's configuration concepts, but it's actually not as hard to learn as
people seem to think. (Although I can't figure out the M4 stuff to save
my life.)

> 1. Rewrite email addresses (eg mail to root at localhost goes to 
>     sysadmins at domain.net).

Locally via /etc/aliases, extended locally via /etc/mail/virtusertable
(on most distributions), or write arbitary rewrite rules with a very
minor bit of cf hacking. I'll be glad to offer several pointers on
where.

> 2. Send email onto another mail relay.

If you want *all* email sent to a *single* MTA, use the Smart Host
stuff. Otherwise it'll just happen. Smart Host is probably better, since
it's lighter on resources that way.

> 3. Queue mail locally if the relay is unavailable.

It'll just happen. More accurately, sendmail queues mails anyway - it's
a config option that's normally set - then tries to get them out
immediately. You can configure it to try sending on first, then queue,
but you run more of a risk of losing email. Bearing in mind it's logs,
you probably want to avoid that.

> 4. Do not receive any incoming SMTP connections, nor deliver locally.

Shouldn't be a problem. You can tell sendmail that anything which was to
be delivered locally should instead have a different domain tacked on.
You can also actually redefine the local mailer to be SMTP to another
host, or indeed redefine the local mailer to just generate errors, if
you've only a few local users you ought to be using. Depends on what you
want to be doing.

Some distributions of sendmail actually come configured to listen only
on localhost, as well - RH's does, for instance. In any case, my start
arguments as above should do the trick.

> I know most mail servers such as exim can be setup this way, but I would 
> rather avoid a fully featured MTA if possible for reasons of performance 
> (some of the boxes are 33MHz 486's with 16MB of RAM) and for security (if 
> it can't recieve mail then it can't be act as an open relay).

Sendmail is actually lighter than people think. It's also capable enough
to handle things sensibly under load - just tell it not to bother doing,
for instance, queue runs when the load is high.

Alternatively, I'd suggest installing qmail, and only running the bits
you want, but I have no idea if it'll handle everything you want to do.

Any MTA should be able to manage all this, though - I only suggest
sendmail simply because I personally know it can.

Dave.


-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list