How to change Return Path variable in Qmail

The Return Path variable on one of the qmail mail servers I manage was improperly set.
New newsletter mails initiated by the php scripts on the mail server had the improper return path set in the mail headers, like so:

Return-Path: <anonymous@mail.mymailserver.com>

Therefore many mail servers dropped messages as the set Return Path variable in the headers was incorrectly set to the domain mail.mymailserver.com

Thus to change the Return Path to the correct one that should have been mymailserver.com I had to include mymailserver.com in qmail’s control file /var/qmail/control/bouncehost, e.g.

root@qmail:~# echo 'mymailserver.com' > /var/qmail/control/bouncehost
root@qmail:~# echo 'mymailserver.com' > /var/qmail/control/doublebouncehost

By the way the return path in qmail is set by:

> qmail-inject and qmail-send

There seems to be also some way to ovewrite the default set return-path variable with some php variables but I have never tried this one.
Cheers 😉
 

Share this on:

More helpful Articles

Download PDFDownload PDF

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

4 Responses to “How to change Return Path variable in Qmail”

  1. admin says:
    Epiphany 2.30.6 Epiphany 2.30.6 Debian GNU/Linux x64 Debian GNU/Linux x64
    Mozilla/5.0 (X11; U; Linux x86_64; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Version/5.0 Safari/531.2+ Debian/squeeze (2.30.6-1) Epiphany/2.30.6

    If php cli is used to send some emails for a newsletter the return path username can be configured via the bash shell variable $USER and $USERNAME.

    For example by changing $USER and $USERNAME (export USER=’user1′, export USERNAME=’user1′)
    the Return-Path of user@mymail.com will change to user1mymail.com

    View CommentView Comment
  2. Q Potts Blog says:
    Firefox 3.0.8 Firefox 3.0.8 Ubuntu 8.10 x64 Ubuntu 8.10 x64
    Mozilla/5.0 (X11; U; Linux x86_64; it; rv:1.9.0.8) Gecko/2009032712 Ubuntu/8.10 (intrepid) Firefox/3.0.8

    Awesome web-site you have here. Astonished you find time to keep it so up to date. I always have trouble with my personal

    View CommentView Comment
  3. simulation bourse says:
    Safari 6.0.5 Safari 6.0.5 Mac OS X  10.8.4 Mac OS X 10.8.4
    Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/536.30.1 (KHTML, like Gecko) Version/6.0.5 Safari/536.30.1

    Wow that was unusual. I just wrote an incredibly long comment but after I clicked submit my comment didn't appear. Grrrr… well I'm not writing all that over again. Regardless, just wanted to say superb blog!

    View CommentView Comment
  4. Floyd Binkowski says:
    Firefox 3.8 Firefox 3.8 Ubuntu 9.25 Ubuntu 9.25
    Mozilla/5.0 (X11; U; Linux i686; it-IT; rv:1.9.0.2) Gecko/2008092313 Ubuntu/9.25 (jaunty) Firefox/3.8

    Every day, be sure to tell somebody thank you.

    View CommentView Comment

Leave a Reply

CommentLuv badge