Разбираем и лечим ошибки отправки и пересылки электронной почты. A message that you sent could not be delivered to one or more of its recipients. This is a permanent error.
550-5.7.1 duplicate headers
Имеем:
- электронный почтовый ящик [email protected];
- входящие сообщения о новых заказах на неком magaz.ua;
- пересылка входящих на [email protected];
- оригинальные название магаза и Имя получателя/отправителя изменены.
Некоторые письма от magaz.ua пересылаемые с ukr.net gmail возвращает ругаясь на This message is not RFC 5322 compliant и 550-5.7.1 duplicate headers.
Смотрим заголовки электронного письма вернушегося от gmail:
This message was created automatically by mail delivery software. A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed: client@gmail.com host gmail-smtp-in.l.google.com [64.233.165.27] SMTP error from remote mail server after end of data: 550-5.7.1 [212.42.77.194] This message is not RFC 5322 compliant, the issue is: 550-5.7.1 duplicate headers. To reduce the amount of spam sent to Gmail, this 550-5.7.1 message has been blocked. Please review 550 5.7.1 RFC 5322 specifications for more information. bk37-20020a05651c23a500b002770960b9f3si7461759ljb.514 - gsmtp --1667884506-eximdsn-33613 Content-type: message/delivery-status Reporting-MTA: dns; frv194.fwdcdn.com Action: failed Final-Recipient: rfc822;client@gmail.com Status: 5.0.0 Remote-MTA: dns; gmail-smtp-in.l.google.com Diagnostic-Code: smtp; 550-5.7.1 [212.42.77.194] This message is not RFC 5322 compliant, the issue is: 550-5.7.1 duplicate headers. To reduce the amount of spam sent to Gmail, this 550-5.7.1 message has been blocked. Please review 550 5.7.1 RFC 5322 specifications for more information. bk37-20020a05651c23a500b002770960b9f3si7461759ljb.514 - gsmtp --1667884506-eximdsn-33613 Content-type: text/rfc822-headers Return-path: <client@ukr.net> Received: from [10.10.80.14] (helo=frv52.fwdcdn.com) by frv194.fwdcdn.com with smtp ID 1osGwz-000AcV-Mg for client@gmail.com; Tue, 08 Nov 2022 07:15:05 +0200 Received: from [10.10.10.75] (helo=frv75.fwdcdn.com) by frv52.fwdcdn.com; Tue, 08 Nov 2022 07:15:05 +0200 Authentication-Result: IP=79.137.70.68; mail.from=magaz@on.magaz.ua; dkim= header.i= header.d=; ID=1osGwz-0003Ej-M5 Received-SPF: pass (frv75.fwdcdn.com: domain of on.magaz.ua designates 79.137.70.68 as permitted sender) client-ip=79.137.70.68; envelope-from=magaz@on.magaz.ua; helo=mx3.on.magaz.ua; Received: from mx3.on.magaz.ua ([79.137.70.68]) by frv75.fwdcdn.com with esmtps ID 1osGwz-0003Ej-M5 for client@ukr.net; Tue, 08 Nov 2022 07:15:05 +0200 Received: from mx3.on.magaz.ua (mx3.on.magaz.ua [127.0.0.1]) by mx3.on.magaz.ua (Postfix) with ESMTP id 0B2E483C1 for <client@ukr.net>; Tue, 8 Nov 2022 07:15:05 +0200 (EET) X-Virus-Scanned: amavisd-new at mx3.on.magaz.ua Received: from mx3.on.magaz.ua ([127.0.0.1]) by mx3.on.magaz.ua (mx3.on.magaz.ua [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id h1mZ7KMKh_Me for <client@ukr.net>; Tue, 8 Nov 2022 07:15:03 +0200 (EET) Received: from 172.16.0.110 (unknown [172.16.0.197]) by mx3.on.magaz.ua (Postfix) with SMTP id 956E97177 for <client@ukr.net>; Tue, 8 Nov 2022 07:15:02 +0200 (EET) Date: Tue, 08 Nov 2022 07:15:02 +0200 To: client@ukr.net Subject: =?UTF-8?B?0JXQv9GW0YbQtdC90YLRgDog0J3QvtCy0LUg0LfQsNC80L7QstC70LXQvdC90Y8g4oSWMTk5OTExMTM=?= From: magaz@on.magaz.ua Reply-To: magaz@on.magaz.ua X-EVENT_NAME: SALE_NEW_ORDER X-Priority: 3 (Normal) Date: Tue, 08 Nov 2022 07:15:02 +0200 MIME-Version: 1.0 X-MID: 9773279.33 (08.11.2022 07:15:00) Content-Type: multipart/alternative; boundary="-------alt4756369e5d" Message-Id: <20221108051505.0B2E483C1@mx3.on.magaz.ua> X-Authentication-Results: mxs.ukr.net; spf=pass (frv75.fwdcdn.com: domain of on.magaz.ua designates 79.137.70.68 as permitted sender) client-ip=79.137.70.68; dmarc=accept header-from=magaz@on.magaz.ua X-Ukrnet-Yellow: 1 X-ResentFrom: <client@ukr.net> X-Exim-DSN-Information: Due to administrative limits only headers are returned
Заголовки того же самого электронного письма успешно попавшего в ящик ukr.net:
Return-path: <magaz@on.magaz.ua> Received: from [10.10.10.75] (helo=frv75.fwdcdn.com) by frv52.fwdcdn.com; Tue, 08 Nov 2022 07:15:05 +0200 Authentication-Result: IP=79.137.70.68; mail.from=magaz@on.magaz.ua; dkim= header.i= header.d=; ID=1osGwz-0003Ej-M5 Received-SPF: pass (frv75.fwdcdn.com: domain of on.magaz.ua designates 79.137.70.68 as permitted sender) client-ip=79.137.70.68; envelope-from=magaz@on.magaz.ua; helo=mx3.on.magaz.ua; Received: from mx3.on.magaz.ua ([79.137.70.68]) by frv75.fwdcdn.com with esmtps ID 1osGwz-0003Ej-M5 for client@ukr.net; Tue, 08 Nov 2022 07:15:05 +0200 Received: from mx3.on.magaz.ua (mx3.on.magaz.ua [127.0.0.1]) by mx3.on.magaz.ua (Postfix) with ESMTP id 0B2E483C1 for <client@ukr.net>; Tue, 8 Nov 2022 07:15:05 +0200 (EET) X-Virus-Scanned: amavisd-new at mx3.on.magaz.ua Received: from mx3.on.magaz.ua ([127.0.0.1]) by mx3.on.magaz.ua (mx3.on.magaz.ua [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id h1mZ7KMKh_Me for <client@ukr.net>; Tue, 8 Nov 2022 07:15:03 +0200 (EET) Received: from 172.16.0.110 (unknown [172.16.0.197]) by mx3.on.magaz.ua (Postfix) with SMTP id 956E97177 for <client@ukr.net>; Tue, 8 Nov 2022 07:15:02 +0200 (EET) Date: Tue, 08 Nov 2022 07:15:02 +0200 To: client@ukr.net Subject: =?UTF-8?B?0JXQv9GW0YbQtdC90YLRgDog0J3QvtCy0LUg0LfQsNC80L7QstC70LXQvdC90Y8g4oSWMTk5OTExMTM=?= From: magaz@on.magaz.ua Reply-To: magaz@on.magaz.ua X-EVENT_NAME: SALE_NEW_ORDER X-Priority: 3 (Normal) Date: Tue, 08 Nov 2022 07:15:02 +0200 MIME-Version: 1.0 X-MID: 9773279.33 (08.11.2022 07:15:00) Content-Type: multipart/alternative; boundary="-------alt4756369e5d" Message-Id: <20221108051505.0B2E483C1@mx3.on.magaz.ua> X-Authentication-Results: mxs.ukr.net; spf=pass (frv75.fwdcdn.com: domain of on.magaz.ua designates 79.137.70.68 as permitted sender) client-ip=79.137.70.68; dmarc=accept header-from=magaz@on.magaz.ua X-Ukrnet-Yellow: 1 X-Ukrnet-Flavor: coconut ...
У обоих писем Message-Id: <[email protected]>
- одинаковое, значит имеем дело с одним и тем же письмом, которое сначала зашло в ящик [email protected] и потом автоматически перенаправлено в ящик [email protected].
Что говрит стандарт RFC 5322 о заголовках электронных писем и ограничениях на их число:
RFC 5322: Internet Message Format https://www.rfc-editor.org/rfc/rfc5322#section-3.6 3.6. Field Definitions ... The following table indicates limits on the number of times each field may occur in the header section of a message as well as any special limitations on the use of those fields. An asterisk ("*") next to a value in the minimum or maximum column indicates that a special restriction appears in the Notes column. +----------------+--------+------------+----------------------------+ | Field | Min | Max number | Notes | | | number | | | +----------------+--------+------------+----------------------------+ .... | orig-date | 1 | 1 | | | from | 1 | 1 | See sender and 3.6.2 | | sender | 0* | 1 | MUST occur with | | | | | multi-address from - see | | | | | 3.6.2 | | reply-to | 0 | 1 | | | to | 0 | 1 | | | cc | 0 | 1 | | | bcc | 0 | 1 | | | message-id | 0* | 1 | SHOULD be present - see | | | | | 3.6.4 | | in-reply-to | 0* | 1 | SHOULD occur in some | | | | | replies - see 3.6.4 | | references | 0* | 1 | SHOULD occur in some | | | | | replies - see 3.6.4 | | subject | 0 | 1 | | ... https://www.rfc-editor.org/rfc/rfc5322#section-3.6.1 3.6.1. The Origination Date Field The origination date field consists of the field name "Date" followed by a date-time specification. orig-date = "Date:" date-time CRLF The origination date specifies the date and time at which the creator of the message indicated that the message was complete and ready to enter the mail delivery system. For instance, this might be the time that a user pushes the "send" or "submit" button in an application program. In any case, it is specifically not intended to convey the time that the message is actually transported, but rather the time at which the human or other creator of the message has put the message into its final form, ready for transport. (For example, a portable computer user who is not connected to a network might queue a message for delivery. The origination date is intended to contain the date and time that the user queued the message, not the time when the user connected to the network to send the message.)
Приглядевшись к заголовкам электронного сообщения из дубликатов можно обнаружить только один заголовок Date, ака orig-date (The origination date field consists of the field name "Date" followed by a date-time specification.).
Min number
и Max number = 1
, а заголовков Date:
в сообщении целых 2:
Received: from 172.16.0.110 (unknown [172.16.0.197]) by mx3.on.magaz.ua (Postfix) with SMTP id 956E97177 for <client@ukr.net>; Tue, 8 Nov 2022 07:15:02 +0200 (EET) Date: Tue, 08 Nov 2022 07:15:02 +0200 ... Date: Tue, 08 Nov 2022 07:15:02 +0200 MIME-Version: 1.0 ...
Postfix - это агент отправки уже сформированного письма, ПО же которое формирует заголовки письма нам не известно (X-Mailer:
не указан).
Получается, что magaz.ua, когда отправляет, а ukr.net, когда принимает, - не придерживаются секции "3.6. Field Definitions" стандарта rfc5322 на лимит числа заголовков "Date"? И как их там всех убедить исправить багу?
Ссылки по теме duplicate headers
- Gmail: Weird RFC 5322 bounces and what to do about them
- Duplicate Date header in SMTP · Issue #6295 · osTicket/osTicket · GitHub
...
Make sure that the following headers included in your email are limited to just one each: BCC, CC, Date, From, Sender, Subject, To.
Статья будет обновляться по мере необходимости...