[pmg-devel] Headers contain illegal BOM

José Manuel Giner jm at ginernet.com
Wed Oct 9 14:04:56 CEST 2019

Ok, I found the problem. Is not a PMG related issue.

The issue: We include in cPanel mail headers the "X-Ham-Report" wich 
includes a "message preview" content that in some cases includes the BOM 
characters. (It especially happens when it is a conversation of many 
chained messages, caused by the different encodings of the e-mail clients.)

To fix:
In PMG we edited: /etc/pmg/templates/main.cf.in
to include this line:

smtp_header_checks = regexp:/etc/postfix/header_check

And edited: /etc/postfix/header_check
to include this line:

/^(.*)(.*)/ REPLACE ${1}UTF-8_BOM${2}

Reloading config: /etc/init.d/postfix reload

Now, for every e-mail relayed by PMG, the string in headers: 
will be replaced by: UTF-8_BOM

Seems is working...

Maybe we'll find a problem with this in the future?


On 09/10/2019 12:16, José Manuel Giner wrote:
> Hello, we use PMG as relay smarthost of our cPanel servers. This way we 
> block outgoing SPAM. But in addition, we also have configured a 
> smarthost in the PMG to analyze with a SpamExperts relay.
> This would be the scheme:
> Sender -> PMG -> SpamExperts -> Recipient
> The problem we have, is that for a few weeks now, some mails are 
> rejected by Spamexperts and the reason is:
> Headers contain illegal BOM
> We have configured PMG to send a copy to another mailbox and thus be 
> able to analyze the headers of the mails that give problems and 
> effectively, we see in the headers the characters of Byte Order Mark (BOM)
> Especially in the header "Content preview"
> Coincidentally this is happening to us since we have upgraded to PMG v6, 
> with PMG v5 it has never happened to us before...
> Can it be a problem in PMG v6 ?
> Is there an option in Proxmox to remove BOM characters from emails 
> before sending them?
> Any idea how to fix it?
> Thanks!

José Manuel Giner

More information about the pmg-devel mailing list