Is it possible to assign a static IPv6 address to my Hestia instance and use it specifically for SMTP?
The server already has a static IPv4 address that I currently use for DNS, web hosting and mail services. I understand that IPv6 isn’t fully supported across the platform yet, but I’m wondering if it could still be configured just for SMTP.
The reason I’m asking is because I have several hosts that are IPv6 only and need to send alert emails via SMTP. If this setup is possible, Id appreciate any guidance on what steps would be required to configure it.
By default, Exim uses the file /home/USER/conf/mail/DOMAIN/ip to set the outgoing IP address. However, if you add the IPv6 address there, it will be overwritten during rebuilds.
Instead, you should configure Exim to use a different file, for example /home/USER/conf/mail/DOMAIN/ipv6. You must create this file manually and add the IPv6 address you want to use. The file must not contain any carriage return characters.
Edit /etc/exim4/exim4.conf.template and:
1.- Enable IPv6 commenting out disable_ipv6 directive:
#disable_ipv6 = true
2.- Modify the way Exim determines the outgoing IP address as follows:
If the file /home/USER/conf/mail/DOMAIN/ipv6 exists, Exim should use the IPv6 address defined in that file. If the file does not exist, Exim should fall back to /home/USER/conf/mail/DOMAIN/ip and use the IPv4 address defined there.
Of course, you must configure the PTR record for that IPv6 address so that it resolves to the hostname used by Exim. Your domains must also have the correct DNS records configured, including a valid AAAA record, a proper MX record, and a correctly defined SPF record that includes the IPv6 address, etc.. Additionally, you must ensure that the appropriate ip6tables rules are in place to allow inbound and outbound traffic on the required SMTP ports, etc.