Re: Postfix configuration (mail to root)



Magnus Therning <magnus@xxxxxxxxxxxx> wrote:

On Sat, Sep 30, 2006 at 20:25:51 +0100, Magnus Therning wrote:
On Sat, Sep 30, 2006 at 20:36:34 +0300, Andrei Popescu wrote:
[..]
You can do this with rewriting. I just set this up today so its fresh
:)

/etc/postfix/main.cf:

smtp_generic_maps = hash:/etc/postfix/generic

then create /etc/postfix/generic with something like this:

user@xxxxxxxxxxxxx account@xxxxxxxxxxxxxx

and run 'postmap /etc/postfix/generic

Now if the mail is for root@xxxxxxxxxxxxx it will be delivered
according to your aliases file. Mail for user@xxxxxxxxxxxxxxxxxx will
be sent to respective address with rewriten From:

I can't seem to make it do what I want it to, which would be the exact
opposite of what you're doing. My problem was that

% /usr/lib/sendmail root << EOF
Subject: test

Test
EOF

Would result in a mail being sent to root@xxxxxxxxxxxxxxx What I wanted
was a locally delivered email (according to the /etc/aliases file).

Just to clarify why this is a bit of a problem to me. cron keeps on
sending email to root (not root@localhost or root@xxxxxxxxxxxxx). I'd
rather have the output from my crontabs delivered locally.

Ok, but it works for me. If I send mail to root (without @localhost),
then my user receives it (according /etc/aliases). If I send mail to a
real internet address then postfix takes care of the proper rewriting so
that my smarthost doesn't deny it.

Regards,
Andrei
--
If you can't explain it simply, you don't understand it well enough.
(Albert Einstein)


--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx



Relevant Pages

  • Re: Postfix configuration (mail to root)
    ... according to your aliases file. ... was a locally delivered email. ... That resulted in local delivery for mail sent to root@localhost and ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • FreeBSD 5.2 & sendmail - root alias aliases not working
    ... Im trying to hand off all the cron mail (to root) on my freebsd 5.2 server ... The problem is that sendmail does not seem to be looking at my aliases file at all. ... ali# grep send /etc/rc.conf ... SMTP>> STARTTLS ...
    (freebsd-questions)
  • Re: /etc/aliases
    ... This should be commented out in the aliases file - it was only ever intended ... to log in as root just to read email. ... just replace marc with the name of an unprivileged user that you want to use ... Stuart Sears RHCE, RHCX ...
    (RedHat)
  • Re: Periodic Emails are not coming
    ... My aliases file was setup properly, but I have discovered that it ... wasn't compiled (I hadn't run "makealiases" for courier-mta). ... tried to send mail to root, ...
    (freebsd-questions)
  • Re: postfix and aliases
    ... Robert Peirce wrote: ... mail to root is going into a black hole. ... The aliases file claims mail ... It seems that having the aliases file ...
    (comp.sys.mac.portables)