Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An invalid character was found in the mail header: ';' #332

Closed
yrki opened this issue Jun 29, 2020 · 10 comments
Closed

An invalid character was found in the mail header: ';' #332

yrki opened this issue Jun 29, 2020 · 10 comments
Assignees
Labels
Enhancement New feature or request
Milestone

Comments

@yrki
Copy link

yrki commented Jun 29, 2020

I received an e-mail with the following item in the header:

To: Undisclosed recipients:;

It fails with the error message:
An invalid character was found in the mail header: ';'

It looks like the e-mail is sent through Outlook / Exchange

@Jericho
Copy link
Owner

Jericho commented Jun 29, 2020

Do you have the stack trace of this exception and/or small code sample to reproduce?

@Jericho
Copy link
Owner

Jericho commented Jun 29, 2020

You said that you "received an e-mail". Does this mean you are using the ParseInboundEmailWebhookAsync method of the WebhookParser class?

@Jericho Jericho self-assigned this Jun 29, 2020
@Jericho
Copy link
Owner

Jericho commented Jun 29, 2020

If that's the case and you are indeed parsing an inbound email, can you share the JSON payload sent to you by SendGrid to help me reproduce the problem?

@Jericho
Copy link
Owner

Jericho commented Jun 29, 2020

Out of curiosity, I ran a quick little test to see if Microsoft's own email address parsing will accept such an email address:

var rawEmailAddress = "Undisclosed recipients:;";
var parsedAddress = new System.Net.Mail.MailAddress(rawEmailAddress);

When I run this test, I get An invalid character was found in the mail header: ';' exception you mentioned.

If I remove the semi-colon, I get An invalid character was found in the mail header: ':'.

var rawEmailAddress = "Undisclosed recipients:";
var parsedAddress = new System.Net.Mail.MailAddress(rawEmailAddress);

If I remove both the semi-colon and the colon I get The specified string is not in the form required for an e-mail address.

var rawEmailAddress = "Undisclosed recipients";
var parsedAddress = new System.Net.Mail.MailAddress(rawEmailAddress);

So it seems to me that the address in your scenario is hopelessly malformed and it's not clear to me at this point what StrongGrid could do to resolve this issue.

@yrki
Copy link
Author

yrki commented Jun 29, 2020 via email

@Jericho
Copy link
Owner

Jericho commented Jun 29, 2020

When you say it should be fixed, what's your expectation? How do you propose StrongGrid should handle this scenario?

@yrki
Copy link
Author

yrki commented Jun 30, 2020

The whole header is:

--xYzZY
Content-Disposition: form-data; name="headers"

Received: by mx0043p1las1.sendgrid.net with SMTP id mrCC8DhRJZ Mon, 29 Jun 2020 06:32:20 +0000 (UTC)
Received: from NOR01-OL1-obe.outbound.protection.outlook.com (mail-ol1nor01on2133.outbound.protection.outlook.com [40.107.224.133]) by mx0043p1las1.sendgrid.net (Postfix) with ESMTPS id 959C3502055 for <979923953@invoice.yrki.no>; Mon, 29 Jun 2020 06:32:18 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yrki.no; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=flhXmZSCbwkmBPW/gjZe8pEXw0lkybROQJReraU+A5U=; b=NHdWbOY0kb6i8RxcaFtjORV4Sigj0Vd56MZi8cNuRrYAP+m6CSUcbFlnUBmK32c8FCLVBKLGg+J6DqTiKHzV65F1Dz1njQxzxvbzldRd5mdniIoxtWduIo5QGcz78xKws6HTxAaRfNcpzctwFXU+6/fnkJ4yv9ifeUo7nVZkVlw=
Resent-From: <979923953@yrki.no>
Received: from AM6P191CA0061.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:7f::38) by SVAP279MB0061.NORP279.PROD.OUTLOOK.COM (2603:10a6:f10:7::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.21; Mon, 29 Jun 2020 06:32:14 +0000
Received: from VE1EUR01FT005.eop-EUR01.prod.protection.outlook.com (2603:10a6:209:7f:cafe::13) by AM6P191CA0061.outlook.office365.com (2603:10a6:209:7f::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.20 via Frontend Transport; Mon, 29 Jun 2020 06:32:14 +0000
X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 137.221.30.6) smtp.mailfrom=staples-solutions.com; yrki.no; dkim=pass (signature was verified) header.d=corpstaplessolutions.onmicrosoft.com;yrki.no; dmarc=fail action=none header.from=staples-solutions.com;
Received-SPF: Fail (protection.outlook.com: domain of staples-solutions.com does not designate 137.221.30.6 as permitted sender) receiver=protection.outlook.com; client-ip=137.221.30.6; helo=mail2.intility.com;
Received: from mail2.intility.com (137.221.30.6) by VE1EUR01FT005.mail.protection.outlook.com (10.152.2.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.20 via Frontend Transport; Mon, 29 Jun 2020 06:32:13 +0000
Received-SPF: None (mail2.intility.com: no sender authenticity information available from domain of Butikk.Alnabru@staples-solutions.com) identity=pra; client-ip=40.107.3.113; receiver=mail2.intility.com; envelope-from="Butikk.Alnabru@staples-solutions.com"; x-sender="Butikk.Alnabru@staples-solutions.com"; x-conformance=sidf_compatible
Received-SPF: Pass (mail2.intility.com: domain of Butikk.Alnabru@staples-solutions.com designates 40.107.3.113 as permitted sender) identity=mailfrom; client-ip=40.107.3.113; receiver=mail2.intility.com; envelope-from="Butikk.Alnabru@staples-solutions.com"; x-sender="Butikk.Alnabru@staples-solutions.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:40.92.0.0/15 ip4:40.107.0.0/16 ip4:52.100.0.0/14 ip4:104.47.0.0/17 ip6:2a01:111:f400::/48 ip6:2a01:111:f403::/48 include:spfd.protection.outlook.com -all"
Received-SPF: Pass (mail2.intility.com: domain of postmaster@EUR03-AM5-obe.outbound.protection.outlook.com designates 40.107.3.113 as permitted sender) identity=helo; client-ip=40.107.3.113; receiver=mail2.intility.com; envelope-from="Butikk.Alnabru@staples-solutions.com"; x-sender="postmaster@EUR03-AM5-obe.outbound.protection.outlook.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:40.92.0.0/15 ip4:40.107.0.0/16 ip4:52.100.0.0/14 ip4:104.47.0.0/17 ip6:2a01:111:f400::/48 ip6:2a01:111:f403::/48 include:spfd.protection.outlook.com -all"
Authentication-Results-Original: mail2.intility.com; spf=None smtp.pra=Butikk.Alnabru@staples-solutions.com; spf=Pass smtp.mailfrom=Butikk.Alnabru@staples-solutions.com; spf=Pass smtp.helo=postmaster@EUR03-AM5-obe.outbound.protection.outlook.com; dkim=pass (signature verified) header.i=@corpstaplessolutions.onmicrosoft.com; dmarc=pass (p=none dis=none) d=staples-solutions.com
IronPort-PHdr: =?us-ascii?q?9a23=3As16SMxGvxuVvwHrwLjSCEJ1GYnF86YWxBRYc79?= =?us-ascii?q?8ds5kLTJ76ps27bnLW6fgltlLVR4KTs6sC17OL9fmxBidZsN6oizMrSNR0TR?= =?us-ascii?q?gLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpTEdFQ?= =?us-ascii?q?/iOgVrO+/7BpDdj9it1+C15pbffxhEiCCybL9vLBi6txjdu80UjIdtN6o8zg?= =?us-ascii?q?bCr2dVdehR2W5mP0+YkQzm5se38p5j8iBQtOwk+sVdT6j0fLk2QKJBAjg+PG?= =?us-ascii?q?87+MPktR/YTQuS/XQcSXkZkgBJAwfe8h73WIr6vzbguep83CmaOtD2TawxVD?= =?us-ascii?q?+/4apnVAPkhSEaPDI/92/als9+gqRYrhy5phJ03orYbJyXOfZ7eK7WYNEUSn?= =?us-ascii?q?dbXstJVyJPH5+8YYUMAeoPP+lYrpXyqFQVoBukGQWgGPnixiNUinL026Axzu?= =?us-ascii?q?QvERvB3AwlB98CvmjZrNHzNKgISu+11rTIwS3eZP5LxDf99InIchMiof2CQL?= =?us-ascii?q?l9dtfcyVQzFwPEjVWQqpbpMi+R1uQLqWeU9PBgVf+0hm48twF+uCCvxsMyhY?= =?us-ascii?q?nSn44V0VfE9SFkwIYpJN24T0h7YcW+HJRMsCGaMpJ7T8U/SG5npCg00KcJuY?= =?us-ascii?q?KnfCcU0pQnwQbSZfOZf4SW4B/vSeScLSpliH9ler+xiBS//0e+x+PySMW631?= =?us-ascii?q?lEoytbntTRqn0AyRLe58ubRvZh4EqsxTaB2gLP5uxCPEs6m63bK5s7zb4xkJ?= =?us-ascii?q?oeqUHDETXwmErrlq+Wd0Ek+uyy5OT/erXqvIOTN4hxig3mM6QunNe/AfgiPQ?= =?us-ascii?q?gBRWiU4+G82Kf/8k3+RbVGluY2krXDv5DCIcQUuLW5DxVT0oYk8xq/AS2p38?= =?us-ascii?q?gGknYcK1JFfxGHg5L1NFHJJfD1C+q0jVe0kDpzyP3KIqftDojRInXBirvsc6?= =?us-ascii?q?xx51NBxAc91dxS5JJZBqsfLP/zREP9rt3VAx4jPwCq3+rqCc1x2p0fVG6TDK?= =?us-ascii?q?KUNb7evUOS6e8uJuSBZIoYtTT4JvUg+vLjgnk0kkIHc6azx5sYcnW4E+xmI0?= =?us-ascii?q?qHZXrshc8MH2gEsQQiUODnhkSOXCJUaXuyRq484So0B5y8AYfEW4CtnKeO3C?= =?us-ascii?q?CmHp1Qe29KEEiMEW3vd4WYRfgDdD6SIs5mkjwCT7ShTJIh1Q2qtA/9zLpnLf?= =?us-ascii?q?DY9TEftZLmzNR15uvTmg8u9TFsAMmRz3uBQ3xokm4KXTM70rpzrVFgxlqNya?= =?us-ascii?q?R4huZXFd1X5/NHSAc6MpvcwvRnBtDvRgLBf9SJSFW8Tti6BTExSMg+zMQUY0?= =?us-ascii?q?ZgANiilQzD0DCyA78RibOLH4U48rnb33j1OsZ913fG1K4nj1k9WMdAKWqmhq?= =?us-ascii?q?tn+wjJG4HJi1mZl7qtdakE2CPA9mOOwG6QsExWVAN9UavIUGsEaUTLqtT1/E?= =?us-ascii?q?XCT7j9QZo9NQ4Ug+eGLKJAcMCtxX9bWPbgO56WN0ish2azBlChwrWFZpD3U3?= =?us-ascii?q?4B1T3ZBVNBiAcX4GqHMg4lQCympjSNX3RVCVvzbha1qLo2k3i8VEJhll7TMh?= =?us-ascii?q?9N9JuQvzMLjPiBQu8S2bRY531ztWAtTx60isjNAp+bpwM7IfsPKdho+lpD3H?= =?us-ascii?q?LUu0tnM5ipP61u1Tt8OwgitET0zw5rA51EnNMxq3c30At1L7ne11VEdjiC2o?= =?us-ascii?q?v3NKGRIW73r3XNI7WDwVza3d2K/b1Vrf8/sU34oAixEkc56HJjzsVU1H2Ho5?= =?us-ascii?q?LMCQsZS5XqVUgrshN9ouK/AGE9sq3O0ng+HaCov235xtgrCeA5mDOtZMxWP6?= =?us-ascii?q?7BNSOgOMocG8WoNKkWikCkPDclGc0XyqMuJMKhcam2nYuQectwlzKvi2tKpb?= =?us-ascii?q?tw1E6B7QNQYe7F1JVWppPQ1AvSWTP8vFKTiev9hoNBTwktWWW9+yW0HKNhef?= =?us-ascii?q?V2fpcBM0CXAfe63NxDxLewZisLkTzrDQYihJbzfBaNMWK6ggxc5BxM/Fqjom?= =?us-ascii?q?yfwh9GqywtkPqW/2/W6vr5Zic9OHZ1S0lz01K0frGl0dY3fUuWTQwqyDKUvg?= =?us-ascii?q?Xo4vQKnqlUPjiIX0FTewX6Djx5f5GQ55aQTpcez8wRgX9ObL25aECoYbigvy?= =?us-ascii?q?cn4SCgD2hE6Tp8SxTwqKTXlR9r0EmUIkZD9mXTXP9N+i/OwYfdR9FT3wVaVS?= =?us-ascii?q?sgjDTKK12ZZtOupvSzkLaW4aiuEmO7UZtLdjP3iJmNrza/+ThyCAakzK3htv?= =?us-ascii?q?jOKyNjiHepj51GUCzSpyzxaY7x2/byKbdheU9lQBfk4NYvQ9km1sMrnMRUkX?= =?us-ascii?q?EWhZSQqGBD2W7oKdsOw+a2dmcEEA1LjNLQ6RLunld+J1qS24vhUniGh9BmY8?= =?us-ascii?q?SmY2QQwWQ26MUFTO/NtOAUwHQr+huN6QTWZ/UnxGU01Ocu5XgGguoApAsqyG?= =?us-ascii?q?CnD6sPGVVDZnCxxRGB7tTk6qRReGercKShkkF5mIPpF6mM9ydbXnuxYZI+BW?= =?us-ascii?q?lo9MwqGk/Q0X7wrKjgftDad887rQGdixPNlK1OL5YsivsNgzEhMmX47jU+0+?= =?us-ascii?q?ButRV1xtmhuZSfbWBk/aa3GBldYxfoe8IQ+XfEiaBXlNyL95uzF41lFy5OR5?= =?us-ascii?q?zsUO6pFzQJ8//gMlXGCyUy/0+SAqGXBgqD8AFmonbIRoisLG2SLWIFwM9KaS?= =?us-ascii?q?SnfBcaqSVJGTIwk9g+Cxygw9HnfAFh/DcN61XkqxxKjOV1Kx34VWSZrwCtOX?= =?us-ascii?q?84S5maeQJf9RoKp1zUPsqX8v9pEmlG84egog2AJi3TZwlBAWwTHE3RL1vkJK?= =?us-ascii?q?G1+dDY9+WDHe26MufPZrOV7+tYUvaD35W01YV6uT2LM5bHMnxrFfZuwkNYRj?= =?us-ascii?q?g5A5HfnDMCAyAWjHfLaMiW5V+wrzZrp9i7/e+uQwXr+JeODL1Jd95o/kns05?= =?us-ascii?q?2OPOORmit1bA1g+MhQnC3uz74SlB4XgiBqLX+sF6gBsS/RXeTbnaoFRxgcIz?= =?us-ascii?q?h+MsdF9eo1wxVNNMjHi9j0yq8d7LZ9ClFLUkbkk92oYspCKn+0NVfODkKGfL?= =?us-ascii?q?qcIjiDz8byaKK6Abpe6Ycc/zetpTeYEAnKOjKKnSP0fwuzOPlIgTreJxtapZ?= =?us-ascii?q?28dRB2T2PkSZOuaxG2NsN2kSxj2ac91RaofSYXNTlxdV8Ir6XFsXse260gXT?= =?us-ascii?q?cHtyM+fqGeli2U7vfVMMMTuPpvWGJ1kf5b5HUm2v1e6yQXIZ490CbUsNNqpE?= =?us-ascii?q?mr1+eVzT8yGjBTtjdIh8SiuUNrM7/E3oJcUG7A8QlI9mKUFggLoN1+TNbovu?= =?us-ascii?q?oDr7qH3LK2MzpE/9/OqIE2GtTVK8HBGX4nOBDzBRbPEAIdSTOwcHrYg1FBkf?= =?us-ascii?q?aU7TueqZ1w+f2O0NIeD7RcUlIyDPYTDE9oSccDLJlAVTQhibeHjcQM6CPk/i?= =?us-ascii?q?PcT8hboJ3LE8mqL6iyeGShhKJfL1sNyLL8d8ISMJH6301+ex9xm4GYU0bXWN?= =?us-ascii?q?lMpGVmYGpW6A1n7WR/TW518kbjYwm3/VcICfesmhMtzxB5Zfkx9TDq+BE8IV?= =?us-ascii?q?+CqCYrkUY3kMnomnjNKHiodPj2BscPUnGR1QB5O4izWwtvaAyugUFofCzJQb?= =?us-ascii?q?5clfoodGxmjhPdpYoaHPddSaNeZxpDoJPfL/4s0FlatmCm3Robva2cUcQkz0?= =?us-ascii?q?1zKMX/52hN0A9ictMvcKnZJa4TiFlWmqOKvzO5kOs2xVx7RQ5F/WWMdSoPoE?= =?us-ascii?q?FNOKMhIn/i1PFw6A+B3RJHfmEGTecCue5j7kcwIKGbyCb9z79ELFv3POuaZf?= =?us-ascii?q?D82SCIhYuTT1U821ld3WNY4bl10oEKd0ydXVoy5KCNHgwNONGHMgZRctZT83?= =?us-ascii?q?7IOy2JtK+epPA9d5X4HefuQ+iUsa8SiU/xBwclEbMH6cEZF4Wt2kXVfo/3aa?= =?us-ascii?q?QIwhI36EH3NU2IWb5XLQmTnm5N8KTdhNdnmJNQLTYHDSBhPDWrs/zJ8xQyjq?= =?us-ascii?q?PLXc9qMCtCGNpecCpwAIrjxmZYpygSUGHxi7pGjlDEt3il+EGyRHH9d4YxOa?= =?us-ascii?q?3SPEs0TonwoXJmr+C3kQKFq82CYT2lc4wk4piWtqsbv8jVUfoMFOsk6h6Old?= =?us-ascii?q?UAHy74FDKfdLz9b5noNdt2ZIStWC/jCw6x12puHZW2YIblL66DhRzkSNRPqI?= =?us-ascii?q?eXmig5MtOwHS0fHBE2oPwf4KV7ZksIZJ9eA1ag8g06M+bmelWi396jQnigJX?= =?us-ascii?q?5td9cCnLnoX7VM1GJsa+a7zCFmT5cmzu227V9LT5YP3FnSwvOqZo8WViaWeD?= =?us-ascii?q?QVYwLUuS8wjHRsLM4f/91nm1bhlARZNDqGMut0dGZDotcwQ0uIJml7AXY5QF?= =?us-ascii?q?naipff5gmr3PYZ+C44/Z4c3eBesXf4t4PSe3rwAOry8cqT6Gx5NINuqrY5KY?= =?us-ascii?q?H5J8qaqJ7S1ifSSpXdqEzNUSK3EeZbhskFIC9cR6ot+yltMsgHtIxdrEspA5?= =?us-ascii?q?tmYeUXV+934OnzMmksFyMZwC4HWpnV2TUDhr362r3GlxORbIVkOxsB4/Agyp?= =?us-ascii?q?MQVTB7ZiQGqeqtTYLTwiWuV3QKIwRVxABK7Qgai6drYun95IfTCYRLzyNKov?= =?us-ascii?q?VySW3AEZwipD6ZAimGxEP1TvmsibnjxQVJ0PflycUWQjZSNHIFnKN/sxZtL7?= =?us-ascii?q?t6ba4NooTNrzmEM1vgu37gw/enI18XztDIc1r/D8zOsm+2AUh+sTUEAIRIzn?= =?us-ascii?q?/YD5EblQF0Pb0qqFt7K4ejYk/i5jYgytchD/yiWMus3VpgsWceSnLgDY9aE+?= =?us-ascii?q?8/+gGyOnUtc9WxpZ7iIZkXXmJA5MjXtQJCiEs0ey+hlcgAc4ccuHhUGmAI+G?= =?us-ascii?q?jVvcPuGpEbn5YuUNlUZI844imYeusMOYDN8SBs/OW3kjmBvWh76QvyxS3vSf?= =?us-ascii?q?bgE6QFoCtGXF1ufjvWq1FxXbElqj6AqwmU4F4op78JVP/T3SAT6H58Bs4cXD?= =?us-ascii?q?8RjCL8dg0hQiUe6LcIb/iFO81aSP0vaRL9IAQwGbg+xUuV8EponHD/JStvqg?= =?us-ascii?q?9d/CObVA4xMEtdyvLknTlU8531CXohU5tNKA4ZQWLdMQvBwnJMoB9Hb0xxHo?= =?us-ascii?q?seBstZ+rYdxs1f+c+QER/9exFAZwRrM0cD6dQakEdCtEuCfiWHVlizaf/Xth?= =?us-ascii?q?BsONyWqNO1LfP/50FMjYa16bllpZVGfGWvnEiWef6br4L4sYHV5GazTv+jds?= =?us-ascii?q?SZPDrGRjWKig2sj7A5CZWM5zLULAdQN5h9zzwjfITlDmnIex9BIvBCKg=3D?= =?us-ascii?q?=3D?=
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0E0BwCPivleh3EDayhGGh0BATwBBQU?= =?us-ascii?q?BAgEJAYFhgSEMI1FaCBR1AwcIGxEKglmBToNGA4U4jk6OH4VBgRADGBcmCwE?= =?us-ascii?q?BAQEBAQEBAQMBAwEiCQICBAEBAoRFAhcMggkeBgEENBMCAQ8BAQEEAQEBAgE?= =?us-ascii?q?DAwIBAQEBAhABAQEIDQkIKYViDIIwCAsvXzxFAQEBAQEBAQEBAQEBAQEBAQE?= =?us-ascii?q?BAQEBAQEBAQEBAQEBAQEBAQEBAQUCCD0BFjAOAQ8BFgkCAQMFAQwRAggBEgE?= =?us-ascii?q?BHQMBARYPAgEGHwEBAQoOAQYDAgICBRAGCQwUBgsCFgEIBg0HOYJLAYJLAy8?= =?us-ascii?q?CAQsvDI98kGgCAoE3iCw0AQF1gTIfgmIBAQV6OAEUQIMrGIIHBwMGgSEXAYJ?= =?us-ascii?q?mLIRFAgFthXo+NIEggRuEKiICAQEXgQdBFRYJgmAUAxyCLYxSg2iBeogFAo9?= =?us-ascii?q?Lgi0BAlyGF4FTAwQDglwEhn0CB4E9kRWMNZJfj32LaoJhkVsCBAIEBQIOAQE?= =?us-ascii?q?FgWqBeXCBbgqBQQlHFwINjikOCYNOhHGFNy5DMQIJLAIGAQcBAQMJAXuNHYE?= =?us-ascii?q?DATRcAQ?=
X-IPAS-Result: =?us-ascii?q?A0E0BwCPivleh3EDayhGGh0BATwBBQUBAgEJAYFhgSEMI?= =?us-ascii?q?1FaCBR1AwcIGxEKglmBToNGA4U4jk6OH4VBgRADGBcmCwEBAQEBAQEBAQMBA?= =?us-ascii?q?wEiCQICBAEBAoRFAhcMggkeBgEENBMCAQ8BAQEEAQEBAgEDAwIBAQEBAhABA?= =?us-ascii?q?QEIDQkIKYViDIIwCAsvXzxFAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBA?= =?us-ascii?q?QEBAQEBAQEBAQUCCD0BFjAOAQ8BFgkCAQMFAQwRAggBEgEBHQMBARYPAgEGH?= =?us-ascii?q?wEBAQoOAQYDAgICBRAGCQwUBgsCFgEIBg0HOYJLAYJLAy8CAQsvDI98kGgCA?= =?us-ascii?q?oE3iCw0AQF1gTIfgmIBAQV6OAEUQIMrGIIHBwMGgSEXAYJmLIRFAgFthXo+N?= =?us-ascii?q?IEggRuEKiICAQEXgQdBFRYJgmAUAxyCLYxSg2iBeogFAo9Lgi0BAlyGF4FTA?= =?us-ascii?q?wQDglwEhn0CB4E9kRWMNZJfj32LaoJhkVsCBAIEBQIOAQEFgWqBeXCBbgqBQ?= =?us-ascii?q?QlHFwINjikOCYNOhHGFNy5DMQIJLAIGAQcBAQMJAXuNHYEDATRcAQ?=
X-IronPort-AV: E=Sophos;i="5.75,294,1589234400";  d="gif'147?png'147,150?jpg'147,150,145?scan'147,150,145,208,217,147,150,145";a="35441586"
X-BulkMail: True
X-MGA-submission: =?us-ascii?q?MDEkvtOAiQNM2MUr+6GvprDW8Jhf+VgIqQMT0B?= =?us-ascii?q?lZsTGRSgIXV0cyDM9bRCnga652zs5K/1D9u/yKmmfdnWQR1foqbMpRyi?= =?us-ascii?q?jF/Kg5yYKepIWGt5tqFvcamY5eVUgi+SAd0ZG9TsgIbU5gWofCU1r3Co?= =?us-ascii?q?U1?=
Received: from mail-eopbgr30113.outbound.protection.outlook.com (HELO EUR03-AM5-obe.outbound.protection.outlook.com) ([40.107.3.113]) by mail2.intility.com with ESMTP/TLS/AES256-GCM-SHA384; 29 Jun 2020 08:32:06 +0200
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QZq+7K5GyA2L5vCnUk+HfmT3tSuRv0e6zjMOpwyR3ihS/wC3cNgqxmR0z1aCeAdJC7ryuhJCVCCsHCzS9WktqHsYhGqk4PmIB+kFoUCzCt90yfKIjP8RmXKWQ+2ULAdywUeTzSKtTi3IhKhYkBAOOGHX+jBHy/XYZwY1MfejVDSN9ypLx3Hd+u7Z+XdkMHz/ouTsrOxtNi+kT8ZnynXBSeCz7keSogCuVGSMTpU6HthaTqFZvfSN1cclM4Kr+z7RuR95pdfaGpObfhe7TsycvpfkkxrH8IqMplIot71aPPKd/WhwzDHofL3kX5z/kD92Zbmq3J57SloSkg4FfRXkEg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=flhXmZSCbwkmBPW/gjZe8pEXw0lkybROQJReraU+A5U=; b=AExB9b0sfLLjqmlLMs1IUsocAlRo74fdh7DCH59UobUKr/Le8W5A6JsC2+7Thi3vgurTFZR8FUD8r8PsMHKe7D65KL0MYWTQbbSi2rSGansf0KePaimHDEkKdXFlVQn5SVsZoQ4FNhAIDY2NBWYhisNgdpcGF5EM3gzl3HH4AtG/TR1K5zMIqcwU6pZcpFzwVoohcJMLTyjBVhgmRN4XZap+O3Fl+XT+OL5/fV0zZrLvGYu7EdJm4OupvTmkKyne+HtibII/BUPrc4pbnVp44JXwrGfqK3noiCfbG0Ngl5L/S7+gE6+hQij0zX2JHKTOY8Vr9A0E1oDVHVPHEtsHAw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=staples-solutions.com; dmarc=pass action=none header.from=staples-solutions.com; dkim=pass header.d=staples-solutions.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corpstaplessolutions.onmicrosoft.com; s=selector2-corpstaplessolutions-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=flhXmZSCbwkmBPW/gjZe8pEXw0lkybROQJReraU+A5U=; b=L412mdw6V/7idY035NlS/OeKZPulV8aK+pAvszURjpVgHy6m07Qy6nEIkVJlk4AY3+zM49ReCy93vnslEdI5sERH9DzE19O7QX2qT1maxZCn5tTUZk+xkrEb/TM2zYFbky0CafXX2wbMVUWPyM3ijGjiW4yj0meuEmM1bo3IOoI=
Received: from DB7PR10MB2092.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:5:7::14) by DB6PR1001MB0968.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:4:62::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.21; Mon, 29 Jun 2020 06:32:01 +0000
Received: from DB7PR10MB2092.EURPRD10.PROD.OUTLOOK.COM ([fe80::2532:9dcd:6bcb:98b4]) by DB7PR10MB2092.EURPRD10.PROD.OUTLOOK.COM ([fe80::2532:9dcd:6bcb:98b4%6]) with mapi id 15.20.3131.026; Mon, 29 Jun 2020 06:32:00 +0000
From: "Alnabru, Butikk" <Butikk.Alnabru@staples-solutions.com>
Subject: =?utf-8?B?QW50aWJhYyBvZyBhbmRyZSBkZXNpbmZla3Nqb25zbWlkbGVyIHDDpSBTdGFw?= =?utf-8?Q?les_Alnabru?=
Thread-Topic: =?utf-8?B?QW50aWJhYyBvZyBhbmRyZSBkZXNpbmZla3Nqb25zbWlkbGVyIHDDpSBTdGFw?= =?utf-8?Q?les_Alnabru?=
Thread-Index: AdYudrtdHb2wapTy5EeWtf5Siq1GwACglaDQAes4PYABYhoB4AAA1uwQAJpKWoAAz2SaIAAAbIeQAMHz9GAAYCy58AAAXLhQAGP4wPAA+ruU8A==
Date: Mon, 29 Jun 2020 06:31:59 +0000
Message-ID: <DB7PR10MB2092359F4DD847908DB6FDCDDD6E0@DB7PR10MB2092.EURPRD10.PROD.OUTLOOK.COM>
References: <DB7PR10MB2092616FAEBDA718485A6DFEDDB60@DB7PR10MB2092.EURPRD10.PROD.OUTLOOK.COM> <DB7PR10MB20920AB8214EFC8C1F93294DDDB30@DB7PR10MB2092.EURPRD10.PROD.OUTLOOK.COM> <DB7PR10MB2092EBD2989AFF21AC859F4ADD8B0@DB7PR10MB2092.EURPRD10.PROD.OUTLOOK.COM> <DB7PR10MB2092188C80EF3CF36CB8DA87DD820@DB7PR10MB2092.EURPRD10.PROD.OUTLOOK.COM> <DB7PR10MB2092CEF8670449323F557272DD820@DB7PR10MB2092.EURPRD10.PROD.OUTLOOK.COM> <DB7PR10MB2092DC9756937BED013C9BE2DD810@DB7PR10MB2092.EURPRD10.PROD.OUTLOOK.COM> <DB7PR10MB2092C42B227C311D916C221CDD9D0@DB7PR10MB2092.EURPRD10.PROD.OUTLOOK.COM> <DB7PR10MB2092B192672A9D96FE3F8FA4DD9D0@DB7PR10MB2092.EURPRD10.PROD.OUTLOOK.COM> <DB7PR10MB2092C17C9630F3A88DFE27F7DD970@DB7PR10MB2092.EURPRD10.PROD.OUTLOOK.COM> <DB7PR10MB2092626505A0F208EF2F54F9DD970@DB7PR10MB2092.EURPRD10.PROD.OUTLOOK.COM> <DB7PR10MB20922493A89637E5B731A61DDD970@DB7PR10MB2092.EURPRD10.PROD.OUTLOOK.COM> <DB7PR10MB2092704C4F3B881CA65FD4E7DD950@DB7PR10MB2092.EURPRD10.PROD.OUTLOOK.COM>
In-Reply-To: <DB7PR10MB2092704C4F3B881CA65FD4E7DD950@DB7PR10MB2092.EURPRD10.PROD.OUTLOOK.COM>
Accept-Language: nb-NO, en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator:
x-originating-ip: [85.252.66.206]
x-ms-publictraffictype: Email
X-MS-Office365-Filtering-Correlation-Id: cea33216-9248-4327-211b-08d81bf6294b
x-ms-traffictypediagnostic: DB6PR1001MB0968:|SVAP279MB0061:
X-Microsoft-Antispam-PRVS: <SVAP279MB00614F4DD5390A01EECF5CC2DD6E0@SVAP279MB0061.NORP279.PROD.OUTLOOK.COM>
x-ms-oob-tlc-oobclassifiers: OLM:3173;OLM:3173;
x-forefront-prvs: 044968D9E1
X-MS-Exchange-SenderADCheck: 2
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original: RAMq/NzA9OfMzTnjFgsAwnPNAzTLZulWPh8UouO0TvauC3WXrCtv+tfjyGl00l1pJsEgsHISptjXUGfHtshEzz3g7J7+8CF7c8IULVQCm09pMKxupwmg3nD/P/WmdxCzmmZtfMOlunDGEFc8vQTe/YDvR8Q+1SBLpnABfp1DB2oJrUI0NEWAnF6oLtMouECLMU0LPpcQjKQVMVGDsiX4+CvswVAwr+ZfZx/KirTm7iKoyxelnek1CZj/oijhd7Sgp/8C8YqrNTL56RGwXRubgDo7nocFDFhs0LzuIoPeU0HFZb4n2X6nY7SSY3lb4M5+NddXUA22RE0BPVrocfzYnk6J8rgpBSH8pyjPmJV+ocF6TTnMhSDiAnZKdh4WLU2nsXMMdr8LCaEFcL5P5UNM8g==
X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:nb;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR10MB2092.EURPRD10.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(376002)(136003)(346002)(396003)(366004)(39850400004)(52536014)(86362001)(71200400001)(966005)(186003)(33656002)(16799955002)(26005)(89122003)(224303003)(76576003)(88732003)(7276002)(7336002)(7406005)(7416002)(7366002)(478600001)(316002)(7696005)(5660300002)(99936003)(109986005)(166002)(6506007)(19627405001)(76116006)(9686003)(4744005)(76236003)(55016002)(66446008)(64756008)(66556008)(8936002)(66946007)(66476007)(66576008)(2906002);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata: 6lQs61U+vet18gB99Fcqg4ZYV4qQZmWJRc4iDkbgGEEewH+WXgQo8CwcgmgpAmz+6d+o8Cimrz1byuSuRMjV8Vy7uZ5Ln2VGvEff4OKzXOJAQX2DA3vmmy/kFf6fGBVJbXzmSVm968jRnya29guTgUexkTuQ6FvsaG1+YMWO0ikvPdvdGyOJ6CRuz/IZDJym2z0qPP4oornhqeIWBFEI/FXBHmqefY2igFktrYN1G3R1UaR6tX7+oL5gwf2x/swjwjulXIjxFb5SHWttAvU5TFo0CDiZpM2CMu870GBZKFOCSsgr8i/bi+tEn+vaXyDb0FR7Pky90SGkQ5QFuJixDmBbycIXMFSOA+p7LomVxLYLzc7l8WxBmpGeb7Ptw6qQLkB58wXD1uh2DQHdaQRu4zAVVlyZvop58CCGZZbTVXV51DkkdxmFqdp1l4RJsP/0UAecKe17iOoapVio2xeOkSbUwHCplhok3WeFe0PP3d0=
x-ms-exchange-transport-forked: True
Content-Type: multipart/related; boundary="_010_DB7PR10MB2092359F4DD847908DB6FDCDDD6E0DB7PR10MB2092EURP_"; type="multipart/alternative"
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR1001MB0968
To: Undisclosed recipients:;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR01FT005.eop-EUR01.prod.protection.outlook.com
X-Forefront-Antispam-Report: CIP:137.221.30.6;CTRY:NO;LANG:nb;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:mail2.intility.com;PTR:mail2.intility.com;CAT:NONE;SFTY:;SFS:(4636009)(396003)(39850400004)(376002)(346002)(136003)(46966005)(70586007)(336012)(316002)(356005)(498600001)(47076004)(166002)(26005)(82310400002)(70206006)(52536014)(33310700002)(66576008)(7596003)(7636003)(33656002)(224303003)(16799955002)(5660300002)(82740400003)(99936003)(8936002)(6506007)(76236003)(86362001)(9686003)(109986005)(55016002)(966005)(2906002)(33964004)(19627405001)(7696005)(206002)(579004);DIR:OUT;SFP:1102;
X-MS-Office365-Filtering-Correlation-Id-Prvs: 1e741a98-7988-44ff-047c-08d81bf6216e
X-LD-Processed: 623ec005-a3d1-4dd8-901b-66199f855166,ExtFwd
X-Forefront-PRVS: 044968D9E1
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: iqDD+JedayAbfSyTtCdivNjdqYe2XOU7dSNXELaFUKN8syD5q5X1lcVHsJZBpJOmyJWQXZ8npOrd1TuU98nkbwfUelmREKd57djYGaD3Qds0SsD1qxVHVk2EBW0n3zKzL6yNkz7O3/uP+eg1ZwC0je8A4Xjve/26iYV8f8omK5HqYdPlGWvS9+hmn7DtJmQX8qBxoigQFPydLYQg3pJPxFqVKGFws6UfGki7stc1lJFyv7iTYAcb9SCdwmt3ly0zTvZZ9+P5BDWm4fM1l9G0f6sX51BnDytqrJYcnWISoxg2Cbt7en0DqjwrajksTPPXgxS7KGleYklO4sWquN19w6duUxr04A21PrZIqaEodMYz4I7DUuQ9lSmjzNIMoG8D7K3olMsxDYU2UOKwDA1HfFdtGIeh99qW9baGNKvRWPwPiJSZtoLmA4DDro/BlNdnTn42Etl9X1HI03MXJj/ia5T2q0yYrs3mL2y0wFkZTFHSfn+SnBIqrVCpTEbg6ESHfSaYIgXVaFupLbyMVFbf8w==
X-OriginatorOrg: yrki.no
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jun 2020 06:32:13.9780 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: cea33216-9248-4327-211b-08d81bf6294b
X-MS-Exchange-CrossTenant-Id: 623ec005-a3d1-4dd8-901b-66199f855166
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=623ec005-a3d1-4dd8-901b-66199f855166;Ip=[137.221.30.6];Helo=[mail2.intility.com]
X-MS-Exchange-CrossTenant-AuthSource: VE1EUR01FT005.eop-EUR01.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SVAP279MB0061

And I agree I'm not sure if StrongGrid should handle this. The only solution to handle this is just to swallow the exception and ignore errors from the System.Net.Mail.MailAddress-method, which may not be good.

It seems that the mail that is originally is a newsletter with all the recipients in the BCC-field. I'm not sure if they have sent it through a newsletter-program or via outlook.

Anyhow the mails received in this format does not have any value for us, so if the parsing fails due to this, it will just generate a parse error.

Thanks for your time! :)

@Jericho
Copy link
Owner

Jericho commented Jun 30, 2020

Here is the current StrongGrid logic:

var parsedAddress = new System.Net.Mail.MailAddress(rawEmailAddress);
return new MailAddress(parsedAddress.Address, parsedAddress.DisplayName);

As you can see, we delegate the parsing of email addresses to System.Net.Mail.MailAddress to figure out the Address and DisplayName properties which is the source of the problem you are experiencing.

Thinking out loud: maybe we could ignore parsing exceptions and use a null value in lieu of Address and the whole rawEmailAddress in lieu of DisplayName. Something along these line:

try
{
  var parsedAddress = new System.Net.Mail.MailAddress(rawEmailAddress);
  return new MailAddress(parsedAddress.Address, parsedAddress.DisplayName);
}
catch
{
  return new MailAddress(null, rawEmailAddress);
}

I'm not totally sold on this idea though. We need to think further on the possible ramifications (if any) of the MailAddress with a null Email property.

@Jericho Jericho added this to the 0.73.0 milestone Oct 3, 2020
@Jericho
Copy link
Owner

Jericho commented Oct 3, 2020

I will ad this logic to the upcoming release.

@Jericho Jericho closed this as completed in 3155553 Oct 3, 2020
@Jericho
Copy link
Owner

Jericho commented Oct 3, 2020

🎉 This issue has been resolved in version 0.73.0 🎉

The release is available on:

Your GitReleaseManager bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants