Unable to get virtual users set up with database auth
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@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@domain.tld/chayes/.forward.avalon: Group writable directory Oct 16 00:10:26 avalon sendmail[2536]: s9G5APo9002535: forward /var/spool/mail/chayes@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@domain.tld/chayes Oct 16 00:10:26 avalon dovecot: lda(chayes): Debug: Home dir not found: /var/spool/mail/chayes@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
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Thu, 16 Oct 2014, Cliff Hayes wrote:
But %u always contains just chayes instead of chayes@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@domain" gives "foo@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-----
I tried both ways with same result. I tried just returning the username as well.
On 10/16/2014 10:45 AM, Steffen Kaiser wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Thu, 16 Oct 2014, Cliff Hayes wrote:
But %u always contains just chayes instead of chayes@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@domain" gives "foo@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-----
Since you have to use system users, why don't you just use that? Why use SQL?
On 10/16/2014 12:06 PM, Cliff Hayes wrote:
I tried both ways with same result. I tried just returning the username as well.
On 10/16/2014 10:45 AM, Steffen Kaiser wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Thu, 16 Oct 2014, Cliff Hayes wrote:
But %u always contains just chayes instead of chayes@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@domain" gives "foo@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-----
ok I tried this as the query:
password_query = SELECT uName as user, uNameDomain as username, uDomain as domain, uPass as password FROM users WHERE uName = '%n' AND uDomain = '%d'
and it is still putting mail /var/spool/mail/chayes and erroring trying to look in chayes@domain.tld/chayes instead of /var/spool/mail/chayes@domain.tld
Oct 16 11:09:22 avalon sendmail[5047]: s9GG9KVV005046: forward /var/spool/mail/chayes@domain.tld/chayes/.forward.avalon: Group writable directory Oct 16 11:09:22 avalon sendmail[5047]: s9GG9KVV005046: forward /var/spool/mail/chayes@domain.tld/chayes/.forward: Group writable directory Oct 16 11:09:22 avalon dovecot: lda(chayes): Debug: Effective uid=497, gid=497, home=/var/spool/mail/chayes@domain.tld/chayes Oct 16 11:09:22 avalon dovecot: lda(chayes): Debug: Home dir not found: /var/spool/mail/chayes@domain.tld/chayes Oct 16 11:09:22 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 11:09:22 avalon dovecot: lda(chayes): Debug: fs: root=/var/spool/mail/chayes, index=, control=, inbox=/var/spool/mail/chayes Oct 16 11:09:22 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 11:09:22 avalon dovecot: lda(chayes): Fatal: Invalid user settings. Refer to server log for more information.
On 10/16/2014 10:45 AM, Steffen Kaiser wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Thu, 16 Oct 2014, Cliff Hayes wrote:
But %u always contains just chayes instead of chayes@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@domain" gives "foo@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-----
participants (3)
-
Cliff Hayes
-
Gedalya
-
Steffen Kaiser