r-raymond / nixos-mailserver

A complete and Simple Nixos Mailserver
GNU General Public License v3.0
181 stars 27 forks source link

Added header filtering for removing sensitive information. #15

Closed phdoerfler closed 7 years ago

phdoerfler commented 7 years ago

This adds header filtering which essentially gets rid of the user's mail client's identification as well as the user's IP address etc. I was not able to have the file placed in /etc/postfix, so I went for /etc/postfixsupport.

eqyiel commented 7 years ago

Hey @phdoerfler, I think this is a good idea but there's no need to place this in /etc, you can use pkgs.writeText and source the file from the store:

https://github.com/eqyiel/deployments/blob/master/realms/tsumugi.rkm.id.au/mail-server.nix#L74-L83 https://github.com/eqyiel/deployments/blob/master/realms/tsumugi.rkm.id.au/mail-server.nix#L145-L146

phdoerfler commented 7 years ago

@eqyiel that's a great idea, thanks!

phdoerfler commented 7 years ago

@eqyiel Is there any specific reason you also test for header fields that contain whitespace before the field name?

r-raymond commented 7 years ago

All tests pass.

I'll try to write a test to ensure that this information is not included as soon as I find some time.

eqyiel commented 7 years ago

@phdoerfler no specfic reason other than that I copied riseup's example verbatim: https://we.riseup.net/debian/mail 😅

r-raymond commented 7 years ago

I added a test that ensures that the sender IP address is not in the email header anymore.