From postfix-users Mon Oct 21 16:10:55 2019 From: Wietse Venema Date: Mon, 21 Oct 2019 16:10:55 +0000 To: postfix-users Subject: Re: Remove duplicate header 'MIME-Version' Message-Id: <46xhSv5mZPzJrNt () spike ! porcupine ! org> X-MARC-Message: https://marc.info/?l=postfix-users&m=157167429516831 lucas2@dds.nl: > Hello Group, > > I have configured Postfix as a relay to forward all messages to the AWS > SES mail service. > > SES bounces some messages with the following error: > > status=bounced (host email-smtp.eu-west-1.amazonaws.com[52.48.248.62] > said: 554 Transaction failed: Duplicate header 'MIME-Version'. (in reply > to end of DATA command)) > > These messages are sent by a scanner and I have no influence on the > scanner configuration. > > Is there a way to remove the duplicate header in Postfix? No. You can use a Milter to count MIME-Version headers and then delete the duplicate ones. Milters can be implemented in Perl or Python, but it is an extra thing to care for and feed. Whether this breaks signatures depends on how/when mail is signed. > Alternatively, is it possible to remove the MIME-Version header(s) > altogether? Would this break the message (or the mail client from the > recipient)? You can remove all MIME-Version headers with the header_checks IGNORE action (header_checks has no counter). But that will almost certainly break signed messages (DKIM/DMARC). > > Thank you, > > Lucas