diff --git a/src/dc_receive_imf.rs b/src/dc_receive_imf.rs index 4c2608974..a25d1a4d6 100644 --- a/src/dc_receive_imf.rs +++ b/src/dc_receive_imf.rs @@ -2349,6 +2349,30 @@ mod tests { .await; } + #[async_std::test] + async fn test_parse_ndn_gmx() { + test_parse_ndn( + "alice@gmx.com", + "snaerituhaeirns@gmail.com", + "9c9c2a32-056b-3592-c372-d7e8f0bd4bc2@gmx.de", + include_bytes!("../test-data/message/gmx_ndn.eml"), + "Delivery Status Notification (Failure) – ** Die Adresse wurde nicht gefunden **\n\nIhre Nachricht wurde nicht an assidhfaaspocwaeofi@gmail.com zugestellt, weil die Adresse nicht gefunden wurde oder keine E-Mails empfangen kann.\n\nHier erfahren Sie mehr: https://support.google.com/mail/?p=NoSuchUser\n\nAntwort:\n\n550 5.1.1 The email account that you tried to reach does not exist. Please try double-checking the recipient\'s email address for typos or unnecessary spaces. Learn more at https://support.google.com/mail/?p=NoSuchUser i18sor6261697wrs.38 - gsmtp", + ) + .await; + } + + #[async_std::test] + async fn test_parse_ndn_posteo() { + test_parse_ndn( + "alice@posteo.org", + "hanerthaertidiuea@gmx.de", + "04422840-f884-3e37-5778-8192fe22d8e1@posteo.de", + include_bytes!("../test-data/message/posteo_ndn.eml"), + "Delivery Status Notification (Failure) – ** Die Adresse wurde nicht gefunden **\n\nIhre Nachricht wurde nicht an assidhfaaspocwaeofi@gmail.com zugestellt, weil die Adresse nicht gefunden wurde oder keine E-Mails empfangen kann.\n\nHier erfahren Sie mehr: https://support.google.com/mail/?p=NoSuchUser\n\nAntwort:\n\n550 5.1.1 The email account that you tried to reach does not exist. Please try double-checking the recipient\'s email address for typos or unnecessary spaces. Learn more at https://support.google.com/mail/?p=NoSuchUser i18sor6261697wrs.38 - gsmtp", + ) + .await; + } + async fn test_parse_ndn( self_addr: &str, foreign_addr: &str, @@ -2405,11 +2429,23 @@ mod tests { #[async_std::test] async fn test_parse_ndn_group_msg() { - let t = configured_offline_context().await; + let t = dummy_context().await; + t.ctx + .set_config(Config::Addr, Some("alice@gmail.com")) + .await + .unwrap(); + t.ctx + .set_config(Config::ConfiguredAddr, Some("alice@gmail.com")) + .await + .unwrap(); + t.ctx + .set_config(Config::Configured, Some("1")) + .await + .unwrap(); dc_receive_imf( &t.ctx, - b"From: alice@example.org\n\ + b"From: alice@gmail.com\n\ To: bob@example.org, assidhfaaspocwaeofi@gmail.com\n\ Subject: foo\n\ Message-ID: \n\ diff --git a/test-data/message/gmx_ndn.eml b/test-data/message/gmx_ndn.eml index 1c498d2f7..1c45f57b9 100644 --- a/test-data/message/gmx_ndn.eml +++ b/test-data/message/gmx_ndn.eml @@ -1,12 +1,12 @@ Return-Path: <> Received: from mout-bounce.gmx.net ([212.227.15.44]) by mx-ha.gmx.net (mxgmx101 [212.227.17.5]) with ESMTPS (Nemesis) id 1Mr97m-1jC6Y01o86-00oEqk - for ; Tue, 09 Jun 2020 14:35:30 +0200 + for ; Tue, 09 Jun 2020 14:35:30 +0200 Received: from localhost by mout-bounce.gmx.net id 0LhiZF-1jDTj11ZoH-00msO3 Tue, 09 Jun 2020 14:35:30 +0200 Date: Tue, 09 Jun 2020 14:35:30 +0200 From: "GMX Mailer Daemon" -To: hocuri@gmx.de +To: alice@gmx.de Subject: Mail delivery failed: returning message to sender Auto-Submitted: auto-replied MIME-Version: 1.0 @@ -14,7 +14,7 @@ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-UI-Out-Filterresults: unknown:0;V03:K0:O8yx6kuPaGQ=:0wIDPNXEr0wX2oNsLnXaWA == -Envelope-To: +Envelope-To: X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=V3; X-Spam-Flag: NO X-UI-Filterresults: notjunk:1;V03:K0:QcE43EBhMmU=:IC5vvzi9jhPS/698Wuubzw1Q4N @@ -74,7 +74,7 @@ Received: from [192.168.178.30] ([84.57.126.154]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MKbkM-1jNoq60HKm-00KyL2 for ; Tue, 09 Jun 2020 14:35:30 +0200 To: snaerituhaeirns@gmail.com -From: Hocuri +From: Alice Subject: test Message-ID: <9c9c2a32-056b-3592-c372-d7e8f0bd4bc2@gmx.de> Date: Tue, 9 Jun 2020 14:36:10 +0200 diff --git a/test-data/message/posteo_ndn.eml b/test-data/message/posteo_ndn.eml new file mode 100644 index 000000000..eedc63e14 --- /dev/null +++ b/test-data/message/posteo_ndn.eml @@ -0,0 +1,113 @@ +Return-Path: <> +Delivered-To: alice@posteo.org +Received: from proxy02.posteo.name ([127.0.0.1]) + by dovecot03.posteo.local (Dovecot) with LMTP id zvCFJRzX317LGQIA+3EWog + for ; Tue, 09 Jun 2020 20:44:24 +0200 +Received: from proxy02.posteo.de ([127.0.0.1]) + by proxy02.posteo.name (Dovecot) with LMTP id mhNkNAnR316xBQMAGFAyLg + ; Tue, 09 Jun 2020 20:44:23 +0200 +Received: from mailin06.posteo.de (unknown [10.0.1.6]) + by proxy02.posteo.de (Postfix) with ESMTPS id 49hJtv3RRcz11m7 + for ; Tue, 9 Jun 2020 20:44:23 +0200 (CEST) +Received: from mx04.posteo.de (mailin06.posteo.de [127.0.0.1]) + by mailin06.posteo.de (Postfix) with ESMTPS id 6935920DD2 + for ; Tue, 9 Jun 2020 20:44:23 +0200 (CEST) +X-Virus-Scanned: amavisd-new at posteo.de +X-Spam-Flag: NO +X-Spam-Score: -1 +X-Spam-Level: +X-Spam-Status: No, score=-1 tagged_above=-1000 required=8 + tests=[ALL_TRUSTED=-1] autolearn=disabled +Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) + by mx04.posteo.de (Postfix) with ESMTPS id 49hJtv001Vz10kT + for ; Tue, 9 Jun 2020 20:44:22 +0200 (CEST) +Authentication-Results: mx04.posteo.de; dmarc=none (p=none dis=none) header.from=mout01.posteo.de +Received: by mout01.posteo.de (Postfix) + id DCB6B1200DD; Tue, 9 Jun 2020 20:44:22 +0200 (CEST) +Date: Tue, 9 Jun 2020 20:44:22 +0200 (CEST) +From: MAILER-DAEMON@mout01.posteo.de (Mail Delivery System) +Subject: Undelivered Mail Returned to Sender +To: alice@posteo.org +Auto-Submitted: auto-replied +MIME-Version: 1.0 +Content-Type: multipart/report; report-type=delivery-status; + boundary="B39111200B9.1591728262/mout01.posteo.de" +Content-Transfer-Encoding: 7bit +Message-Id: <20200609184422.DCB6B1200DD@mout01.posteo.de> + +This is a MIME-encapsulated message. + +--B39111200B9.1591728262/mout01.posteo.de +Content-Description: Notification +Content-Type: text/plain; charset=us-ascii + +This is the mail system at host mout01.posteo.de. + +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 + +: host mx01.emig.gmx.net[212.227.17.5] said: 550 + Requested action not taken: mailbox unavailable (in reply to RCPT TO + command) + +--B39111200B9.1591728262/mout01.posteo.de +Content-Description: Delivery report +Content-Type: message/delivery-status + +Reporting-MTA: dns; mout01.posteo.de +X-Postfix-Queue-ID: B39111200B9 +X-Postfix-Sender: rfc822; alice@posteo.org +Arrival-Date: Tue, 9 Jun 2020 20:44:22 +0200 (CEST) + +Final-Recipient: rfc822; hanerthaertidiuea@gmx.de +Original-Recipient: rfc822;hanerthaertidiuea@gmx.de +Action: failed +Status: 5.0.0 +Remote-MTA: dns; mx01.emig.gmx.net +Diagnostic-Code: smtp; 550 Requested action not taken: mailbox unavailable + +--B39111200B9.1591728262/mout01.posteo.de +Content-Description: Undelivered Message Headers +Content-Type: text/rfc822-headers + +Return-Path: +Received: from mout01.posteo.de (unknown [10.0.0.65]) + by mout01.posteo.de (Postfix) with ESMTPS id B39111200B9 + for ; Tue, 9 Jun 2020 20:44:22 +0200 (CEST) +Received: from submission-encrypt01.posteo.de (unknown [10.0.0.75]) + by mout01.posteo.de (Postfix) with ESMTPS id 8A684160060 + for ; Tue, 9 Jun 2020 20:44:22 +0200 (CEST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; + t=1591728262; bh=g3zLYH4xKxcPrHOD18z9YfpQcnk/GaJedfustWU5uGs=; + h=To:From:Subject:Date:From; + b=brJnt4PLAX3Tda1RHCo91aB1kMAL/Ku9dmO7D2DD41Zu5ShNsyqqyDkyxb1DsDn3O + 6KuBZe3/8gemBuCJ/mxzwd9v8sBnlrV+5afIk0Ye9VvthZsc4HoG79+FiVOi9F38o0 + DtJJFYFw/X7mAc5Xyt0B0JvtiTPpBdRAkluUQm+QW6cW6GGlwicVW19qvebzq+sHyP + X2bZ8wpo78yVgvjPBK3DLaXa+pKFMBjLdDUcIE2bZnY6u6F1x8SXGKGBoxVwdJipJx + v14so5IejNsf4LYJjH3Qb8xgK1aAi6e6nQn4YXV0INL6ahzgALiT9N6vwunNKYVJNi + fPPKvBWDfUS4Q== +Received: from customer (localhost [127.0.0.1]) + by submission (posteo.de) with ESMTPSA id 49hJtt1WPbz6tmV + for ; Tue, 9 Jun 2020 20:44:22 +0200 (CEST) +To: hanerthaertidiuea@gmx.de +From: deltachat +Subject: test +Message-ID: <04422840-f884-3e37-5778-8192fe22d8e1@posteo.de> +Date: Tue, 9 Jun 2020 20:45:02 +0200 +User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 + Thunderbird/68.8.1 +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: 7bit +Content-Language: de-DE +Posteo-User: alice@posteo.org +Posteo-Dkim: ok + +--B39111200B9.1591728262/mout01.posteo.de--