I have a debian 10 server and I want to forward all mails from root to an ordinary email-address but encrypt them with gpg beforehand. Here on Stackexchange I found a solution with procmail, but after digging into it, I am not sure if that solution is the one for 2020 since procmail not recommended at all these days.

Does anybody know how to achieve it? On my debian server there is mailutils installed automatically, but I was not able to figure out if it is possible with one of the tools from it.

Thanks for any hint.

p.s. This is the question and answer from 2011 with procmail: How to automatically encrypt, sign, and forward root's email?


For the quite simple use-case you're describing, I think Procmail may be a little overkill. You should be able to do the same thing from a .forward file ( which in some cases can be also used to trigger procmail ).

If you have a command to do the encryption and forwarding of the mail, then you should be able to trigger that command using dotforward with a 'pipe' ( command ).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.