Postfix: Handling bounced e-mail sent by Apache web server

Posted on 2004-11-22
Last Modified: 2013-12-15
I'm running Debian Woody with Apache.  Some php scripts I use send out e-mails and bounced e-mails end up in a 'www-data' mailbox in the /var/mail directory with my other POP3 accounts.

But I don't want them to end up there.  I want them to go to the e-mail box identified in the "Reply-to:" line of the e-mail.  How can I do this?
Question by:nysus1
    LVL 38

    Accepted Solution


       Procmail can forward the email to reply-to:


    Author Comment


    Thanks for your answer but I found another way using the -f sendmail option as part of php's mail() function like so:

    mail("", "the subject", $message,
         "From: webmaster@{$_SERVER['SERVER_NAME']}", "-fwebmaster@{$_SERVER['SERVER_NAME']}");

    That took care of things nicely.

    LVL 38

    Expert Comment

    Hi nysus,

    Thanks for your information.



    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
    It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
    Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now