-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
outgoing IP per domain #245
base: master
Are you sure you want to change the base?
Conversation
outgoing ip addresses separated by ';'
for outgoing ip addresses
because this is for outgoing mail we have to lookup the senders IP. I think this should be taken from the AUTH of the user who logged in to send this message.
last fix was in the wrong line
You are planning that you can put a list of IPs? Or how do you manage ipv4 and ipv6? |
The easiest solution would be to have just one additional field in the 'domains' table and put a semicolon separated list of IPs there. This way we can have mix of IPv4 and IPv6 in this field and can use it 'as is' in the transport like Maybe the WebUI could be more complex if we like to check/sanitize the values on input or split ddresses in separate fields - but to me, one field would be enough. I wouldn't do checks on every mail in exim. |
bash script for checking if vexim outgoing ips exists in systems network config
checks the out-IPs from the vexim domains table if they are configured on any systems network interface
check if an ip address has valid syntax using ipv6calc
This is on my production servers for 2 weeks without issues, IPv4/v6 dual stack. The only part missing here is the transports.
added to following files: |
Let's wait for the 2.4 milestone when the new webinterface is planned. Though it seems very far away. |
i think that we can have the actual changes earlier and do the webUI later. Having different IPs per domain is a good feature. Besides from IPv6 it makes it easier getting mails through spam filters at gmail and others - eg if some domains on a server are sending bulk mails, newsletters,... it's better other mail is going out over a different IP. |
I asked the debian packagers to integrate the code for the transports in their package: |
merge master
A rework of this PR makes sense since Debian has integrated this in the default configs now. I did use the variable OUTGOING_IP_ADDRESSES. Debian uses REMOTE_SMTP_INTERFACE. That's the only difference. We only really need the changes in the DB and a config setting to read the IP from the database like:
|
How does the smtp transport know which ip to use (or is this already hidden somewhere)? You just add all of the ip addresses:
https://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_smtp_transport.html |
In Debian split config its in transport/30_exim4-config_remote_smtp
My code from above #245 (comment) does set the variable REMOTE_SMTP_INTERFACE from the DB-query or a default value. |
After reading your comment again, I'm not sure I did understand your question right. Maybe my answer was not sufficient. If multiple IPs are given in REMOTE_SMTP_INTERFACE, Exim will try each until it finds one that is sufficient. Eg if the connection is IPv4 and the first addresses given are IPv6 it will skip it. At least it works like that on my production sever for several years now. |
this is still missing the part for the webUI.
But i want to discuss if this is going in the right direction.
#30