Hello,
okay so, I am currently trying to get CipherMail to work with rspamd and having Problems with the Milter execution order and CipherMails decryption Milter.
When an E-Mail arrives from the Internet, it should go this route:
Internet → Firewall → Postfix → CipherMail Decryption Milter → rspamd Milter → Postfix → Mail Server
When an E-Mail gets send by an internal user, it should go this route:
Mail Server → Postfix → rspamd Milter → CipherMail Content-Scanner → Postfix → Firewall → Internet
In both cases, the bold and italiacs text is the CipherMail Gateway Server.
As you can see, my general Plan is it, to have just one Gateway Server, which uses both CipherMail to Encrypt and Decrypt Mails and apply DKIM and rspamd to scan them for spam and viruses.
Now, if rspamd rejects a message, I want the Postfix Server to answer with a SMTP 500 or 400 response code to the originating Server. But if a message is encrypted, it needs to be decrypted before the scan, so it has to go through CipherMail first.
The Problem with that is, that, as far as my understanding goes, Content-Scanners are not able to reject Mails with an SMTP respose code. Instead they have to use a bounce message, which is less than ideal. Additionally Milters always go before Content-Scanners. That means, that for incomming messages rspamd runs before CipherMail, which is less than ideal as well.
I read here, that there is a decryption only Milter from CipherMail for exactly this case, but how do I implement it? I’ve found no documentation about the Milter besides of this one paragraph I just linked.
Another Problem is the Milter Order. So far I haven’t found out, how to specifiy the order Milters run in. Also, I should Probably skip the CipherMail Content-Scanner for incomming Mails, since they get served by the decryption Milter… so thats also something I’ve to figure out. But one thing after another:
first, how do I implement the CipherMail decryption Milter?
after that, how can I tell Postfix the order for the Milters?
and finally, how can I tell Postfix to bypass the Content-Scanner for outgoing Mails?
And yes, the latter 2 questions are probably for Postfix and not for CipherMail, so the first one is the important one.