Environment: Exim 4.51 on RedHat Enterprise Linux 3 on a Dell 1550 server.

Synopsis: Data from an LDAP lookup remains in the address_data variable, even after a subsequent LDAP lookup fails.

Details: When testing my mail forwarding router, I discovered that if a user specifies a bad local forwarding address in their LDAP record, incoming mail just gets delivered to the original recipient and no error message is generated. Here's how it happens: On the first pass through the routers, the recipient's data is retrieved from LDAP by a router which stores it in address_data and then declines so that the following routers can process it. This data includes, among other things, their mail directory and forwarding address, if set. These data items are extracted and used by subsequent routers, including my forwarding (redirect) router. If the user has specified a local forwarding address, a second pass through the routers begins. If the specified forwarding address is invalid, the LDAP lookup will fail, but the address_data variable is not cleared. My forwarding router uses the original address_data and redirects the mail to the bad address a second time. On the third pass through the routers, the LDAP lookup fails again, but the forwarding router detects the loop and declines. My local delivery router then uses the mail directory data from the original LDAP lookup and stores the message in the original recipients directory. No forwarding gets done, no error gets generated, nothing.

Solution: Clearing the old data out of address_data when a lookup fails seems to be the obvious fix, but I can see that this change in behaviour might impact other sites. Another option would be to add a new option to the redirect router to explicitly clear the address_data variable before starting another pass through the routers. Also, I suppose I could put a new router directly before the one that does the LDAP lookup, which would just clear the address_data and then decline.

Questions: Is this a bug / mis-feature in address_data handling? Has the handling of address_data changed recently? - I would have sworn this worked in a previous 4.x version of Exim. Is there a better way to process mail forwarding?

Russ

--
Russell D. Wilton                     E Mail: [EMAIL PROTECTED]
Internet Services Manager              Voice:  (403) 329-2525
University of Lethbridge                 FAX:  (403) 382-7108
4401 University Drive   Lethbridge, Alberta, CANADA   T1K 3M4


--
## List details at http://www.exim.org/mailman/listinfo/exim-users ## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/

Reply via email to