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.

  • TFO Winder@lemmy.ml
    link
    fedilink
    English
    arrow-up
    7
    ·
    1 month ago

    I have heard people have successfully utilised Mailcow without any issues for many years.

    Personally gave it a try once but setting up ports, firewalls, virus scans, anti spams, dns felt too much effort for what I was going to use it for

    • nixx@lemmy.ca
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 month ago

      I second Mailcow. I use it on a residential IP and have a smarthost for relaying in/out since my isp blocks port 25.

      For relay, I use mxroute.com, I have a lifetime account and Mailcow has a fetchmail option.

    • ikidd@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 month ago

      Using Mailcow for years now, love it, but I don’t think it checks the custom scripts box of OP. Since it’s all containers, you’d have to do some custom bind mounts to hook the underlying containers and keep the scripts, which might have some unintentional consequences depending on the upgrade.

  • Theoriginalthon@lemmy.world
    link
    fedilink
    English
    arrow-up
    6
    ·
    1 month ago

    Postfix and write a milter (mail filter), you can get them to interact a various points in the mail delivery.

    I think most things can be accomplished within postfix

  • aksdb@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    1 month ago

    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.

  • InverseParallax@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 month ago

    Ran the stack manually for decades, but spam makes it harder.

    Run mailinabox now, it takes care of everything pretty well.

  • Lyricism6055@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    arrow-down
    1
    ·
    1 month ago

    I definitely don’t suggest self hosting email unless you don’t care about losing messages occasionally