[Techtalk] getting /var/mail/{whatever} forwarded externally

Mary Gardiner mary-linuxchix at puzzling.org
Mon Jun 26 00:18:44 UTC 2006


On Mon, Jun 26, 2006, Lucia Sanchez wrote:
> The redirect through /etc/aliases works with postfix, but you'd have to
> see if that is the appropriate file for other MTAs (for example, qmail
> used something completely different).

Yes, it does depend on MTA, but it works for Exim, Postfix and Sendmail.
I was making an assumption, based on this being a Red Hat Enterprise
box, which is probably pretty pre-fab if you want Red Hat to actually
support it, that it was almost certainly Sendmail and if not, Postfix.

> If you want to keep a local copy for the user user

"man aliases" *may* have info (I don't have a sendmail install anywhere
to check).

Here's what it says for postfix (with some snipping of detail and error
handling):

  An alias definition has the form
      name: value1, value2, ...
  
  The value contains one or more of the following:
  
  address
      Mail is forwarded to address, which is compatible with the RFC 822
      standard.
  
  /file/name
      Mail is appended to /file/name. See local(8) for details of
      delivery to file.  Delivery is not limited to regular files.  For
      example, to dispose of unwanted mail, deflect it to /dev/null.
  
  |command
      Mail is piped into command. Commands that contain special
      characters, such as whitespace, should be enclosed between double
      quotes. See local(8) for details of delivery to command.
  
  :include:/file/name
      Mail is sent to the destinations listed in the named file.  Lines in
      :include: files have the same syntax as the right-hand side of alias
      entries.

I suspect therefore, you use:
    root: /var/mail/root someone at example.com

> > It's also the case that you can configure individual programs to send
> > email to different people.  This can be handy for those that you don't
> > want to see.  Typically, it's the MAILTO setting in a program's config.
> 
> And you can do it in a similar way through /etc/aliases by making
> aliases for the postmaster, webmaster, etc - the typical
> administration-related mailing addresses.

It's more usual, although by no means compulsory, to forward *those* to
root and then root to another address. The exception would be the case
where they all go to different addresses.

-Mary

PS example.com, example.net and example.org are the best domains to use
in examples. They're held aside by RFC 2606 explicitly for use in
examples. something.com, mickeymouse.com, nobody.com and others commonly
used in examples are actually owned and used as real domains.


More information about the Techtalk mailing list