Postfix - Rewrite Return Address

Discussion in 'Server Operation' started by PJDouglas, Oct 19, 2012.

  1. PJDouglas

    PJDouglas New Member

    Hi,


    Our setup is as follows. We have an exchange server which forwards mail for particular domains to postfix for address rewriting. Postfix re-writes the sender domain address and forwards the mail down a private link. For example exchange sends mail to postfix with a sender address of [email protected] postfix rewrites the sender address as [email protected] and then forwards the mail.

    I have a need to rewrite the return path\address of all mail received from a pspecific address while still re-writing the sender domain as explained above before being forwarded by postfix.

    There are no local mailboxes on postfix. Postfix simple recieves mail re-writes the sender domain and forwards.

    Having read other posts I believe this can be done by using a different submission interface in postfix - but I have no idea how to do this.

    This is what I have seen on another site:

    The right solution is to use a different submission interface, that
    lets you set the envelope sender. For example:

    (
    echo "EHLO $(uname -n)"
    echo "MAIL FROM:<com>"
    echo "RCPT TO:<org>"
    echo "DATA"
    echo "From: <com>"
    echo "To: <org>"
    echo "Reply-To: <com>"
    echo "Subject: the information you requested"
    echo ""
    perl -pe 's/^\./../' /some/path/to/msg-body
    echo "."
    echo "QUIT"
    ) | /usr/sbin/sendmail -bs

    Where in postfix would I create a new submission interface and is the above information the correct way to change the return path?

    Any and all help appreciated.


    Many Thanks
     

Share This Page