Re: bounce handler does not recognize Content-Type: text/rfc822-headers

 
From: "Justin J" <justin@PROTECTED>
Date: May 7th 2012

On May 7, 2012, at 10:35 AM, Frans Gouverne wrote:

To fool the MIME parser, I added the following line in sub parse_bounce:

change text/rfc822-headers into message/rfc822

  $message =~ s|Content-Type: text/rfc822-headers|Content-Type: message/rfc822|g; 

eval { $entity = $parser->parse_data($message) };
[etc]

seems to be working

This is what I tried:

https://gist
github
com/2631381

So, instead of hacking the message, I just made it look for that weird Content-Type and parse what's in the, "body" as if itself is an entity, even though it only holds the headers Really strange You'll see a few lines, like this:

    if ( $entity->head->mime_type eq 'message/rfc822') {
        $orig_msg_copy = $parts[0];
        $list = $self->list_in_list_headers($orig_msg_copy);         
    }
    elsif($entity->head->mime_type eq 'text/rfc822-headers'){ 

        require MIME::Parser;
        my $parser = new MIME::Parser;
        $parser = optimize_mime_parser($parser);

        eval {
            $orig_msg_copy = $parser->parse_data( $entity->bodyhandle->as_string );
        };
        if ($@) {
            warn "Trouble parsing text/rfc822-headers message
 $@";
        }
        else {
        }
        $list = $self->list_in_list_headers($orig_msg_copy);
    }

With that, if I then parse that message (I changed the list's shortname):

justin-4:plugins justin$ /dada_bounce_handler pl --test test eml --list j --verbose

Test #1: test eml


List: j Email: emailname@emaildomain nl

Status: 5 2 2 Final-Recipient: rfc822; emailname@emaildomain nl Original-Recipient: rfc822;emailname@emaildomain nl X-Postfix-Sender: rfc822; 00000136e9c52c44-a7f91c97-0c21-436b-b714-4227adce6415-000000@amazonses com Action: failed Simplified-Message-Id: 00000136e9c52c44-a7f91c97-0c21-436b-b714-4227adce6415-000000@email Reporting-MTA: dns; mailscan12 emaildomain nl Bounce_To: bounces@mydomain nu Bounce_From: MAILER-DAEMON@amazonses com reason: input/output error std_reason: unknown host: emaildomain nl Arrival-Date: Wed, 25 Apr 2012 15 Message-Id: 00000136e9c52c44-a7f91c97-0c21-436b-b714-4227adce6415-000000@PROTECTED X-Postfix-Queue-ID: 18381174112 Diagnostic-Code: x-unix; input/output error Bounce_Subject: Undelivered Mail Returned to Sender

  • Using Rule: unknown_bounce_type Bounced Message is from an email address that isn't subscribed to: j Ignorning skazat-4:plugins justin$

You at least have something to work on (and make a new rule, for) - although, Dada Mail isn't looking at that first part of of the bounce:

    This is the mail system at host mailscan12
emaildomain
nl


    I'm sorry to have to inform you that your message could not
    be delivered to one or more recipients
 It's attached below


    For further assistance, please send mail to postmaster


    If you do so, please include this problem report
 You can
    delete your own text from the attached returned message


                       The mail system

    <emailname@emaildomain
nl>: maildir delivery failed: error writing message: Disk
        quota exceeded

Which sort of stinks

  • This mailing list is a public mailing list - anyone may join or leave, at any time.
  • This mailing list is a group discussion list (unmoderated)
  • Start a new thread, email: dadadev@dadamailproject.com

This is the developer discussion mailing list for Dada Mail.

If you are just looking for support Dada Mail, consult the message boards at:

https://forum.dadamailproject.com

Documentation for Dada Mail:

https://dadamailproject.com/d

Specifically, see the Error FAQ:

https://dadamailproject.com/d/FAQ-errors.pod.html

To post to this list, send a message to:

mailto:dadadev@dadamailproject.com

All subscribers of this list may post to the list itself.

Topics that are welcome:

  • Constructive critiques on the program (I like, "x", but, "y" needs some work - here's an idea on how to make this better...)
  • Bug/Error reports
  • Bug fixes
  • Request For Comments on any changes to the program
  • Help customizing Dada Mail for your own needs
  • Patches
  • Language Translations
  • Support Documentation/Doc editing, FAQ's, etc.
  • Discussion of any changes that you would like to be committed to the next version of Dada Mail -

Dada Mail is on Github:

https://github.com/justingit/dada-mail/

If you would like to fork, branch, send over PRs, open up issues, etc.

Privacy Policy:

This Privacy Policy is for this mailing list, and this mailing list only.

Email addresses collection through this mailing list are used explicitly to work within this email discussion list.

We only collect email addresses through our Closed-Loop Opt-In system.

We don't use your email address for any other purpose.

We won't be sharing your email address with any other entity.

Unsubscription can be done at any time. Please contact us at: justin@dadamailproject.com for any help regarding your subscription, including removal from the mailing list.

All mailing list messages sent from us will include a subscription removal link, which will allow you to remove yourself from this mailing list automatically, and permanently.

All consent to use your email address for any other purpose stated at the time of the mailing list subscription will also be revoked upon mailing list removal.