[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: sendmail trouble

James Vahn wrote:
> I'm unsure why sendmail runs as root if exim/postfix don't.

In order to deliver mail to the local user's mailbox the MDA (mail
delivery agent) needs to run as the user.  Same for being piped into a
mail filter such as spamassassin.  In order to switch to a user the
program needs root capability.  Also to bind to the network port 25
(privileged ports below 1024) requires root.  Since sendmail is one
single program it is that program that runs as root.  In Postfix there
is a root run master program for that purpose.  But the other tasks
are run as a non-root user.

> Well, I'm not exactly convinced that anyone should be saying anything
> like "dump sendmail, run postfix or exim" (a poor quote, sorry).

I have opinions and when asked I won't be shy about sharing them.  I
think Postfix is definitely a better MTA than Sendmail.  I will keep
my previous recommendation.

> Do they have nice config/setup programs? I don't like sendmail's
> very much, it requires manually editing sendmail.conf. Not a
> particularly difficult task, but still.. :(
>         ~# dpkg-reconfigure sendmail  ...Doesn't work.

  dpkg-reconfigure postfix  # works
  dpkg-reconfigure exim4    # works

> The examples I can think of are very few. Using m4 macro's is not
> complicated.. Exim is complicated.

While the m4 macros cover most common things they don't cover every
possible case.  Here is an example.  Years ago in sendmail I needed to
deliver mail in a particular way.  I needed machines in the same
domain to be delivered directly with smtp but mail outside the domain
to be delivered to a smart host.  I won't get into the DNS issues with
why using MX records was insufficient in my case.  Here is the best
configuration I found at the time for sendmail.  There was no m4 macro
support for this.  That was a while ago and who knows but there might
be now.

  R$* < @ $* .$m. > $*    $#esmtp $@ $2.$m $: $1 < @ $2.$m > $3

With postfix I changed the transport map file to have the first line
and the main.cf to have the second line.  To me this is much simpler.
If the mail matches the left hand side then do the action on the right
hand side.

  .example.com            smtp:

  relayhost = smtp.$mydomain

Later I needed specific routing to get around firewalls creating
isolated network bubbles.  I modified the transport map as follows.

  subdomain.example.com   smtp:smtp.subdomain.example.com
  .example.com            smtp:

  relayhost = smtp.$mydomain

To do the same with Sendmail I believe (without testing) I would have
needed this.  I think this would work.  Perhaps now there is an m4
macro that covers this case.  (shrug)

  R$* < @ $* .$m. > $*    $#esmtp $@ $2.$m $: $1 < @ $2.$m > $3
  R$* < @ $* .subdomain.$m. > $*    $#esmtp $@ $2.subdomain.$m $: $1 < @ $2.$m > $3

The common thing that a zillion other people are doing is usually
going to be the streamlined case that is simple.  The m4 macros cover
those cases well enough.  But just the same in the above examples I
find the postfix table driven configuration to be quite powerful and
yet still intuitive.


Attachment: signature.asc
Description: Digital signature

Reply to: