I tried maybe 15 years ago and it went about as well as you’d expect for back then. But I’m starting to get the itch again.

Have any of you tried relatively recently? How impossible is it to get reliable deliverability to gmail and whatnot these days?

  • nitrolife@rekabu.ru
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    22 hours ago

    But in reality, this will only allow you to receive incoming mail. In order for outgoing mail to work, it is necessary that the mail server and all the strapping go through the VPS to the Internet. This requires a rather complicated configuration of iptables, and I recommend that you simply either fill up the mailer on a VPS (there will be a maximum of gigabytes of mail. it’s not that heavy), or buy a static address at home.

    If you still decide to go the hard way, here’s an approximate plan for what you need to do in the spirit of iptables, because setting it up in firewalld is a real torment.:

    *mangle
    :PREROUTING ACCEPT [0:0]
    :INPUT ACCEPT [0:0]
    :FORWARD ACCEPT [0:0]
    :OUTPUT ACCEPT [0:0]
    :POSTROUTING ACCEPT [0:0]
    -A OUTPUT -m owner --uid-owner 924 -j MARK --set-mark 0x300
    COMMIT
    

    where 924 is the postfix user ID, you may have a different number. check it out

    ip route add default via 10.8.12.4 dev wg0 table 100
    

    adding the default route via the VPS address to the routing table 100. replace 10.8.12.4 with the address of your VPS and wg0 with the name of the interface for communication between the VPS and home. Then

    ip rule add from all fwmark 0x300 lookup 100
    

    We are sending all packets with the label 0x300 to the routing table 100. In other words, the postfix user will have his own custom routing table via VPS.

    This creates several problems due to the fact that with this configuration, it may not be possible to connect to postfix via your server’s interfaces. But in basic case all will work. Bypassing this problem will create even more complex routing rules and will generally be overkill. But if you’re interested, write to me and I’ll sign it.