Hello, dovecot-1.1.7 on FreeBSD 7.1. Usernames have dot in them (like uname.example for a user in example.com). in dovecot.conf I have: mail_location: maildir:/userhomes/maildirs/%d/%n/Maildir and for authentication: username_format: %Ln In the client, tried with CONE and Mail.app, I put the username as: uname.example at example.com So, the authentication works fine, as it extracts the uname.example from the uname.example at example.com supplied. The mail_location does not: Apr 27 17:21:26 drum dovecot: imap-login: Login: user=<uname.example>, method=PLAIN, rip=88.149.183.86, lip=88.149.202.106, TLS Apr 27 17:21:26 drum dovecot: IMAP(name.example): Effective uid=1301, gid=1301, userhomes=/userhomes/example.com/uname Apr 27 17:21:26 drum dovecot: IMAP(uname.example): Namespace: type=private, prefix=INBOX., sep=., inbox=yes, hidden=no, list=yes, subscriptions=yes Apr 27 17:21:26 drum dovecot: IMAP(uname.example): maildir: data=/ userhomes/maildirs//uname.example/Maildir Apr 27 17:21:26 drum dovecot: IMAP(uname.example): maildir++: root=/ userhomes/maildirs//uname.example/Maildir, index=, control=, inbox=/ userhomes/maildirs//uname.example/Maildir it looks like the %d expands to the empty string. Could this be due to the "." in the username? Thanks Giuliano
On Mon, 2009-04-27 at 17:31 +0200, Giuliano Gavazzi wrote:> and for authentication: > > username_format: %LnThis drops the domain part entirely, so after processing this %d will return empty. If you don't want it, try to figure out another way to do this. You didn't say what passdb you're using, so I can't give an example. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20090427/9a458b47/attachment-0002.bin>
On M 27 Apr, 2009, at 20:31 , Timo Sirainen wrote:> On Mon, 2009-04-27 at 17:31 +0200, Giuliano Gavazzi wrote: >> and for authentication: >> >> username_format: %Ln > > This drops the domain part entirely, so after processing this %d will > return empty. If you don't want it, try to figure out another way to > do > this. You didn't say what passdb you're using, so I can't give an > example. >Ah, do you mean that the following: # Username formatting before it's looked up from databases. You can use # the standard variables here, eg. %Lu would lowercase the username, %n would # drop away the domain if it was given, or "%n-AT-%d" would change the '@' into # "-AT-". This translation is done after auth_username_translation changes. auth_username_format = %Ln actually changes the username supplied, not just for database lookups (including the system passwd that I use), but also for subsequent uses that do not involve any more lookups (like in the mail_location). I think this should be specified clearly (might be somewhere, I haven't read the whole documentation). I do not see, but I must be mistaken, why the supplied credentials are not left alone, and the transformed value only used for the lookups. As it is some variables will have little use outside of database lookups! For me it's not a big deal, as was trying this only to give a different layout to users' mailboxes. Thanks Giuliano
giuliano wrote:> > Hello, dovecot-1.1.7 on FreeBSD 7.1. > Usernames have dot in them (like uname.example for a user in > example.com). >I see the same happen on Ubuntu Linux 8.04LTS, Dovecot 1.0.5. Config is given below. %u is expanded on the password_query, but not with the user_query, according to the mysql query log. roy # 1.0.15: /etc/dovecot/dovecot.conf log_path: /var/log/dovecot/dovecot.log log_timestamp: %Y-%m-%d %H:%M:%S disable_plaintext_auth: no verbose_ssl: yes login_dir: /var/run/dovecot/login login_executable: /usr/lib/dovecot/imap-login verbose_proctitle: yes mail_privileged_group: mail mail_location: maildir:/var/spool/dovecot/%d/%n auth default: default_realm: eventchief.com verbose: yes debug: yes passdb: driver: sql args: /etc/dovecot/dovecot-sql.conf userdb: driver: sql args: /etc/dovecot/dovecot-sql.conf -- View this message in context: http://www.nabble.com/-d-does-not-expand-to-domain-tp23258935p23638225.html Sent from the Dovecot mailing list archive at Nabble.com.