Re: Postfix configuration (mail to root)



On Fri, Sep 29, 2006 at 15:23:25 +0100, Magnus Therning wrote:
I'm having problems with sending emails to root on my machines at work.
My mail setup is a little strange, I suppose, but not too weird, I think
:-)

I defer all sending of email. Postfix uses a relayhost of
localhost:2300 and my user has a cronjob that sets up an ssh tunnel to a
remote host, my.remote.host, that I use to actually send the email.
(This setup is to avoid the exchange mail server that is used at the
office. I've had A LOT of problems with it and its administrators.)
The current setup works fine for sending to external addresses, but not
for sending to local ones, e.g. to root.

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

hello
EOF
% mailq
2B62F4B9DD 335 Fri Sep 29 15:07:41 magnus@xxxxxxxxxxxxxx
(deferred transport)
root@xxxxxxxxxxxxxx

This is how I've configured it:

% cat /etc/mailname
my.remote.host
% egrep '^root' /etc/aliases
root: magnus
% hostname -f
my.local.host

My /etc/postfix/main.cf contains the following:

myhostname = my.local.host
myorigin = /etc/mailname
mydestination = my.local.host, localhost

How do I configure this so that emails for root are sent to
magnus@xxxxxxxxxxxxx rather than root@xxxxxxxxxxxxxx?
And, why are mails sent by the user magnus recorded as sent from
magnus@xxxxxxxxxxxxxx?

Oops, just realised that the magnus@xxxxxxxxxxxxxx is what's stuck in
the From header (different from the From: header) and that this is what
I desire. Since a lot of servers on the internet does a lookup on the
domain part I need my.remote.host there... so, just disregard the second
question.

/M

--
Magnus Therning (OpenPGP: 0xAB4DFBA4)
magnus@xxxxxxxxxxxx Jabber: magnus.therning@xxxxxxxxx
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

"He dropped his voice still lower. In the stillness, a fly would not
have dared clear its throat."

Attachment: pgpxHDGD8GyqC.pgp
Description: PGP signature



Relevant Pages