postalserver / postal

📮 A fully featured open source mail delivery platform for incoming & outgoing e-mail

Home Page:https://postalserver.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Postal with IPv6 breaks Rspamd

amplitudesxd opened this issue · comments

Describe the bug

When Postal receives a message over IPv4 when running on an IPv6 system, ::ffff: is appended to the start of the IPv4 address in the Received header, this breaks the integration with Rspamd.

As Rspamd is unable to parse it, it flags the email due to the HFILTER_HOSTNAME_UNKNOWN filter, causing it to be marked as spam by Postal.

To Reproduce

  1. Setup Postal on an IPv6-enabled server
  2. Setup Rspamd within Postal
  3. Send an email over IPv4

Expected behaviour

I expect Postal to work with Rspamd.

Additional information/context

I'm not too sure the best way to work around this, simply removing the ::ffff: prefix from the IP in the Received header seems to fix it, which could be a possible solution.

Fixed in 0dc7359