Mark Constable writes:
On 20/04/12 13:36, Sam Varshavchik wrote: > Yes, well, it's really more than just that. I now understand > what's going on here, and there's a bit more stuff here in play. > You can listen on multiple IPs just fine. What also needs to be > done is also to save which IP address each message was received > from, and then use that IP address in case that message ever > goes out via SMTP again, in addition to using an IP > address-specific configuration.Perhaps if SOURCE_ADDRESS is a single IP then it behaves as it does now and sends all outgoing traffic via the interface associated with that IP. If... SOURCE_ADDRESS = 0.0.0.0 SOURCE_ADDRESS = xx.xx.xx.xx/24 SOURCE_ADDRESS = xx.xx.xx.1, xx.xx.xx.2, xx.xx.xx.3 AND the incoming connection is authenticated then Courier looks for one single extra bit of information in the message stored in the mailq for the IP associated with the incoming SMTP connection.
Nah, SOURCE_ADDRESS is not a good fit for this. This doesn't really involve authentication. You do need to authenticate client connections, separately, aside from this. But saving the IP address the message was received at needs to be done independently from that. Because, to behave as if an IP address is a separate server instance, that's not really tied to whether authentication took place. You must authenticate in order to accept mail for relaying, of course, but it's not really tied into that.
I think I have this mostly working. The way it's going to work is to have new configuration files named "ipout.[address]", like "ipout.192.168.0.1". If this file exists for an IP address matching the one a message was received at, Courier will bind to the IP address when sending the message. Each file needs to be either empty, or contain an IP address, and the IP address in the file gets used instead of the one in its filename. If "ipout. [address]" does not exist, "ipout" gets used instead. Having an "ipout" with an IP address is a replacement for SOURCE_ADDRESS. I'll keep the code that uses SOURCE_ADDRESS for now, to make upgrading less painful, but after upgrading it should be removed and replaced with an "ipout" file. And, in absence of any ipout file, outbound sockets are not bound to any IP address, and will use the system's routing table for that.
"ip6out.[address]" and "ip6out" will also handle the IPv6 side, and replace SOURCE_ADDRESS_IPV6. This will do the right thing if there are both an IPv4 and an IPv6 address assigned to the virtual host, and allow messages received at the IPv4 address go out from the IPv6 address to IPv6 destinations, and vice versa.
The existing configuration files will also be read from {name}.[address] if they exist, instead of {name}. So, "me.192.168.0.1" sets the hostname Courier uses for that IP address. This does make it easier to shoot yourself in the foot, though. Whatever you put in there, you also better put in "locals" or "hosteddomains" as well.
pgpZnqy6nC0gI.pgp
Description: PGP signature
------------------------------------------------------------------------------ For Developers, A Lot Can Happen In A Second. Boundary is the first to Know...and Tell You. Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________ courier-users mailing list courier-users@lists.sourceforge.net Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users