I can't seem to get imap virtual users to work with database authentication on new Scientific Linux 6.5 server with Sendmail 8.14.4 & Dovecot 2.0.9 Apparently I have to also create system users because sendmail/procmail/dovecot want to check directory ownership. So I created a database, made entry for the user, created the user chayes on the system. But %u always contains just chayes instead of chayes at domain.tld even though I tried different select statements to put the entire username in the username field. This causes the following errors: Oct 16 00:10:26 avalon sendmail[2536]: s9G5APo9002535: forward /var/spool/mail/chayes at domain.tld/chayes/.forward.avalon: Group writable directory Oct 16 00:10:26 avalon sendmail[2536]: s9G5APo9002535: forward /var/spool/mail/chayes at domain.tld/chayes/.forward: Group writable directory Oct 16 00:10:26 avalon dovecot: lda(chayes): Debug: Effective uid=497, gid=497, home=/var/spool/mail/chayes at domain.tld/chayes Oct 16 00:10:26 avalon dovecot: lda(chayes): Debug: Home dir not found: /var/spool/mail/chayes at domain.tld/chayes Oct 16 00:10:26 avalon dovecot: lda(chayes): Debug: Namespace : type=private, prefix=, sep=., inbox=yes, hidden=no, list=yes, subscriptions=yes location=mbox:/var/spool/mail/chayes:INBOX=/var/spool/mail/chayes Oct 16 00:10:26 avalon dovecot: lda(chayes): Debug: fs: root=/var/spool/mail/chayes, index=, control=, inbox=/var/spool/mail/chayes Oct 16 00:10:26 avalon dovecot: lda(chayes): Error: user chayes: Initialization failed: Namespace '': mbox: mbox root directory can't be a file: /var/spool/mail/chayes (http://wiki.dovecot.org/MailLocation/Mbox) Oct 16 00:10:26 avalon dovecot: lda(chayes): Fatal: Invalid user settings. Refer to server log for more information. protocols = imap mail_location = mbox:/var/spool/mail/%u:INBOX=/var/spool/mail/%u password_query = SELECT uNameDomain as username, uDomain as domain, uPass as password FROM users WHERE uName = '%n' AND uDomain = '%d' also tried password_query = SELECT uName as username, uDomain as domain, uPass as password FROM users WHERE uName = '%n' AND uDomain = '%d' # file: /etc/procmailrc # system-wide settings for procmail SHELL="/bin/bash" SENDMAIL="/usr/sbin/sendmail -oi -t" LOGFILE="/var/log/procmail.log" DROPPRIVS=yes DELIVER="/usr/libexec/dovecot/deliver" #MAILDIR=$HOME/ #DEFAULT=$HOME/ :0 w * ^X-Spam-Status: Yes | $DELIVER -m spam :0 w | $DELIVER Thanks in advance
Steffen Kaiser
2014-Oct-16 15:45 UTC
Unable to get virtual users set up with database auth
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thu, 16 Oct 2014, Cliff Hayes wrote:> But %u always contains just chayes instead of chayes at domain.tld even though I > tried different select statements to put the entire username in the username > field. > mail_location = mbox:/var/spool/mail/%u:INBOX=/var/spool/mail/%u > > password_query = SELECT uNameDomain as username, uDomain as domain, uPass as^^^^^^ From http://wiki2.dovecot.org/PasswordDatabase username should read just user. Whereas: "username: Like user, but doesn't drop existing domain name (e.g. "username=foo" for "user at domain" gives "foo at domain"). "> password FROM users WHERE uName = '%n' AND uDomain = '%d'- -- Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQEVAwUBVD/oFnz1H7kL/d9rAQIawQgAuDCC8VpNDffq8n3tNvHD81YuAVdHO3Xf Tv1xUftwta3g5c51AxWercHrV+Td79Od4sqfNAElEJOkZGpCHje+R8u74xdidpq3 RhDJaFzxFprJfnPa5SX2meoI98E0HMZRY/18kutK6JytMYzRZ10EV3wN0GuIjh+/ a7bvxFaxQEWZYDlagDEvv2IULHVW5HROU5yacFDDxElnFPIvcUHLrbMCVnh9qUyg H7dtuySEooZVqPymoYUWTISaQ4mjv4mRI7jTxYYjSIxhWBkxoxUyqZGWds01/eGZ gzKLcx+PqjAmnpNV/ee/i8fA82UNmlPl4K6E2GWLnKfLiD8kzYIqTQ==hVsF -----END PGP SIGNATURE-----