[Dovecot] pop/imap login logging only username part of full email address
I have my login log format set like so:
login_log_format_elements = user=<%u> method=%m rip=%r lip=%l %c
When I log in using a full email address, though, I only get the username part of the address:
Jan 24 13:28:29 node7 dovecot: pop3-login: Login: user=<justin>, method=PLAIN, rip=137.118.2.60, lip=137.118.7.247 Jan 24 13:28:30 node7 dovecot: POP3(justin): Disconnected: Logged out top=0/0, retr=0/0, del=0/717, size=15797460
Is that behavior intentional? If so, can it log the full username as given by the client instead? Anyone with multiple domains probably wants to see the domain part. Changing %u to %n yields the same log entry, and %d seems to be empty so nothing gets logged if I try to log that.
On Wed, 2007-01-24 at 13:51 -0500, Justin McAleer wrote:
I have my login log format set like so:
login_log_format_elements = user=<%u> method=%m rip=%r lip=%l %c
When I log in using a full email address, though, I only get the username part of the address:
It means dovecot-auth has stripped the domain from the username. Typically the problem has been with SQL queries where you have user and domain in separate fields:
password_query = select user, password from .. where user = '%n' and domain = '%d'
Because you're returning here "user" field, Dovecot changes the username to that. So either remove the user field, or change it to eg. "concat(user, '@', domain) as user" (to preserve the casing).
Timo Sirainen wrote:
It means dovecot-auth has stripped the domain from the username. Typically the problem has been with SQL queries where you have user and domain in separate fields:
password_query = select user, password from .. where user = '%n' and domain = '%d'
Because you're returning here "user" field, Dovecot changes the username to that. So either remove the user field, or change it to eg. "concat(user, '@', domain) as user" (to preserve the casing).
Doh! Of course... sorry to bother you with that. Actually, I was wondering what I was going to do about users logging in with email aliases, and this solves that problem.
participants (2)
-
Justin McAleer
-
Timo Sirainen