2013-07-25

Postfix: how to set envelope sender address, Return-Path

This is the kind of thing that only appears difficult at first, but in reality is quite easy.

We run a piece of software that sends out emails. The envelope sender address is wwwrun@ourdomain. This is because the Apache2 process runs as the wwwrun user. I need to change the envelope sender address (and hence the Return-Path: as well) to different_address@ourdomain

The fix turned out to be very easy:
# man canonical
# vim /etc/postfix/canonical
[add line 'wwwrun   rt_internal' at bottom of file]
# postmap /etc/postfix/canonical

No comments:

Post a Comment