Giter Club home page Giter Club logo

Comments (4)

fedelemantuano avatar fedelemantuano commented on May 29, 2024

Is this an Outlook message? If yes, you should use:

import mailparser
mail = mailparser.parse_from_file_msg('samples/eml_file')
print(mail.to_json)

Can you share your test mail?

from mail-parser.

marine44 avatar marine44 commented on May 29, 2024
Return-Path: <[email protected]>
Received: from mail-wr0-f172.google.com (mail-wr0-f172.google.com [209.85.128.172])
 by inbound-smtp.eu-west-1.amazonaws.com with SMTP id 02e829lfqskt2sesvioeeabf86gfgqo8bgsah5g1
 for [email protected];
 Wed, 20 Jun 2018 10:05:46 +0000 (UTC)
Received-SPF: none (spfCheck: 209.85.128.172 is neither permitted nor denied by domain of bbbbbb.com) client-ip=209.85.128.172; [email protected]; helo=mail-wr0-f172.google.com;
Authentication-Results: amazonses.com;
 spf=none (spfCheck: 209.85.128.172 is neither permitted nor denied by domain of bbbbbb.com) client-ip=209.85.128.172; [email protected]; helo=mail-wr0-f172.google.com;
 dkim=pass [email protected];
X-SES-RECEIPT: AEFBQUFBQUFBQUFGV1hGdkh6NmFZODJ4aVVUcFRKZStsNGdSWjhMQ0lUNlJhL3lML2diK0NZZms1NlJsOFlXUGJMK1hhNnFqYWR6UE5iVVhPSkU4bkk4SmVnWTU0SDNrY25YRnVuRW92NkZZeEx6VE9UWkpwQWkwL3hSejhYcFJOd2NyVTFrWTNpd1cydmN4anJQQXc0TXAvWjcyaGExVXV0dE5jTFhYVzFyVVlvS3NOblpOekdHVkpXYWxuTG9OeGdvUE1BNVQ1ZWt6OXBCVVR2UG9wV1dPRTI0NkdwdU9seHZSbmM4bDkrZm5IQXZHM0FVNmtjMHFOcm5LYzdHRW84cmRFQjdMM2RlSWw0REREMXpSQXZhZnJ4M1pnRTQ1a0RXam54SWJNdGNLT2NFc0NGU3FOclE9PQ==
X-SES-DKIM-SIGNATURE: a=rsa-sha256; q=dns/txt; b=TKehW9kn7CXYa43M1LIdlsC1yVJzFfHGs8HA2lp80HQEXaw4+P+xcOqcFkCzWJrWaGuKZiOajgU5WY2fPGHNmS/X//LKHFS3JO19PHTReQjDzdv07zLV58xLI+Xj9bP23bkIxpUE1kJ+Qfayp0kBGHHBRcMldaX+mkiteNd+k0Q=; c=relaxed/simple; s=uku4taia5b5tsbglxyj6zym32efj7xqv; d=amazonses.com; t=1529489148; v=1; bh=JoKNYvUlb3NM1F+KEpK+cjfISx+ang3D7x892kKNtoM=; h=From:To:Cc:Bcc:Subject:Date:Message-ID:MIME-Version:Content-Type:X-SES-RECEIPT;
Received: by mail-wr0-f172.google.com with SMTP id h10-v6so2633183wrq.8
        for <[email protected]>; Wed, 20 Jun 2018 03:05:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=hhhhhh-com-au.20150623.gappssmtp.com; s=20150623;
        h=mime-version:from:date:message-id:subject:to;
        bh=JoKNYvUlb3NM1F+KEpK+cjfISx+ang3D7x892kKNtoM=;
        b=AGhUMuqlAI5Jn/6mpDF988E570Xsw/3jdIScm3RaGRo3N+e9aUHKngLqBtBByQGJlt
         4dEOZg/jz0uST+Xdl3MKvmr1F9wIRtertihncoXjw9R5vA7Q/iOHhw+wW7hozrD1rL1r
         fID75MfB1WU1kZV9iw51Gc9DYdB52AvZfyWYQ6r+cvZjNCxjnH2kO7lOwyyXBDFimgjx
         4YD95FRkMAis+6K1vg3wCd9jHVqrY9ShRQz3QIqPraffUx1mGCx4I523cfSpbtPfY3H+
         2PFLmG0qIDJVKlSknSbvefNWBZ8/E9/5+JTfGNt9VhRwXgt+dr6y8A/soEH7QEh0MJLi
         xw3w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
        bh=JoKNYvUlb3NM1F+KEpK+cjfISx+ang3D7x892kKNtoM=;
        b=V9+iYHPJyL4qz3L9DrH1Y5dayREAk4DoG1Q/ldZMAnvB0isWEU6jjxI3udJJCb/I3Y
         L78vgOT6UKW3rPbebcIAvTPPtKac8qO00eNgJnZRNb8IEIf6cp30EDDYnbQYpjcHu1mP
         yPpfh5zN7zOmoj2qG9vyaODCvhAIjkK/HHieAhPVV4yN6Bimg2hoJK7DihR8SQAD2bHn
         irYOlhbarFdnyO6QHBnIPbKC8mAxL8PNYVKYxeit9MhjUxPDBnNNOukmC9EtUDgF01h1
         nOZSJuyYi/rJoJ5mufii2SkZbIOOjYKzKFnFzIAK7n3hAF0R3wO1cWhxJ3OZtwi4LBuU
         fHFQ==
X-Gm-Message-State: APt69E1PqoILK41ECD5inr9hv2FRmYmPVubLLFYmLs5XbzSEHnKraRWO
tGFXRwqP7Wvm8MrAao2REWsS3UI5GOYLtjg8pyOFfA==
X-Google-Smtp-Source: ADUXVKKzytY+z912JXem99gngjFxixQ93ZRZCjwoCFHPvZiLEiR6VHfTexbsWUqN6BxMo3e5Q7BRy5rV8TtYLpurDMg=
X-Received: by 2002:adf:a949:: with SMTP id u67-v6mr16518978wrc.71.1529489145406;
 Wed, 20 Jun 2018 03:05:45 -0700 (PDT)
MIME-Version: 1.0
Received: by 2002:a1c:d414:0:0:0:0:0 with HTTP; Wed, 20 Jun 2018 03:05:44
 -0700 (PDT)
From: aaaaaa llllll<[email protected]>
Date: Wed, 20 Jun 2018 20:05:44 +1000
Message-ID: <CA+Cz=thSc9g2SVLmCCkbaOkePR7egq7v_SC6o22URje1tEDNKg@mail.gmail.com>
Subject: test
To: [email protected]
Content-Type: multipart/alternative; boundary="000000000000333b83056f0ff14b"

--000000000000333b83056f0ff14b
Content-Type: text/plain; charset="UTF-8"

body text

--000000000000333b83056f0ff14b
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<h1>body text</h1>

--000000000000333b83056f0ff14b--

from mail-parser.

marine44 avatar marine44 commented on May 29, 2024

I think it's a regular eml file, its been received from Amazon ses

from mail-parser.

fedelemantuano avatar fedelemantuano commented on May 29, 2024

I checked your email. There is an error in mail text. I tested with error and I found these headers:

['Return-Path',
 'Received',
 'Received-SPF',
 'Authentication-Results',
 'X-SES-RECEIPT',
 'X-SES-DKIM-SIGNATURE',
 'Received',
 'DKIM-Signature',
 'X-Google-DKIM-Signature',
 'X-Gm-Message-State']

So what's happen after X-Gm-Message-State?

X-Gm-Message-State: APt69E1PqoILK41ECD5inr9hv2FRmYmPVubLLFYmLs5XbzSEHnKraRWO
tGFXRwqP7Wvm8MrAao2REWsS3UI5GOYLtjg8pyOFfA==

This header is malformed, so I replaced it with this:

X-Gm-Message-State: APt69E1PqoILK41ECD5inr9hv2FRmYmPVubLLFYmLs5XbzSEHnKraRWOtGFXRwqP7Wvm8MrAao2REWsS3UI5GOYLtjg8pyOFfA==

After that the headers are:

['Return-Path',
 'Received',
 'Received-SPF',
 'Authentication-Results',
 'X-SES-RECEIPT',
 'X-SES-DKIM-SIGNATURE',
 'Received',
 'DKIM-Signature',
 'X-Google-DKIM-Signature',
 'X-Gm-Message-State',
 'X-Google-Smtp-Source',
 'X-Received',
 'MIME-Version',
 'Received',
 'From',
 'Date',
 'Message-ID',
 'Subject',
 'To',
 'Content-Type']

I think there is some error when import this email. Can you confirm it?

from mail-parser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.