Set [Return-path] for Sendmail?

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)

Thanks.
LVL 1
xfvgdrthbdtyvhgscvAsked:
Who is Participating?
 
mjcoyneCommented:
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\@example.com';

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.
0
 
ozoCommented:
There's the non standard Errors-To: header, but officially error reports should go to the From:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.