Re: [Exim] Sanity Check - Mailer-Daemon

Top Page
Delete this message
Reply to this message
Author: Greg Ward
Date:  
To: exim-users
CC: Odhiambo G. Washington
Subject: Re: [Exim] Sanity Check - Mailer-Daemon
On 08 October 2002, Odhiambo G. Washington said:
> I have a disturbing question and a sanity check for my mind will do.
> Maybe even some flaming! for some novice-ish questions.
>
> Ideally, what should happen when an e-mail is sent to Mailer-Daemon?


It should go to the same person/people who receive postmaster mail for
that domain. This should be done in your alias file:

  postmaster: joe, bob, tim    # assuming those are the local sysadmins
  root: postmaster
  mailer-daemon: postmaster
  exim: postmaster


> Here is my story:
>
> exim_user = exim
>
> Q1. Exim runs as $exim_user, so when it accepts an e-mail submission to send
> out, does it send out that mail as $exim_user, Mailer-daemon, or as the
> user who submitted the initial e-mail?


Depends how it accepts the message. Is this via SMTP? SMTP-over-stdin
(exim -bs)? Or a local message? In the latter two cases, I believe
Exim will run as the person who ran "exim -bs" or "exim <recip>" or
whatever. (Oh wait: it needs to write the message into the spool
directory, in which case it will need to be $exim_user. So I suspect it
will be root briefly, and then setuid() to $exim_user.)

For an SMTP session, Exim will run as $exim_user most of the time. In
particular, while it's expanding mailer-daemon -> postmaster -> joe,
bob, tim it should always be running as $exim_user. When it comes time
to write messages to /home/{joe,tim,bob}/Mailbox (or however you do it),
it forks one child per delivery, which will be root to start out with
and quickly setuid() to {joe,tim,bob}.

At least, I *think* that's how it works based on dim recollections of
reading the docs and following this list. I have not consulted the
source code, nor have I strace()'d exim to see if that's what it really
does.

> Q2. What should (ideally) happen to mail that is addressed to $exim_user?
>
> Q3. What should (ideally) happen to mail that is addressed to Mailer-Daemon?


In both cases, the address should expand, via aliases, to the same set
of people who get postmaster mail. You should not receive or send mail
as root, or as $exim_user.

        Greg
--
Greg Ward <gward@???>                         http://www.gerg.ca/
The box said "Requires Windows 95 or better" -- so I installed Linux!