[Dovecot] %d is empty

rihad rihad at mail.ru
Mon Sep 22 21:17:11 EEST 2008


Timo Sirainen wrote:
> On Sat, 2008-09-20 at 13:44 +0500, rihad wrote:
>> user rihad at bar.com
> ..
>> Further investigation revealed that %u is just rihad and not rihad at bar.com.
>>
>> Any hints?
> 
> You're dropping the domain somewhere. Maybe in auth_username_format? If
> you can't fix it, send your dovecot -n output.
> 
I didn't change much. Here's my dovecot -n:

# 1.1.3: /usr/local/etc/dovecot.conf
protocols: imap imaps pop3 pop3s
ssl_disable: yes
disable_plaintext_auth: no
login_dir: /var/run/dovecot/login
login_executable(default): /usr/local/libexec/dovecot/imap-login
login_executable(imap): /usr/local/libexec/dovecot/imap-login
login_executable(pop3): /usr/local/libexec/dovecot/pop3-login
login_greeting_capability(default): yes
login_greeting_capability(imap): yes
login_greeting_capability(pop3): no
verbose_proctitle: yes
first_valid_uid: 1000
first_valid_gid: 1000
mail_privileged_group: mail
mail_location: mbox:~/mail/:INBOX=/var/mail/%u
maildir_copy_preserve_filename: yes
mail_executable(default): /usr/local/libexec/dovecot/imap
mail_executable(imap): /usr/local/libexec/dovecot/imap
mail_executable(pop3): /usr/local/libexec/dovecot/pop3
mail_plugin_dir(default): /usr/local/lib/dovecot/imap
mail_plugin_dir(imap): /usr/local/lib/dovecot/imap
mail_plugin_dir(pop3): /usr/local/lib/dovecot/pop3
imap_client_workarounds(default): delay-newmail netscape-eoh 
tb-extra-mailbox-sep
imap_client_workarounds(imap): delay-newmail netscape-eoh 
tb-extra-mailbox-sep
imap_client_workarounds(pop3):
pop3_enable_last(default): no
pop3_enable_last(imap): no
pop3_enable_last(pop3): yes
pop3_client_workarounds(default):
pop3_client_workarounds(imap):
pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh
auth default:
   mechanisms: plain login
   username_format: %Ln
   passdb:
     driver: sql
     args: /usr/local/etc/dovecot-sql.conf
   userdb:
     driver: passwd
   userdb:
     driver: static
     args: uid=postfix gid=postfix home=/home/rihad/mail/%d/%n
   socket:
     type: listen
     client:
       path: /var/spool/postfix/private/auth
       mode: 432
       user: postfix
       group: postfix


Here's my diff -u /usr/local/share/examples/dovecot/dovecot.conf 
/usr/local/etc/dovecot.conf:

Basically I turned off ssl, pam, ldap, and turned on static & sql.

--- /usr/local/share/examples/dovecot/dovecot.conf      2008-09-19 
16:47:55.000000000 +0500
+++ /usr/local/etc/dovecot.conf 2008-09-22 23:14:34.000000000 +0500
@@ -85,6 +85,7 @@

  # Disable SSL/TLS support.
  #ssl_disable = no
+ssl_disable = yes

  # PEM encoded X.509 SSL/TLS certificate and private key. They're 
opened before
  # dropping root privileges, so keep the key file unreadable by anyone but
@@ -825,7 +826,7 @@
    # database (passwd usually), you can use static userdb.
    # REMEMBER: You'll need /etc/pam.d/dovecot file created for PAM
    # authentication to actually work. <doc/wiki/PasswordDatabase.PAM.txt>
-  passdb pam {
+#  passdb pam {
      # [session=yes] [setcred=yes] [failure_show_msg=yes]
      # [cache_key=<key>] [<service name>]
      #
@@ -854,8 +855,8 @@
      #   args = session=yes %Ls
      #   args = cache_key=%u dovecot
      #args = dovecot
-    args = session=yes dovecot
-  }
+#    args = session=yes dovecot
+#  }

    # System users (NSS, /etc/passwd, or similiar)
    # In many systems nowadays this uses Name Service Switch, which is
@@ -897,11 +898,11 @@
    #}

    # SQL database <doc/wiki/AuthDatabase.SQL.txt>
-  #passdb sql {
+  passdb sql {
      # Path for SQL configuration file.
      # See /usr/local/share/examples/dovecot/dovecot-sql.conf
-    #args = /usr/local/etc/dovecot-sql.conf
-  #}
+    args = /usr/local/etc/dovecot-sql.conf
+  }

    # LDAP database <doc/wiki/AuthDatabase.LDAP.txt>
    #passdb ldap {
@@ -934,7 +935,7 @@
      # proceses. Useful with remote NSS lookups that may block.
      # NOTE: Be sure to use this setting with nss_ldap or users might get
      # logged in as each others!
-    args = blocking=yes
+#    args = blocking=yes
    }

    # passwd-like file with specified location
@@ -945,7 +946,7 @@
    #}

    # static settings generated from template 
<doc/wiki/UserDatabase.Static.txt>
-  #userdb static {
+  userdb static {
      # Template for the fields. Can return anything a userdb could normally
      # return. For example:
      #
@@ -958,8 +959,8 @@
      # the user verification another way, you can add 
allow_all_users=yes to
      # the args in which case the passdb lookup is skipped.
      #
-    #args =
-  #}
+       args = uid=postfix gid=postfix home=/home/rihad/mail/%d/%n
+  }

    # SQL database <doc/wiki/AuthDatabase.SQL.txt>
    #userdb sql {
@@ -993,7 +994,7 @@
    # authentication with BSDs internally accesses shadow files, which also
    # requires roots. Note that this user is NOT used to access mails.
    # That user is specified by userdb above.
-  user = root
+#  user = root

    # Directory where to chroot the process. Most authentication 
backends don't
    # work if this is set, and there's no point chrooting if auth_user 
is root.
@@ -1027,8 +1028,11 @@
        # The client socket is generally safe to export to everyone. 
Typical use
        # is to export it to your SMTP server so it can do SMTP AUTH lookups
        # using it.
-      path = /var/run/dovecot/auth-client
+#      path = /var/run/dovecot/auth-client
+       path = /var/spool/postfix/private/auth
        mode = 0660
+       user = postfix
+       group = postfix
      }
    }
  }


More information about the dovecot mailing list