I'd appreciate any help to this problem that I am experiencing. I wrote a newsletter script that sends out a text e-mail newsletter to over a 1000 e-mail addresses. I am using the Mail::Mailer module and sending the newsletters through sendmail. Everything works fine with one exception. Bounce-backs are sent to nobody@<myserver>.com . These accumulate in root's e-mail account. I would like them to go to the return address on the e-mail instead. The header for these e-mails looks something like this:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Date: Wed, 20 Feb 2002 21:58:58 -0800 From: Mail Delivery Subsystem <MAILER-DAEMON@freshnews.com> To: nobody@freshnews.com Subject: Returned mail: see transcript for details Parts/Attachments: 1 Shown 9 lines Text 2 Shown 301 bytes Message, "Delivery Status" 3 Shown 19 KB Message, "FreshNews.com eNewsletter" 3.1 Shown 422 lines Text ---------------------------------------- The original message was received at Wed, 20 Feb 2002 21:58:58 -0800 from nobody@localhost ----- The following addresses had permanent fatal errors ----- sdfjlk@sdljfdlskfjlsdkj.com (reason: 550 Host unknown) ----- Transcript of session follows ----- 550 5.1.2 sdfjlk@sdljfdlskfjlsdkj.com... Host unknown (Name server: sd +ljfdlskfjlsdkj.com: host not found) [ Part 2: "Delivery Status" ] Reporting-MTA: dns; freshnews.com Arrival-Date: Wed, 20 Feb 2002 21:58:58 -0800 Final-Recipient: RFC822; sdfjlk@sdljfdlskfjlsdkj.com Action: failed Status: 5.1.2 Remote-MTA: DNS; sdljfdlskfjlsdkj.com Diagnostic-Code: SMTP; 550 Host unknown Last-Attempt-Date: Wed, 20 Feb 2002 21:58:58 -0800 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
It seems that it is using the web server (nobody) as the sender and when it returns @<myserver>.com is appended to it. Most frustrating. Here is the code that I am using:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ $form_address = "newsletter\@freshnews.com"; $to_address = "whatever\@whateadsflkj.com"; $subject = "test"; $mailer = Mail::Mailer->new("sendmail"); $mailer->open({ From => $from_address, To => $to_address, Subject => $subject }) or die "Can't open: $!\n"; print $mailer $body; $mailer->close(); +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Thanks for your help! Jon St. John

In reply to Mail::Mailer Question by jonstjohn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.