[Dovecot] Port variable in LMTP userdb lookups?
Hi all,
I'm currently changing some systems to use the redirector service, which means that to get local deliveries going I need to get lmtp set up so it can be redirected as well. This is working fine, however we have a number of different ports running on our servers depending on which brand a customer is using. When the time comes to do the user look up, we use (port, user, domain) to do a unique database lookup which works fine for everything (proxied pop, imap, lmtp & straight pop, imap) but not straight lmtp - perhaps because it doesn't have a 2-stage login process unlike the pop/imap protocols. Looking at the SQL query we are issuing, the %a port variable is set to 0 even though the connection is coming in from TCP. Is there a way to change this? We are running dovecot 2.0.12 however looking through the changelogs I can't see this would be fixed in the newest version.
Thanks,
Mark
On Thu, 2011-10-20 at 12:38 +0300, Mark Zealey wrote:
I'm currently changing some systems to use the redirector service, which means that to get local deliveries going I need to get lmtp set up so it can be redirected as well. This is working fine, however we have a number of different ports running on our servers depending on which brand a customer is using. When the time comes to do the user look up, we use (port, user, domain) to do a unique database lookup which works fine for everything (proxied pop, imap, lmtp & straight pop, imap) but not straight lmtp - perhaps because it doesn't have a 2-stage login process unlike the pop/imap protocols. Looking at the SQL query we are issuing, the %a port variable is set to 0 even though the connection is coming in from TCP. Is there a way to change this? We are running dovecot 2.0.12 however looking through the changelogs I can't see this would be fixed in the newest version.
A quick check in code shows that this is already supposed to work. Set auth_debug=yes and see if LMTP's auth lookup sends lip, rip, lport and rport fields to auth process?
04-11-2011 23:56, Timo Sirainen yazmış:
On Thu, 2011-10-20 at 12:38 +0300, Mark Zealey wrote:
I'm currently changing some systems to use the redirector service, which means that to get local deliveries going I need to get lmtp set up so it can be redirected as well. This is working fine, however we have a number of different ports running on our servers depending on which brand a customer is using. When the time comes to do the user look up, we use (port, user, domain) to do a unique database lookup which works fine for everything (proxied pop, imap, lmtp& straight pop, imap) but not straight lmtp - perhaps because it doesn't have a 2-stage login process unlike the pop/imap protocols. Looking at the SQL query we are issuing, the %a port variable is set to 0 even though the connection is coming in from TCP. Is there a way to change this? We are running dovecot 2.0.12 however looking through the changelogs I can't see this would be fixed in the newest version. A quick check in code shows that this is already supposed to work. Set auth_debug=yes and see if LMTP's auth lookup sends lip, rip, lport and rport fields to auth process?
From my reading of the code in 2.0.15, you pass the local & remote IP in lmtp/commands.c:427 but the struct mail_storage_service_input only has remote_ip and local_ip fields, not port fields (unlike the auth_user_info struct which has both ip's and port entries as well). I think that the mail_storage_service_input struct needs the uint local_port, remote_port fields adding in & appropriate code changes to pass these through?
Mark
On Mon, 2011-11-07 at 13:23 +0200, Mark Zealey wrote:
04-11-2011 23:56, Timo Sirainen yazmış: From my reading of the code in 2.0.15, you pass the local & remote IP in lmtp/commands.c:427 but the struct mail_storage_service_input only has remote_ip and local_ip fields, not port fields (unlike the auth_user_info struct which has both ip's and port entries as well). I think that the mail_storage_service_input struct needs the uint local_port, remote_port fields adding in & appropriate code changes to pass these through?
Yeah, you're right, I missed that one. Added to hg now.
Thanks so much for that have tested in 2.0.16 release now and is working fine.
Mark
From: Timo Sirainen [tss@iki.fi] Sent: 16 November 2011 18:25 To: Mark Zealey Cc: Dovecot Mailing List Subject: Re: [Dovecot] Port variable in LMTP userdb lookups?
On Mon, 2011-11-07 at 13:23 +0200, Mark Zealey wrote:
04-11-2011 23:56, Timo Sirainen yazmış: From my reading of the code in 2.0.15, you pass the local & remote IP in lmtp/commands.c:427 but the struct mail_storage_service_input only has remote_ip and local_ip fields, not port fields (unlike the auth_user_info struct which has both ip's and port entries as well). I think that the mail_storage_service_input struct needs the uint local_port, remote_port fields adding in & appropriate code changes to pass these through?
Yeah, you're right, I missed that one. Added to hg now.
participants (3)
-
Mark Zealey
-
Mark Zealey
-
Timo Sirainen