Set [Return-path] for Sendmail?

Posted on 2007-10-19
Last Modified: 2008-01-09
Hello all,

My Perl script uses Sendmail to dynamically send out emails to users in our db.  I can set the "To:", "From:", "Reply-to:", "Subject:", and "Content:" fields of the email programmatically and it all works wonderously.

EXCEPT - for when the "To:" address is incorrect and the email gets bounced back.  The problem is that mails bounced back because they are undeliverable get bounced back to the [Return-path], which my ISP's email server keeps setting to itself.  So I never get the bounced back email to warn me that it was not received.

Is there some way, in the context of such a script, either to set [Return-path], or some other way to emulate the behaviour - other than Cc'ing myself ('cause that would look dumb, the sender copying himself)

Question by:xfvgdrthbdtyvhgscv
    LVL 84

    Expert Comment

    There's the non standard Errors-To: header, but officially error reports should go to the From:
    LVL 17

    Accepted Solution

    Can we see your Perl line that calls Sendmail?  If there is no Return-Path provided, a default one will be inserted.  Have you tried including the -f flag on the line calling Sendmail::

    my $Sendmail = '/usr/sbin/sendmail -t -fname\';

    Note that there's no space between the flag and the address.  Also, depending on how you're doing this, you might have to escape the @ sign, as above.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    Title # Comments Views Activity
    How to switch email hosts (part 2) 11 58
    AWS Advice on using WHM/cPanel 1 38
    Webserver access problem 5 44
    Website URL redirection 10 32
    One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
    Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    779 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

    13 Experts available now in Live!

    Get 1:1 Help Now