Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

You don't want to modify the body of the message at all. Use the existing content, completely unmodified (unparsed, etc, other than seperated into messages) as the message body, and use the new envelope-from and envelope-to in the SMTP transaction.

There is no reason to attempt to parse the message, unless there's some sort of information that you need to use to determine where to route the mesage to, if you really want it to be as close to the original as possible.

Now we come to the question -- do you really want it close to the original? If the mail program that's reading the messages sorts on the message's date, and not the received time of the message, this could cause some odd effects, as they might not realize that you've just inserted a couple hundred messages that were dated 3 years ago into their mailbox. Most modern mail readers don't have this problem, as they default to using the received time for their date sorting, but it's possible that this might be an issue.

Update: If people are going to suggest non-perl solutions, I might as well, too ... using pine, enable aggregate commands, and bounce command, then ;aab (or well, whatever selection criteria for the folder)


In reply to Re: forwarding emails with perl?? by jhourcle
in thread forwarding emails with perl?? by chrisj0

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-03-29 10:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found