I'm running a postfix mail relay, and postfix appears to be dynamically rewriting the return path.

Postfix server -> Postfix relay -> recipient

The return path is being set to the original postfix server which from what I understand is by design.

I would like the return path set to the actual sender email address. So if from "Postfix server" I send a message from user@example.com I want that to be the return path, not the address of the original postfix server.

In my research I found that this can be done with a map that rewrites the header, but I don't see a way to get the sender email using a map so that this could be done dynamically.

Basically I would like to set something like:

/^Return-Path: (.*)$/Return-Path: ${sender}

Is there a way to dynamically get the sender email so that I can rewrite based on it? If this isn't an option is there an alternative that would work?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.