Matt Ausmus:
> > I'm using postfix 2.3.3 on some Centos 5.x boxes strictly to send mail
> > for alerting purposes.  I've got relaying setup to go to our main smtp
> > server which is running FreeBSD 6.x and postfix.  What I'm trying to do
> > is for the outgoing messages to show the hostn...@chapman.edu so I can
> > look at the incoming message and know what box the alert is coming from.
> > The scripts I'm using are utilizing mailx to send the messages.
> >
> > I setup sender_canonical and the address rewriting is working properly.
> > The problem that I'm having is that the mail is displayed in my mail
> > client as just root.  When I open the message it shows:
> >
> > Root [hostn...@chapman.edu] or "root" <hostn...@chapman.edu>
> >
> > Depending on the client.  I checked the header of the message and it
> > shows (this is an excerpt:  From: kennedydhcp...@chapman.edu (root)).
> > What I want to do is get rid of "Root[...]" and just have the rewritten
> > email address displayed in the mailbox list.
> >
> > How can I accomplish this?

The From: header of the email message has the following information:

    From: kennedydhcp...@chapman.edu (root)

Mail clients change this information into:

    Root [kennedydhcp...@chapman.edu] or "root" <kennedydhcp...@chapman.edu>

I think this is a silly request.

To remove text, you can use a REPLACE action in a header_checks
file that deletes the (root) portion, keeping in mind that ".",
"(" and ")" are special characters in regular expression context.

Here is an example that uses PCRE:

/etc/postfix/main.cf:
    header_checks = pcre:/etc/postfix/header_checks.pcre

/etc/postfix/header_checks.pcre:
    /^(From:\s+...@chapman\.edu)\s+\(root\)$/ REPLACE $1

        Wietse

Reply via email to