Bounce Email

From: Nils M. Lunde (nilsml_at_options.no.nospam)
Date: 07/12/04

  • Next message: Nils M. Lunde: "Re: Bounce Email"
    Date: Mon, 12 Jul 2004 10:32:01 +0200
    
    

    Hi!

    I'm trying to do the following:

    -Extract an Email from a mailbox using grepmail
    -Bounce this Email to a different address

    I thought that this would be an easy thing to do, but I still haven't manage
    to do it the way I want to.

    The problem is MIME encoded messages.
    I've tried several approches, but I always get the same result: the Email
    Content-type is always text/plain after I've sent it.
    It seems like some of the header is stripped off.

    Here is my code:

    ##########################################
    ...
    use MIME::Parser;
    use MIME::Entity;
    use MIME::Head;

    my $sCmd = "grepmail -iu -Y \'(\^From:)\' $sMyAddress $sPathToMailbox;
    my @EmailLines = `$sCmd`;

    my $oParser = new MIME::Parser;
    my $oEmail = $oParser->parse_data(\@EmailLines);
    $oEmail->head->replace("To", $sBounceAddress);

    my $sRes = $oEmail->smtpsend;
    ...
    ##########################################

    Does anyone have a suggestion on how I can forward the mail without
    stripping the header?

    Thanx in advance!

    -Nils Magne Lunde


  • Next message: Nils M. Lunde: "Re: Bounce Email"

    Relevant Pages

    • Re: Bounce Email
      ... > -Extract an Email from a mailbox using grepmail ... > It seems like some of the header is stripped off. ... > stripping the header? ... > -Nils Magne Lunde ...
      (comp.lang.perl)
    • Re: exchange2003 problem!
      ... administrators mailbox. ... "Email routing by SMTP does not depend on headers, but on the recipient name used in the SMTP transaction. ... It can only survive if one of the SMTP servers which handles the email explicitly adds a header called 'Envelope-To:' or something similar. ... If for some reason there is no To: or CC: header, such as with BCC or a mailing list, the SBS2003 POP3 downloader does not know where to deliver the mail. ...
      (microsoft.public.windows.server.sbs)
    • Re: Some POP3 mail undeliverable
      ... I am having a problem where POP3 mail is not always delivered to the client's mailbox but turns up in the mailbox designated for undeliverable pop3 mail. ... It seems very unlikely that header information is being lost, as this is almost the ultimate sin in handling email. ... Email routing by SMTP does not depend on headers, but on the recipient name used in the SMTP transaction. ...
      (microsoft.public.windows.server.sbs)
    • Re: Header in Exchange
      ... >I created special mailbox called "SPAM" for users to forward spam messages ... >I wanted to analyze them (header, keywords and IP) to tune up our antispam ... but whenever someone forwarding something from one internal mailbox ...
      (microsoft.public.exchange.admin)
    • Re: sendmail corrupts long header From
      ... This insertion of a comma is plain wrong. ... (lookup of additional specifications is left to the reader) ... A comma in a "from:" header is the separator between two mailbox ...
      (comp.mail.sendmail)