MailCore / mailcore2

MailCore 2 provide a simple and asynchronous API to work with e-mail protocols IMAP, POP and SMTP. The API has been redesigned from ground up.
Other
2.6k stars 623 forks source link

Don't get any headers in extra headers #1880

Closed ninad458 closed 4 years ago

ninad458 commented 4 years ago
Delivered-To: xyz.abc@gmail.com
Received: by 2002:a25:74c2:0:0:0:0:0 with SMTP id p185csp5140230ybc;
        Tue, 26 May 2020 01:30:32 -0700 (PDT)
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@medium.com header.s=m1 header.b=gbWzMAsI;
       dkim=pass header.i=@sendgrid.info header.s=smtpapi header.b="tk0gK1G/";
       spf=pass (google.com: domain of bounces+1823144-8fea-xyz.abc=gmail.com@email.medium.comgmail.com@email.medium.com designates 149.72.133.6 as permitted sender) smtp.mailfrom="bounces+1823144-8fea-xyz.abc=gmail.com@email.medium.comgmail.com@email.medium.com";
       dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=medium.com
Return-Path: <bounces+1823144-8fea-xyz.abc=gmail.com@email.medium.comgmail.com@email.medium.com>
Received: from o11.email.medium.com (o11.email.medium.com. [149.72.133.6])
        by mx.google.com with ESMTPS id a12si6765830ejb.515.2020.05.26.01.30.30
        for <xyx.abc@gmail.com>
        (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 26 May 2020 01:30:32 -0700 (PDT)
Received-SPF: pass (google.com: domain of bounces+1823144-8fea-xyz.abc=gmail.com@email.medium.comgmail.com@email.medium.com designates 149.72.133.6 as permitted sender) client-ip=149.72.133.6;
Authentication-Results: mx.google.com;
       dkim=pass header.i=@medium.com header.s=m1 header.b=gbWzMAsI;
       dkim=pass header.i=@sendgrid.info header.s=smtpapi header.b="tk0gK1G/";
       spf=pass (google.com: domain of bounces+1823144-8fea-xyz.abc=gmail.com@email.medium.comgmail.com@email.medium.com designates 149.72.133.6 as permitted sender) smtp.mailfrom="bounces+1823144-8fea-xyz.abc=gmail.com@email.medium.comgmail.com@email.medium.com";
       dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=medium.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=medium.com; h=content-type:from:mime-version:reply-to:to:subject:list-unsubscribe; s=m1; bh=k9vVvq3KfhlOOHo+E30j3E4FKciZsPwzDMx3h1uhdxQ=; b=gbWzMAs IXz5V4BpUHJBsT+erXjDwhWOZ5d422B3dJ/hXza15Zr7OOfsE6sTXMOujImB7cgU +v/8tzxJ2AMSX2D6UvsKf3aKgQmDdxwbFc2zUtOhlNJ4doy6r+3NdVnsBqO8sGMV 8YEADj1pgs0GdH0Oi4cVbxvdeIrwL85pnmow=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sendgrid.info; h=content-type:from:mime-version:reply-to:to:subject:list-unsubscribe:x-feedback-id; s=smtpapi; bh=k9vVvq3KfhlOOHo+E30j3E4FKciZsPwzDMx3h1uhdxQ=; b=tk 0gK1G/87wY6JFz+5ZxfVuyKQs4kDZ9TGnhNsh6am62hGwN+atYo45qFwtM9emfEp QJfh1W2fm4CDVKM+ZNHKulBJFhBnhNi0vdvXVRp44FwHra0BnzZPC2uFMEKk4wcu X2spINpKhlcVXe0As3NngaFr/LV/sFK1bkNPiKFDA=
Received: by filter0735p1iad2.sendgrid.net with SMTP id filter0735p1iad2-24650-5ECC9AA6-3
        2020-05-26 04:27:18.379921207 +0000 UTC m=+143325.310524965
Received: from MTgyMzE0NA (unknown) by geopod-ismtpd-3-1 (SG) with HTTP id 58l99GhoQHKYUayeL-sZUQ Tue, 26 May 2020 04:27:18.414 +0000 (UTC)
Content-Type: multipart/alternative; boundary=2ec0ed5525fe3ffdacac89fcde4b93dbd36b1e07b08849e36ad1e358c67b
Date: Tue, 26 May 2020 08:30:00 +0000 (UTC)
From: Medium Daily Digest <noreply@medium.com>
Reply-to: noreply@medium.com
To: xyz.abc@gmail.com
Message-ID: <58l99GhoQHKYUayeL-sZUQ@geopod-ismtpd-3-1>
Subject: Should You Jump Python’s Ship And Move To Julia? | Emmett Boudreau in Towards Data Science
List-unsubscribe: <https://medium.com/me/email-settings/3f8d7ea873c1/79362e9dc40c?source=email-3f8d7ea873c1-1590467237420-digest.reader-------------------------9770467c_f10b_42fe_aadc_38129205be2d&type=social>
<https://teams.microsoft.com/l/message/19:d2e53e438d684dcdb9f662e624d22b0f@thread.tacv2/1592346953596?tenantId=f4184e56-f060-4bd9-b66e-169cc6f3b3c1&amp;groupId=99ecb84b-d057-46b0-b896-6aeff6ab0d79&amp;parentMessageId=1592346953596&amp;teamName=EmailPrivacyAppPrototype&amp;channelName=app-build&amp;createdTime=1592346953596>

There is a requirement to get all these headers. Currently passing the following:

int FLAGS = 1;
int HEADERS = 2;
int STRUCTURE = 4;
int INTERNAL_DATE = 8;
int HEADER_SUBJECT = 32;
int EXTRA_HEADERS = 512;

int requestKind = HEADERS | STRUCTURE | INTERNAL_DATE | HEADER_SUBJECT | FLAGS | EXTRA_HEADERS

final IMAPFetchMessagesOperation messagesOperation = imapSession.fetchMessagesByUIDOperation(folder, requestKind,
                indexSet);
haithngn commented 4 years ago

@ninad458 , Unfortunately, MailCore Message Header is now storing the extra header in a HashMap, so you have only one value for each extra header key (eg. Received).

We will try to implement this in the future, hope you can join us and make it happen.