I have a work-in-progress guide for folks wanting to host their own email servers which provides a step-by-step process for taking a Debian (or Ubuntu) server and building out a secure install of Postfix and Dovecot to provide TLS 1.2/PFS enabled SMTP, IMAP, and webmail services along with competent spam filtering with low false-positive rate and all the required DNS and other settings to ensure your mail is accepted by GMail and the like.
I've never really posted it up, but I feel like if you've read this article and are wanting more, this might help you. It's work-in-progress because I've been sidetracked from finishing the Client piece and also creating a Dockerfile that generates a group of self-contained images configured as recommended, but all the steps for the server are complete and tested.
I am the author of http://gogs.info/books/debian-mail/chunked/ and I am working on something similar (I have switched to Dovecot and wrote a nice GUI for managing users and domain) but in the end it will be a set of Ansible scripts.
The things I did different:
* Amavisd-new instead of dspam and OpenDKIM
* SQLGrey instead of Postgrey
* unbound instead of BIND as a caching DNS server
I have been thinking on adding PolicyD for rate limiting accounts but then I get a lot of overlap with other services. How are you satisfied with postfwd?
Nice, I hadn't seen that book before but am glad to see there's some more detailed documentation out there on this subject. Setting up an email server can be pretty confusing even for someone who's experienced just because there's so many moving parts and its very finicky.
I haven't really worked with Amavisd, SQLGrey, or PolicyD before. I've now switched to using unbound instead of BIND myself, but this hasn't yet been reflected in my instructions since I kind of stalled on updating them.
I like postfwd quite a bit for how I'm using it, which is to do hybrid greylisting based on DNSBL weighting. It allows me to reduce latency for inbound messages that are free and clear rather than greylisting everything. I don't really do any rate limiting or anything like that with it though, so I doubt I'm using enough of it to really form a clear opinion.
I haven't tried it, honestly, but I'd imagine it'd work fine. The SQL usage there isn't very complex, so I'm pretty sure the syntax would even be exactly the same between the two for the few things I'm using it for. There is some difference in the connection strings though. It looks like Gentoo has some good docs on this in their Wiki at https://wiki.gentoo.org/wiki/Complete_Virtual_Mail_Server/Po...
Good luck, let me know how it goes, and I'm happy to accept a pull request to add additional instructions for Postgres if you feel up to adding them.
I've never really posted it up, but I feel like if you've read this article and are wanting more, this might help you. It's work-in-progress because I've been sidetracked from finishing the Client piece and also creating a Dockerfile that generates a group of self-contained images configured as recommended, but all the steps for the server are complete and tested.
You can find it at http://securemail.tristor.ro/#!index.md It's all written in Markdown and I accept pull requests at https://github.com/Tristor/securemail.tristor.ro
Hope that anyone in the process of setting up a mail server finds this helpful.