-
Notifications
You must be signed in to change notification settings - Fork 54
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
Seemingly an issue with how InternalHosts work.. #231
Comments
Are you sure reloading (sending SIGUSR1) or restarting opendkim milter after changing InternalHosts file?
The check for "internal" by InternalHosts and "peer" by PeerList is perfomed against a hostname and an IP address where were passed from MTA (in connection phase (c.f. milter protocol overview, |
Hello, thanks for the fast reply. Yes, i reloaded both postfix and opendkim (multiple times) after making the changes. When that didnt work i restarted the entire server. Still no change.
As you can see from the example log, it is not successfull in looking up the hostname, these servers are not in DNS. (Ip address in brackets then ip address again without brackets). I verified this with If opendkim doesnt read the domain from header then i dont understand why setting the domain in TrustedHosts works. And i still am no closer in understanding why setting the ip ranges didnt accomplish anything. |
I tried to reproduce it with opendkim on my branch (https://github.com/futatuki/OpenDKIM/tree/main) but it cannot. I've use miltertest(8) and test lua script brought and modified from opendkim/tests/t-sign-rs.lua, for emulating MTA accepting connection from 192.168.5.33 and 192.168.3.22. In the directory /opt/opendkim-issue-231,
TrustedHosts:
t-issue-231-internal.lua:
t-issue-231-non-internal.lua:
maillog on
maillog on
It seems the milter judged 192.168.5.33 is not 'internal' and 192.168.3.22 is 'internal'.
If the client IP address was resolved to valid hostname and forward lookup for the hostname returns client IP address, MTA passes the hostname to milters.
At least, it works in my testing environment. So it seems there is something we overlook. |
I added three subnets for some new servers that are sending mail, but openDkim failed to recognize them as internal.
The subnets were added in CIDR form, like 192.168.0.1/24 and the same for .2 and .3.
I have other subnets added that works this way, but these subnets did.
I read the docs on InternalHosts (and by reference, PeerList) and decided to try to add the domain, and to my confusion that worked.
The servers are not in DNS so i guess openDKIM parses the from address in header of mail to look up the domain?
This is not explained in detail in the docs (at least not that i could find), and i was not able to understand the source code.
And it doesnt really explain why it wont recognize the new ip ranges as internal either..
So i guess what im claiming is that the ip range (cidr notation) doesnt always work, or i did something wrong and i dont understand what.
Details:
opendkim.conf:
(example)TrustedHosts:
postfix conf:
example mail not signed:
The text was updated successfully, but these errors were encountered: