huan / docker-simple-mail-forwarder

Simplest and Smallest Email Forward Service based on Docker.
https://hub.docker.com/r/zixia/simple-mail-forwarder/
Apache License 2.0
544 stars 88 forks source link

Strips sender details (IP, client, user agent) when sending #91

Closed dgraziotin closed 3 years ago

dgraziotin commented 3 years ago

This PR enables, when the env variable SMF_SENDERPRIVACY is defined, stripping of headers related to the sender, when SMF is used to send e-mails (outgoing e-mail).

In particular, IP, client, and user agent will be removed, but only from the first Received instance, for sending.

The first Received: header (the one below) will be rewritten as so:

Received: from smfdomain.com ( smfdomain.com [123.123.123.123])
    (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))
    (No client certificate requested)
    by mail-tester.com (Postfix) with ESMTPS id XXX
Received: from 127.0.0.1 (localhost [127.0.0.1])
    by smfdomain.com (Postfix) with ESMTPSA id XXX

where smfdomain.com is SMF rDNS entry. In other words, only SMF IP address will be visible to the receiver but not the client (home) IP address.

dgraziotin commented 3 years ago

@huan sorry for not telling in advance. I needed this feature so I simply went and implemented it. What do you think?

huan commented 3 years ago

I think this feature is useful in some scenarios, thanks for adding it!

Could you please invite someone to review your code and approve it for us?

It will be enough confidence for me after at least one approvement and I'll be very happy to merge it then!

BTW: Please also bump the patch version number in the VERSION file in the root, it will be used when publishing docker images as its version number.

dgraziotin commented 3 years ago

Well, I know that @petslane likely uses SMF for sending. Otherwise I do not know the community here, sorry!

petslane commented 3 years ago

LGTM

huan commented 3 years ago

@dgraziotin Thank you very much for add this new feature to SMF! @petslane Thank you very much for review the PR and approve it!

SMF growth in recent years based on pure community efforts, without helps from the community the SMF can not move forward like this. appreciate!

dgraziotin commented 3 years ago

@huan thank YOU for this awesome image.