#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2010
    Posts
    1
    Rep Power
    0

    Postfix config help


    Hi there,

    Customer requested to change the email id to look like as below when she receive emails from this server. This setting is required to identify the sender host as she is receiving emails from 4 different servers but from same user account s_infos(AD).

    From: s_infos@am086
    [mailto:s_infos-am086@linux.example.com]

    From:user@"hostname"[mailto:user-"hostname"@"domainame"]

    However Current o/p is as below where we donít see user@"hostname" in From filed which needs to be changed.
    From: s_infop [mailto:s_infop-am086@linux.example.com]

    So our main focus area is From field, that we need to change as
    From: user@"hostname"

    I'm using postfix on redhat linux 2.6.9-67.0.4.ELsmp server,

    Appreciate your kind help on this issue, thanks



    # postconf -n
    alias_database = hash:/etc/aliases
    alias_maps = hash:/etc/aliases
    command_directory = /usr/sbin
    config_directory = /etc/postfix
    daemon_directory = /usr/libexec/postfix
    debug_peer_level = 2
    html_directory = no
    inet_interfaces = localhost
    mail_owner = postfix
    mailq_path = /usr/bin/mailq.postfix
    manpage_directory = /usr/share/man
    masquerade_domains = linux.example.com
    mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
    myhostname = am086.europe.example.com
    myorigin = $myhostname
    newaliases_path = /usr/bin/newaliases.postfix
    queue_directory = /var/spool/postfix
    readme_directory = /usr/share/doc/postfix-2.2.10/README_FILES
    sample_directory = /usr/share/doc/postfix-2.2.10/samples
    sendmail_path = /usr/sbin/sendmail.postfix
    setgid_group = postdrop
    unknown_local_recipient_reject_code = 550
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Location
    Minneapolis, MN
    Posts
    356
    Rep Power
    13
    First, you can't really modify the body of the email to any real extent in Postfix beyond adding a header. However, you could write a content filter to modify this and then just hit said content filter with an entry in an recipient access file. See the following links for more info on that:

    http://www.postfix.org/FILTER_README.html
    http://www.postfix.org/access.5.html

    Another option is to write a milter and do the change within the smtp transaction. You could either use Mimedefang (not recommended on high volume servers), py-milter or plain old C and libmilter to do this. This is a much more involved and complex undertaking than what you really need and the content filter is probably much better suited to what you actually want.
    badger badger badger badger
    badger badger badger badger
    MUSHROOM MUSHROOM

IMN logo majestic logo threadwatch logo seochat tools logo