Hi,
I would like to host my own email server.
I know the pros and cons of doing so, please do not post about the advantage or disadvantage, there is others open topics for it.
I would like my setup fit those “requirements”
- FLOSS
- Be able to create complex rules for incoming/outgoing email ( with 🐍 Python language preferably ).
- based on any properties (subject, ip, header, size, attachment, signed, encrypted, etc… )
- able to modify, delete, fw, etc… the email
- Manage the limit of sending by size and number of outgoing over time (min, hours, week, etc…)
If you know a matrix comparison between email servers I’m all ears.
If you have any feedback with a solution this is most welcome too.
I plan to update this post to create a matrix/spreadsheet of all the solutions that I’ll gather.
Thanks.
Use Stalwart as mailserver. Besides coming with sane defaults, it allows to put hooks into almost every mail stage. Those hooks can be sieve scripts, local binaries or http calls.
See my personal notes. I do selfhost mail server, but on a vps to have a good IP
Being doing so for 20+ years and recently rebuilt the entire stack.
See https://wiki.gardiol.org/doku.php?id=email%3Astart
In short, I use postfix+dovecot, with opendmark and opendkim. Setup proper DNS email specific records and a few more steps.
Overall it runs fast and perfect on 4gb ram very old dual core atom CPU.
Too lazy to read wiki link, but I too postfix/dovecot
Ran the stack manually for decades, but spam makes it harder.
Run mailinabox now, it takes care of everything pretty well.
I definitely don’t suggest self hosting email unless you don’t care about losing messages occasionally