[Dovecot] Dovecot 2.2.4/sendmail with sql user and aliases
Hi,
We are currently moving from linuxconf/dovecot to a dovecot setup with sql support, the problem we currently facing is having a message sent to a aliase delivered to the user email inbox with dovecot-lda, i have created cedrict@mail.vdl and a alias test@mail.vdl, when i send to cedrict@mail.vdl the message is included in the user inbox file, but when i send to test@mail.vdl it should do the same and not create a new created file named test, thank in advance for your help.
# dovecot --version 2.2.4
dovecot.conf auth_debug = yes auth_debug_passwords = yes auth_verbose = yes default_internal_user = root default_login_user = mail disable_plaintext_auth = no first_valid_uid = 100 mail_access_groups = mail users sysadmin popusers mail_location = mbox:%h/mail:LAYOUT=maildir++:INDEX=MEMORY:CONTROL=%h/mail/control:INBOX=/var/spool/vmail/%d/%n mail_max_userip_connections = 40 mail_plugins = " quota sieve" managesieve_notify_capability = mailto managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date ihave mbox_lazy_writes = no passdb { args = /vdl/etc/dovecot/dovecot-sql.conf driver = sql } plugin { sieve = %h/mail/sieve/%n sieve_global_dir = /vdl/etc/dovecot/ sieve_vacation_default_period = 1d sieve_vacation_max_period = 7d } postmaster_address = x@x.x protocols = imap pop3 service auth { unix_listener auth-userdb { mode = 0600 user = popusers } } service imap-login { inet_listener imap { port = 143 } process_min_avail = 4 vsz_limit = 256 M } service pop3-login { inet_listener pop3 { port = 110 } process_min_avail = 16 } ssl = no submission_host = localhost:25 userdb { args = /vdl/etc/dovecot/dovecot-sql.conf driver = sql } protocol imap { mail_plugins = quota imap_quota mail_log notify } protocol pop3 { mail_plugins = quota } protocol lda { mail_plugins = quota sieve }
dovecot-sql.conf
password_query = SELECT
concat(s_courriel_utilisateur.utilisateur, '@', s_courriel_domaine.nom)
AS user,s_courriel_utilisateur.password as password
FROM s_courriel_utilisateur left join s_courriel_alias on
s_courriel_utilisateur.id=s_courriel_alias.utilisateur and
s_courriel_alias.archive !=1 ,s_courriel_domaine
WHERE s_courriel_utilisateur.archive !=1
and s_courriel_domaine.archive !=1
and
s_courriel_utilisateur.domaine=s_courriel_domaine.id
and s_courriel_domaine.nom = '%d'
and ( s_courriel_utilisateur.utilisateur = '%n'
or s_courriel_alias.alias = '%n' )
user_query = SELECT
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur)
as home,
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/index")
as "index",
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/control")
as control,
concat("/var/spool/vmail/",s_courriel_domaine.nom,"/",s_courriel_utilisateur.utilisateur)
as inbox,
"maildir++" as layout,
s_courriel_utilisateur.uid as
uid,s_courriel_domaine.gid as gid
FROM s_courriel_utilisateur left join s_courriel_alias on
s_courriel_utilisateur.id=s_courriel_alias.utilisateur and
s_courriel_alias.archive !=1 ,s_courriel_domaine
WHERE s_courriel_utilisateur.archive !=1
and s_courriel_domaine.archive !=1
and
s_courriel_utilisateur.domaine=s_courriel_domaine.id
and s_courriel_domaine.nom = '%d'
and ( s_courriel_utilisateur.utilisateur = '%n'
or s_courriel_alias.alias = '%n' )
Transaction debug for cedrict@mail.vdl with message added to file /var/spool/vmail/mail.vdl/cedrict
SELECT
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur)
as home,
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/index")
as "index",
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/control")
as control,
concat("/var/spool/vmail/",s_courriel_domaine.nom,"/",s_courriel_utilisateur.utilisateur)
as inbox, "maildir++" as layout, s_courriel_utilisateur.uid as
uid,s_courriel_domaine.gid as gid FROM s_courriel_utilisateur left join
s_courriel_alias on
s_courriel_utilisateur.id=s_courriel_alias.utilisateur and
s_courriel_alias.archive !=1 ,s_courriel_domaine WHERE
s_courriel_utilisateur.archive !=1 and s_courriel_domaine.archive !=1
and s_courriel_utilisateur.domaine=s_courriel_domaine.id and
s_courriel_domaine.nom = 'mail.vdl' and (
s_courriel_utilisateur.utilisateur = 'cedrict' or
s_courriel_alias.alias = 'cedrict');
+------------------------------+-----------------------------------------+-------------------------------------------+-----------------------------------+-----------+-------+------+
| home | index
| control |
inbox | layout | uid | gid |
+------------------------------+-----------------------------------------+-------------------------------------------+-----------------------------------+-----------+-------+------+
| /vhome/mail.vdl/home/cedrict | /vhome/mail.vdl/home/cedrict/mail/index
| /vhome/mail.vdl/home/cedrict/mail/control |
/var/spool/vmail/mail.vdl/cedrict | maildir++ | 60001 | 231 |
+------------------------------+-----------------------------------------+-------------------------------------------+-----------------------------------+-----------+-------+------+
Jul 17 14:00:56 devshed dovecot: auth: Debug: master in: USER 1
cedrict@mail.vdl service=lda
Jul 17 14:00:56 devshed dovecot: auth-worker(7009): Debug: Loading
modules from directory: /vdl/lib/dovecot/auth
Jul 17 14:00:56 devshed dovecot: auth-worker(7009): Debug:
sql(cedrict@mail.vdl): SELECT
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur)
as home,
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/index")
as "index",
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/control")
as control,
concat("/var/spool/vmail/",s_courriel_domaine.nom,"/",s_courriel_utilisateur.utilisateur)
as inbox, "maildir++" as layout, s_courriel_utilisateur.uid as
uid,s_courriel_domaine.gid as gid FROM s_courriel_utilisateur left join
s_courriel_alias on
s_courriel_utilisateur.id=s_courriel_alias.utilisateur and
s_courriel_alias.archive !=1 ,s_courriel_domaine WHERE
s_courriel_utilisateur.archive !=1 and s_courriel_domaine.archive !=1
and s_courriel_utilisateur.domaine=s_courriel_domaine.id and
s_courriel_domaine.nom = 'mail.vdl' and (
s_courriel_utilisateur.utilisateur = 'cedrict' or
s_courriel_alias.alias = 'cedrict'
Jul 17 14:00:56 devshed dovecot: auth: Debug: userdb out: USER 1
cedrict@mail.vdl home=/vhome/mail.vdl/home/cedrict
index=/vhome/mail.vdl/home/cedrict/mail/index
control=/vhome/mail.vdl/home/cedrict/mail/control
inbox=/var/spool/vmail/mail.vdl/cedrict layout=maildir++ uid=60001
gid=231
Jul 17 14:00:56 devshed dovecot: lda: Debug: auth input:
cedrict@mail.vdl home=/vhome/mail.vdl/home/cedrict
index=/vhome/mail.vdl/home/cedrict/mail/index
control=/vhome/mail.vdl/home/cedrict/mail/control
inbox=/var/spool/vmail/mail.vdl/cedrict layout=maildir++ uid=60001 gid=231
Jul 17 14:00:56 devshed dovecot: lda: Debug: Added userdb setting:
plugin/control=/vhome/mail.vdl/home/cedrict/mail/control
Jul 17 14:00:56 devshed dovecot: lda: Debug: Added userdb setting:
plugin/inbox=/var/spool/vmail/mail.vdl/cedrict
Jul 17 14:00:56 devshed dovecot: lda: Debug: Added userdb setting:
plugin/index=/vhome/mail.vdl/home/cedrict/mail/index
Jul 17 14:00:56 devshed dovecot: lda: Debug: Added userdb setting:
plugin/layout=maildir++
Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: Effective
uid=60001, gid=231, home=/vhome/mail.vdl/home/cedrict
Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: quota: No
quota setting - plugin disabled
Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug:
maildir++: root=/vhome/mail.vdl/home/cedrict/mail, index=, indexpvt=,
control=/vhome/mail.vdl/home/cedrict/mail/control,
inbox=/var/spool/vmail/mail.vdl/cedrict, alt=
Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: quota: No
quota setting - plugin disabled
Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: none:
root=, index=, indexpvt=, control=, inbox=, alt=
Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug:
Destination address: cedrict@mail.vdl (source: user@hostname)
Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: sieve:
Pigeonhole version 0.4.1 initializing
Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: sieve:
script file /vhome/mail.vdl/home/cedrict/mail/sieve/cedrict not found
Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: sieve:
user's script /vhome/mail.vdl/home/cedrict/mail/sieve/cedrict doesn't
exist (trying default script location instead)
Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: sieve: no
default script configured for user
Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: sieve:
user has no valid location for a personal script
Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: sieve: no
scripts to execute: reverting to default delivery.
Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl):
msgid=201307171800.r6HI0unE007004@devshed.derytelecom.ca: saved mail
to INBOX
Transaction debug for alias test@mail.vdl with message added to file /var/spool/vmail/mail.vdl/test
mysql> SELECT
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur)
as home,
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/index")
as "index",
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/control")
as control,
concat("/var/spool/vmail/",s_courriel_domaine.nom,"/",s_courriel_utilisateur.utilisateur)
as inbox, "maildir++" as layout, s_courriel_utilisateur.uid as
uid,s_courriel_domaine.gid as gid FROM s_courriel_utilisateur left
join s_courriel_alias on
s_courriel_utilisateur.id=s_courriel_alias.utilisateur and
s_courriel_alias.archive !=1 ,s_courriel_domaine WHERE
s_courriel_utilisateur.archive !=1 and s_courriel_domaine.archive !=1
and s_courriel_utilisateur.domaine=s_courriel_domaine.id and
s_courriel_domaine.nom = 'mail.vdl' and (
s_courriel_utilisateur.utilisateur = 'test' or s_courriel_alias.alias =
'test' );
+------------------------------+-----------------------------------------+-------------------------------------------+-----------------------------------+-----------+-------+------+
| home | index
| control |
inbox | layout | uid | gid |
+------------------------------+-----------------------------------------+-------------------------------------------+-----------------------------------+-----------+-------+------+
| /vhome/mail.vdl/home/cedrict | /vhome/mail.vdl/home/cedrict/mail/index
| /vhome/mail.vdl/home/cedrict/mail/control |
/var/spool/vmail/mail.vdl/cedrict | maildir++ | 60001 | 231 |
+------------------------------+-----------------------------------------+-------------------------------------------+-----------------------------------+-----------+-------+------+
1 row in set (0,00 sec)
Jul 17 14:03:10 devshed dovecot: auth-worker(7135): Debug:
sql(test@mail.vdl): SELECT
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur)
as home,
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/index")
as "index",
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/control")
as control,
concat("/var/spool/vmail/",s_courriel_domaine.nom,"/",s_courriel_utilisateur.utilisateur)
as inbox, "maildir++" as layout, s_courriel_utilisateur.uid as
uid,s_courriel_domaine.gid as gid FROM s_courriel_utilisateur left
join s_courriel_alias on
s_courriel_utilisateur.id=s_courriel_alias.utilisateur and
s_courriel_alias.archive !=1 ,s_courriel_domaine WHERE
s_courriel_utilisateur.archive !=1 and s_courriel_domaine.archive !=1
and s_courriel_utilisateur.domaine=s_courriel_domaine.id and
s_courriel_domaine.nom = 'mail.vdl' and (
s_courriel_utilisateur.utilisateur = 'test' or s_courriel_alias.alias =
'test' )
Jul 17 14:03:10 devshed dovecot: auth: Debug: userdb out: USER 1
test@mail.vdl home=/vhome/mail.vdl/home/cedrict
index=/vhome/mail.vdl/home/cedrict/mail/index
control=/vhome/mail.vdl/home/cedrict/mail/control
inbox=/var/spool/vmail/mail.vdl/cedrict layout=maildir++ uid=60001
gid=231
Jul 17 14:03:10 devshed dovecot: lda: Debug: auth input: test@mail.vdl
home=/vhome/mail.vdl/home/cedrict
index=/vhome/mail.vdl/home/cedrict/mail/index
control=/vhome/mail.vdl/home/cedrict/mail/control
inbox=/var/spool/vmail/mail.vdl/cedrict layout=maildir++ uid=60001 gid=231
Jul 17 14:03:10 devshed dovecot: lda: Debug: Added userdb setting:
plugin/control=/vhome/mail.vdl/home/cedrict/mail/control
Jul 17 14:03:10 devshed dovecot: lda: Debug: Added userdb setting:
plugin/inbox=/var/spool/vmail/mail.vdl/cedrict
Jul 17 14:03:10 devshed dovecot: lda: Debug: Added userdb setting:
plugin/index=/vhome/mail.vdl/home/cedrict/mail/index
Jul 17 14:03:10 devshed dovecot: lda: Debug: Added userdb setting:
plugin/layout=maildir++
Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: Effective
uid=60001, gid=231, home=/vhome/mail.vdl/home/cedrict
Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: quota: No
quota setting - plugin disabled
Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: maildir++:
root=/vhome/mail.vdl/home/cedrict/mail, index=, indexpvt=,
control=/vhome/mail.vdl/home/cedrict/mail/control,
inbox=/var/spool/vmail/mail.vdl/test, alt=
Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: quota: No
quota setting - plugin disabled
Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: none: root=,
index=, indexpvt=, control=, inbox=, alt=
Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: Destination
address: test@mail.vdl (source: user@hostname)
Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: sieve:
Pigeonhole version 0.4.1 initializing
Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: sieve:
script file /vhome/mail.vdl/home/cedrict/mail/sieve/test not found
Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: sieve:
user's script /vhome/mail.vdl/home/cedrict/mail/sieve/test doesn't exist
(trying default script location instead)
Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: sieve: no
default script configured for user
Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: sieve: user
has no valid location for a personal script
Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: sieve: no
scripts to execute: reverting to default delivery.
I also tried adding the username in the sql query, same problem, there's the debug :
[root@devshed ~]# Jul 17 14:11:59 devshed dovecot: lda: Debug: Loading
modules from directory: /vdl/lib/dovecot
Jul 17 14:11:59 devshed dovecot: lda: Debug: Module loaded:
/vdl/lib/dovecot/lib10_quota_plugin.so
Jul 17 14:11:59 devshed dovecot: lda: Debug: Module loaded:
/vdl/lib/dovecot/lib90_sieve_plugin.so
Jul 17 14:11:59 devshed dovecot: auth: Debug: master in: USER 1
test@mail.vdl service=lda
Jul 17 14:11:59 devshed dovecot: auth-worker(7385): Debug: Loading
modules from directory: /vdl/lib/dovecot/auth
Jul 17 14:11:59 devshed dovecot: auth-worker(7385): Debug:
sql(test@mail.vdl): SELECT s_courriel_utilisateur.utilisateur as
username,
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur)
as home,
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/index")
as "index",
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/control")
as control,
concat("/var/spool/vmail/",s_courriel_domaine.nom,"/",s_courriel_utilisateur.utilisateur)
as inbox, "maildir++" as layout, s_courriel_utilisateur.uid as
uid,s_courriel_domaine.gid as gid FROM s_courriel_utilisateur left
join s_courriel_alias on
s_courriel_utilisateur.id=s_courriel_alias.utilisateur and
s_courriel_alias.archive !=1 ,s_courriel_domaine WHERE
s_courriel_utilisateur.archive !=1 and s_courriel_domaine.archive !=1
and s_courriel_utilisateur.domaine=s_courriel_domaine.id and
s_courriel_domaine.nom = 'mail.vdl' and (
s_courriel_utilisateur.utilisateur = 'tes
Jul 17 14:11:59 devshed dovecot: auth-worker(7385): Debug:
auth(test@mail.vdl): username changed test@mail.vdl -> cedrict@mail.vdl
Jul 17 14:11:59 devshed dovecot: auth: Debug: userdb out: USER 1
test@mail.vdl home=/vhome/mail.vdl/home/cedrict
index=/vhome/mail.vdl/home/cedrict/mail/index
control=/vhome/mail.vdl/home/cedrict/mail/control
inbox=/var/spool/vmail/mail.vdl/cedrict layout=maildir++ uid=60001
gid=231
Jul 17 14:11:59 devshed dovecot: lda: Debug: auth input: test@mail.vdl
home=/vhome/mail.vdl/home/cedrict
index=/vhome/mail.vdl/home/cedrict/mail/index
control=/vhome/mail.vdl/home/cedrict/mail/control
inbox=/var/spool/vmail/mail.vdl/cedrict layout=maildir++ uid=60001 gid=231
Jul 17 14:11:59 devshed dovecot: lda: Debug: Added userdb setting:
plugin/control=/vhome/mail.vdl/home/cedrict/mail/control
Jul 17 14:11:59 devshed dovecot: lda: Debug: Added userdb setting:
plugin/inbox=/var/spool/vmail/mail.vdl/cedrict
Jul 17 14:11:59 devshed dovecot: lda: Debug: Added userdb setting:
plugin/index=/vhome/mail.vdl/home/cedrict/mail/index
Jul 17 14:11:59 devshed dovecot: lda: Debug: Added userdb setting:
plugin/layout=maildir++
Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: Effective
uid=60001, gid=231, home=/vhome/mail.vdl/home/cedrict
Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: quota: No
quota setting - plugin disabled
Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: maildir++:
root=/vhome/mail.vdl/home/cedrict/mail, index=, indexpvt=,
control=/vhome/mail.vdl/home/cedrict/mail/control,
inbox=/var/spool/vmail/mail.vdl/test, alt=
Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: quota: No
quota setting - plugin disabled
Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: none: root=,
index=, indexpvt=, control=, inbox=, alt=
Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: Destination
address: test@mail.vdl (source: user@hostname)
Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: sieve:
Pigeonhole version 0.4.1 initializing
Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: sieve:
script file /vhome/mail.vdl/home/cedrict/mail/sieve/test not found
Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: sieve:
user's script /vhome/mail.vdl/home/cedrict/mail/sieve/test doesn't exist
(trying default script location instead)
Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: sieve: no
default script configured for user
Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: sieve: user
has no valid location for a personal script
Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: sieve: no
scripts to execute: reverting to default delivery.
Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl):
msgid=201307171811.r6HIBxWe007380@devshed.derytelecom.ca: saved mail
to INBOX
Cedric
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Wed, 17 Jul 2013, Cedric wrote:
We are currently moving from linuxconf/dovecot to a dovecot setup with sql support, the problem we currently facing is having a message sent to a aliase delivered to the user email inbox with dovecot-lda, i have created cedrict@mail.vdl and a alias test@mail.vdl, when i send to cedrict@mail.vdl the message is included in the user inbox file, but when i send to test@mail.vdl it should do the same and not create a new created file named test, thank in advance for your help.
I don't understand your problem.
cedrict
Jul 17 14:00:56 devshed dovecot: auth: Debug: userdb out: USER 1 cedrict@mail.vdl home=/vhome/mail.vdl/home/cedrict index=/vhome/mail.vdl/home/cedrict/mail/index control=/vhome/mail.vdl/home/cedrict/mail/control inbox=/var/spool/vmail/mail.vdl/cedrict layout=maildir++ uid=60001 gid=231
test as alias
Jul 17 14:03:10 devshed dovecot: auth: Debug: userdb out: USER 1 test@mail.vdl home=/vhome/mail.vdl/home/cedrict index=/vhome/mail.vdl/home/cedrict/mail/index control=/vhome/mail.vdl/home/cedrict/mail/control inbox=/var/spool/vmail/mail.vdl/cedrict layout=maildir++ uid=60001 gid=231
Both entries look the same to me. Both messages should be delivered to the same INBOX located at /var/spool/vmail/mail.vdl/cedrict.
Are you talking about:
Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: sieve: script file /vhome/mail.vdl/home/cedrict/mail/sieve/test not found
? The Sieve script comes from the setting:
sieve = %h/mail/sieve/%n
and depends on the username, hence, test and cedrict differ.
Here you try to override the user:
password_query = SELECT
concat(s_courriel_utilisateur.utilisateur, '@', s_courriel_domaine.nom) AS user,s_courriel_utilisateur.password as password
FROM s_courriel_utilisateur left join s_courriel_alias on s_courriel_utilisateur.id=s_courriel_alias.utilisateur and s_courriel_alias.archive !=1 ,s_courriel_domaine
WHERE s_courriel_utilisateur.archive !=1
and s_courriel_domaine.archive !=1
and s_courriel_utilisateur.domaine=s_courriel_domaine.id
and s_courriel_domaine.nom = '%d'
and ( s_courriel_utilisateur.utilisateur = '%n' or s_courriel_alias.alias = '%n' )
In your last log section, there is a "auth(test@mail.vdl): username changed test@mail.vdl -> cedrict@mail.vdl" entry, but the Sieve script still expands %n with "test". Actually I never tried to override "username", but I would try to override username as well:
http://wiki2.dovecot.org/PasswordDatabase
Maybe you need to do this for the userdb as well? I don't think so, but well.
# dovecot --version 2.2.4
dovecot.conf auth_debug = yes auth_debug_passwords = yes auth_verbose = yes default_internal_user = root default_login_user = mail disable_plaintext_auth = no first_valid_uid = 100 mail_access_groups = mail users sysadmin popusers mail_location = mbox:%h/mail:LAYOUT=maildir++:INDEX=MEMORY:CONTROL=%h/mail/control:INBOX=/var/spool/vmail/%d/%n mail_max_userip_connections = 40 mail_plugins = " quota sieve" managesieve_notify_capability = mailto managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date ihave mbox_lazy_writes = no passdb { args = /vdl/etc/dovecot/dovecot-sql.conf driver = sql } plugin { sieve = %h/mail/sieve/%n sieve_global_dir = /vdl/etc/dovecot/ sieve_vacation_default_period = 1d sieve_vacation_max_period = 7d } postmaster_address = x@x.x protocols = imap pop3 service auth { unix_listener auth-userdb { mode = 0600 user = popusers } } service imap-login { inet_listener imap { port = 143 } process_min_avail = 4 vsz_limit = 256 M } service pop3-login { inet_listener pop3 { port = 110 } process_min_avail = 16 } ssl = no submission_host = localhost:25 userdb { args = /vdl/etc/dovecot/dovecot-sql.conf driver = sql } protocol imap { mail_plugins = quota imap_quota mail_log notify } protocol pop3 { mail_plugins = quota } protocol lda { mail_plugins = quota sieve }
dovecot-sql.conf password_query = SELECT
concat(s_courriel_utilisateur.utilisateur, '@', s_courriel_domaine.nom) AS user,s_courriel_utilisateur.password as password
FROM s_courriel_utilisateur left join s_courriel_alias on s_courriel_utilisateur.id=s_courriel_alias.utilisateur and s_courriel_alias.archive !=1 ,s_courriel_domaine
WHERE s_courriel_utilisateur.archive !=1
and s_courriel_domaine.archive !=1
and s_courriel_utilisateur.domaine=s_courriel_domaine.id
and s_courriel_domaine.nom = '%d'
and ( s_courriel_utilisateur.utilisateur = '%n' or s_courriel_alias.alias = '%n' )user_query = SELECT
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur) as home,
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/index") as "index",
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/control") as control,
concat("/var/spool/vmail/",s_courriel_domaine.nom,"/",s_courriel_utilisateur.utilisateur) as inbox,
"maildir++" as layout,
s_courriel_utilisateur.uid as uid,s_courriel_domaine.gid as gid
FROM s_courriel_utilisateur left join s_courriel_alias on s_courriel_utilisateur.id=s_courriel_alias.utilisateur and s_courriel_alias.archive !=1 ,s_courriel_domaine
WHERE s_courriel_utilisateur.archive !=1
and s_courriel_domaine.archive !=1
and s_courriel_utilisateur.domaine=s_courriel_domaine.id
and s_courriel_domaine.nom = '%d'
and ( s_courriel_utilisateur.utilisateur = '%n' or s_courriel_alias.alias = '%n' )Transaction debug for cedrict@mail.vdl with message added to file /var/spool/vmail/mail.vdl/cedrict
SELECT concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur) as home, concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/index") as "index", concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/control") as control, concat("/var/spool/vmail/",s_courriel_domaine.nom,"/",s_courriel_utilisateur.utilisateur) as inbox, "maildir++" as layout, s_courriel_utilisateur.uid as uid,s_courriel_domaine.gid as gid FROM s_courriel_utilisateur left join s_courriel_alias on s_courriel_utilisateur.id=s_courriel_alias.utilisateur and s_courriel_alias.archive !=1 ,s_courriel_domaine WHERE s_courriel_utilisateur.archive !=1 and s_courriel_domaine.archive !=1 and s_courriel_utilisateur.domaine=s_courriel_domaine.id and s_courriel_domaine.nom = 'mail.vdl' and ( s_courriel_utilisateur.utilisateur = 'cedrict' or s_courriel_alias.alias = 'cedrict'); +------------------------------+-----------------------------------------+-------------------------------------------+-----------------------------------+-----------+-------+------+ | home | index | control | inbox | layout | uid | gid | +------------------------------+-----------------------------------------+-------------------------------------------+-----------------------------------+-----------+-------+------+ | /vhome/mail.vdl/home/cedrict | /vhome/mail.vdl/home/cedrict/mail/index | /vhome/mail.vdl/home/cedrict/mail/control | /var/spool/vmail/mail.vdl/cedrict | maildir++ | 60001 | 231 | +------------------------------+-----------------------------------------+-------------------------------------------+-----------------------------------+-----------+-------+------+
Jul 17 14:00:56 devshed dovecot: auth: Debug: master in: USER 1 cedrict@mail.vdl service=lda Jul 17 14:00:56 devshed dovecot: auth-worker(7009): Debug: Loading modules from directory: /vdl/lib/dovecot/auth Jul 17 14:00:56 devshed dovecot: auth-worker(7009): Debug: sql(cedrict@mail.vdl): SELECT concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur) as home, concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/index") as "index", concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/control") as control, concat("/var/spool/vmail/",s_courriel_domaine.nom,"/",s_courriel_utilisateur.utilisateur) as inbox, "maildir++" as layout, s_courriel_utilisateur.uid as uid,s_courriel_domaine.gid as gid FROM s_courriel_utilisateur left join s_courriel_alias on s_courriel_utilisateur.id=s_courriel_alias.utilisateur and s_courriel_alias.archive !=1 ,s_courriel_domaine WHERE s_courriel_utilisateur.archive !=1 and s_courriel_domaine.archive !=1 and s_courriel_utilisateur.domaine=s_courriel_domaine.id and s_courriel_domaine.nom = 'mail.vdl' and ( s_courriel_utilisateur.utilisateur = 'cedrict' or s_courriel_alias.alias = 'cedrict' Jul 17 14:00:56 devshed dovecot: auth: Debug: userdb out: USER 1 cedrict@mail.vdl home=/vhome/mail.vdl/home/cedrict index=/vhome/mail.vdl/home/cedrict/mail/index control=/vhome/mail.vdl/home/cedrict/mail/control inbox=/var/spool/vmail/mail.vdl/cedrict layout=maildir++ uid=60001 gid=231 Jul 17 14:00:56 devshed dovecot: lda: Debug: auth input: cedrict@mail.vdl home=/vhome/mail.vdl/home/cedrict index=/vhome/mail.vdl/home/cedrict/mail/index control=/vhome/mail.vdl/home/cedrict/mail/control inbox=/var/spool/vmail/mail.vdl/cedrict layout=maildir++ uid=60001 gid=231 Jul 17 14:00:56 devshed dovecot: lda: Debug: Added userdb setting: plugin/control=/vhome/mail.vdl/home/cedrict/mail/control Jul 17 14:00:56 devshed dovecot: lda: Debug: Added userdb setting: plugin/inbox=/var/spool/vmail/mail.vdl/cedrict Jul 17 14:00:56 devshed dovecot: lda: Debug: Added userdb setting: plugin/index=/vhome/mail.vdl/home/cedrict/mail/index Jul 17 14:00:56 devshed dovecot: lda: Debug: Added userdb setting: plugin/layout=maildir++ Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: Effective uid=60001, gid=231, home=/vhome/mail.vdl/home/cedrict Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: quota: No quota setting - plugin disabled Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: maildir++: root=/vhome/mail.vdl/home/cedrict/mail, index=, indexpvt=, control=/vhome/mail.vdl/home/cedrict/mail/control, inbox=/var/spool/vmail/mail.vdl/cedrict, alt= Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: quota: No quota setting - plugin disabled Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: none: root=, index=, indexpvt=, control=, inbox=, alt= Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: Destination address: cedrict@mail.vdl (source: user@hostname) Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: sieve: Pigeonhole version 0.4.1 initializing Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: sieve: script file /vhome/mail.vdl/home/cedrict/mail/sieve/cedrict not found Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: sieve: user's script /vhome/mail.vdl/home/cedrict/mail/sieve/cedrict doesn't exist (trying default script location instead) Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: sieve: no default script configured for user Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: sieve: user has no valid location for a personal script Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: sieve: no scripts to execute: reverting to default delivery. Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): msgid=201307171800.r6HI0unE007004@devshed.derytelecom.ca: saved mail to INBOX
Transaction debug for alias test@mail.vdl with message added to file /var/spool/vmail/mail.vdl/test
mysql> SELECT concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur) as home, concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/index") as "index", concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/control") as control, concat("/var/spool/vmail/",s_courriel_domaine.nom,"/",s_courriel_utilisateur.utilisateur) as inbox, "maildir++" as layout, s_courriel_utilisateur.uid as uid,s_courriel_domaine.gid as gid FROM s_courriel_utilisateur left join s_courriel_alias on s_courriel_utilisateur.id=s_courriel_alias.utilisateur and s_courriel_alias.archive !=1 ,s_courriel_domaine WHERE s_courriel_utilisateur.archive !=1 and s_courriel_domaine.archive !=1 and s_courriel_utilisateur.domaine=s_courriel_domaine.id and s_courriel_domaine.nom = 'mail.vdl' and ( s_courriel_utilisateur.utilisateur = 'test' or s_courriel_alias.alias = 'test' ); +------------------------------+-----------------------------------------+-------------------------------------------+-----------------------------------+-----------+-------+------+ | home | index | control | inbox | layout | uid | gid | +------------------------------+-----------------------------------------+-------------------------------------------+-----------------------------------+-----------+-------+------+ | /vhome/mail.vdl/home/cedrict | /vhome/mail.vdl/home/cedrict/mail/index | /vhome/mail.vdl/home/cedrict/mail/control | /var/spool/vmail/mail.vdl/cedrict | maildir++ | 60001 | 231 | +------------------------------+-----------------------------------------+-------------------------------------------+-----------------------------------+-----------+-------+------+ 1 row in set (0,00 sec)
Jul 17 14:03:10 devshed dovecot: auth-worker(7135): Debug: sql(test@mail.vdl): SELECT concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur) as home, concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/index") as "index", concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/control") as control, concat("/var/spool/vmail/",s_courriel_domaine.nom,"/",s_courriel_utilisateur.utilisateur) as inbox, "maildir++" as layout, s_courriel_utilisateur.uid as uid,s_courriel_domaine.gid as gid FROM s_courriel_utilisateur left join s_courriel_alias on s_courriel_utilisateur.id=s_courriel_alias.utilisateur and s_courriel_alias.archive !=1 ,s_courriel_domaine WHERE s_courriel_utilisateur.archive !=1 and s_courriel_domaine.archive !=1 and s_courriel_utilisateur.domaine=s_courriel_domaine.id and s_courriel_domaine.nom = 'mail.vdl' and ( s_courriel_utilisateur.utilisateur = 'test' or s_courriel_alias.alias = 'test' ) Jul 17 14:03:10 devshed dovecot: auth: Debug: userdb out: USER 1 test@mail.vdl home=/vhome/mail.vdl/home/cedrict index=/vhome/mail.vdl/home/cedrict/mail/index control=/vhome/mail.vdl/home/cedrict/mail/control inbox=/var/spool/vmail/mail.vdl/cedrict layout=maildir++ uid=60001 gid=231 Jul 17 14:03:10 devshed dovecot: lda: Debug: auth input: test@mail.vdl home=/vhome/mail.vdl/home/cedrict index=/vhome/mail.vdl/home/cedrict/mail/index control=/vhome/mail.vdl/home/cedrict/mail/control inbox=/var/spool/vmail/mail.vdl/cedrict layout=maildir++ uid=60001 gid=231 Jul 17 14:03:10 devshed dovecot: lda: Debug: Added userdb setting: plugin/control=/vhome/mail.vdl/home/cedrict/mail/control Jul 17 14:03:10 devshed dovecot: lda: Debug: Added userdb setting: plugin/inbox=/var/spool/vmail/mail.vdl/cedrict Jul 17 14:03:10 devshed dovecot: lda: Debug: Added userdb setting: plugin/index=/vhome/mail.vdl/home/cedrict/mail/index Jul 17 14:03:10 devshed dovecot: lda: Debug: Added userdb setting: plugin/layout=maildir++ Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: Effective uid=60001, gid=231, home=/vhome/mail.vdl/home/cedrict Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: quota: No quota setting - plugin disabled Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: maildir++: root=/vhome/mail.vdl/home/cedrict/mail, index=, indexpvt=, control=/vhome/mail.vdl/home/cedrict/mail/control, inbox=/var/spool/vmail/mail.vdl/test, alt= Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: quota: No quota setting - plugin disabled Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: none: root=, index=, indexpvt=, control=, inbox=, alt= Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: Destination address: test@mail.vdl (source: user@hostname) Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: sieve: Pigeonhole version 0.4.1 initializing Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: sieve: script file /vhome/mail.vdl/home/cedrict/mail/sieve/test not found Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: sieve: user's script /vhome/mail.vdl/home/cedrict/mail/sieve/test doesn't exist (trying default script location instead) Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: sieve: no default script configured for user Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: sieve: user has no valid location for a personal script Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: sieve: no scripts to execute: reverting to default delivery.
I also tried adding the username in the sql query, same problem, there's the debug :
[root@devshed ~]# Jul 17 14:11:59 devshed dovecot: lda: Debug: Loading modules from directory: /vdl/lib/dovecot Jul 17 14:11:59 devshed dovecot: lda: Debug: Module loaded: /vdl/lib/dovecot/lib10_quota_plugin.so Jul 17 14:11:59 devshed dovecot: lda: Debug: Module loaded: /vdl/lib/dovecot/lib90_sieve_plugin.so Jul 17 14:11:59 devshed dovecot: auth: Debug: master in: USER 1 test@mail.vdl service=lda Jul 17 14:11:59 devshed dovecot: auth-worker(7385): Debug: Loading modules from directory: /vdl/lib/dovecot/auth Jul 17 14:11:59 devshed dovecot: auth-worker(7385): Debug: sql(test@mail.vdl): SELECT s_courriel_utilisateur.utilisateur as username, concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur) as home, concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/index") as "index", concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/control") as control, concat("/var/spool/vmail/",s_courriel_domaine.nom,"/",s_courriel_utilisateur.utilisateur) as inbox, "maildir++" as layout, s_courriel_utilisateur.uid as uid,s_courriel_domaine.gid as gid FROM s_courriel_utilisateur left join s_courriel_alias on s_courriel_utilisateur.id=s_courriel_alias.utilisateur and s_courriel_alias.archive !=1 ,s_courriel_domaine WHERE s_courriel_utilisateur.archive !=1 and s_courriel_domaine.archive !=1 and s_courriel_utilisateur.domaine=s_courriel_domaine.id and s_courriel_domaine.nom = 'mail.vdl' and ( s_courriel_utilisateur.utilisateur = 'tes Jul 17 14:11:59 devshed dovecot: auth-worker(7385): Debug: auth(test@mail.vdl): username changed test@mail.vdl -> cedrict@mail.vdl Jul 17 14:11:59 devshed dovecot: auth: Debug: userdb out: USER 1 test@mail.vdl home=/vhome/mail.vdl/home/cedrict index=/vhome/mail.vdl/home/cedrict/mail/index control=/vhome/mail.vdl/home/cedrict/mail/control inbox=/var/spool/vmail/mail.vdl/cedrict layout=maildir++ uid=60001 gid=231 Jul 17 14:11:59 devshed dovecot: lda: Debug: auth input: test@mail.vdl home=/vhome/mail.vdl/home/cedrict index=/vhome/mail.vdl/home/cedrict/mail/index control=/vhome/mail.vdl/home/cedrict/mail/control inbox=/var/spool/vmail/mail.vdl/cedrict layout=maildir++ uid=60001 gid=231 Jul 17 14:11:59 devshed dovecot: lda: Debug: Added userdb setting: plugin/control=/vhome/mail.vdl/home/cedrict/mail/control Jul 17 14:11:59 devshed dovecot: lda: Debug: Added userdb setting: plugin/inbox=/var/spool/vmail/mail.vdl/cedrict Jul 17 14:11:59 devshed dovecot: lda: Debug: Added userdb setting: plugin/index=/vhome/mail.vdl/home/cedrict/mail/index Jul 17 14:11:59 devshed dovecot: lda: Debug: Added userdb setting: plugin/layout=maildir++ Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: Effective uid=60001, gid=231, home=/vhome/mail.vdl/home/cedrict Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: quota: No quota setting - plugin disabled Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: maildir++: root=/vhome/mail.vdl/home/cedrict/mail, index=, indexpvt=, control=/vhome/mail.vdl/home/cedrict/mail/control, inbox=/var/spool/vmail/mail.vdl/test, alt= Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: quota: No quota setting - plugin disabled Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: none: root=, index=, indexpvt=, control=, inbox=, alt= Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: Destination address: test@mail.vdl (source: user@hostname) Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: sieve: Pigeonhole version 0.4.1 initializing Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: sieve: script file /vhome/mail.vdl/home/cedrict/mail/sieve/test not found Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: sieve: user's script /vhome/mail.vdl/home/cedrict/mail/sieve/test doesn't exist (trying default script location instead) Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: sieve: no default script configured for user Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: sieve: user has no valid location for a personal script Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: sieve: no scripts to execute: reverting to default delivery. Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): msgid=201307171811.r6HIBxWe007380@devshed.derytelecom.ca: saved mail to INBOX
Cedric
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux)
iQEVAwUBUeeo4F3r2wJMiz2NAQI3lggAlGqFMg1OkV0m4sei+8DPz8Rn3jxw2uL2 mA48JqZR81QaTNGNTqq61NUPma2d1TUm0ug2dOcsB/NDIPn7kBAo5o0vN+xV2Sk2 tovlSWarOvZjuY02Piut9R5eYY0zVzjIosAsel31jp1Sg3yU0a1v/c1pSUh1uvz3 7wRLeFb2MMluDfse8NBO0CbS4ESEaRlcrBXyWT9p5OHsA2llXXwgDmlMyTnaGg/q 2facChlH26hk630ePYGPOunXmpBUqYrysogyhmXtHGD/TO7S/Rr9+YLmzBvVtaxX ALy/tf2yuLIL2NrDknbLA6PnqvUzC5H1nGQ9DLBsu255SCfYPWMkMA== =7I0n -----END PGP SIGNATURE-----
HI,
I'll try to explain my problem another way just in case.
For message delivery i'm using sendmail/dovecot-lda
The problem is that dovecot-lda is not using the inbox variable pass by dovecot preventing the message to be delivered to the correct file.
Example :
Jul 22 09:42:15 devshed dovecot: auth-worker(24806): Debug: auth(test@mail.vdl): username changed test@mail.vdl -> cedrict Jul 22 09:42:15 devshed dovecot: auth-worker(24806): Debug: auth(cedrict): username changed cedrict -> cedrict@mail.vdl Jul 22 09:42:15 devshed dovecot: auth: Debug: userdb out: USER 1 test@mail.vdl home=/vhome/mail.vdl/home/cedrict index=/vhome/mail.vdl/home/cedrict/mail/index control=/vhome/mail.vdl/home/cedrict/mail/control inbox=/var/spool/vmail/mail.vdl/cedrict layout=maildir++ uid=60001 gid=231 Jul 22 09:42:15 devshed dovecot: lda: Debug: auth input: test@mail.vdl home=/vhome/mail.vdl/home/cedrict index=/vhome/mail.vdl/home/cedrict/mail/index control=/vhome/mail.vdl/home/cedrict/mail/control inbox=/var/spool/vmail/mail.vdl/cedrict layout=maildir++ uid=60001 gid=231 Jul 22 09:42:15 devshed dovecot: lda: Debug: Added userdb setting: plugin/control=/vhome/mail.vdl/home/cedrict/mail/control Jul 22 09:42:15 devshed dovecot: lda: Debug: Added userdb setting: plugin/inbox=/var/spool/vmail/mail.vdl/cedrict Jul 22 09:42:15 devshed dovecot: lda: Debug: Added userdb setting: plugin/index=/vhome/mail.vdl/home/cedrict/mail/index Jul 22 09:42:15 devshed dovecot: lda(test@mail.vdl): Debug: Effective uid=60001, gid=231, home=/vhome/mail.vdl/home/cedrict Jul 22 09:42:15 devshed dovecot: lda(test@mail.vdl): Debug: maildir++: root=/vhome/mail.vdl/home/cedrict/mail, index=, indexpvt=, control=/vhome/mail.vdl/home/cedrict/mail/control, inbox=/var/spool/vmail/mail.vdl/test, alt=
As you can see dovecot set the inbox to inbox=/var/spool/vmail/mail.vdl/cedrict lda part set the inbox to : plugin/inbox=/var/spool/vmail/mail.vdl/cedric But change it back later to inbox=/var/spool/vmail/mail.vdl/test
How can i ensure that the inbox variable stay intact ?
Regards Cedric
Le 2013-07-17 16:43, Cedric a écrit :
Hi,
We are currently moving from linuxconf/dovecot to a dovecot setup with sql support, the problem we currently facing is having a message sent to a aliase delivered to the user email inbox with dovecot-lda, i have created cedrict@mail.vdl and a alias test@mail.vdl, when i send to cedrict@mail.vdl the message is included in the user inbox file, but when i send to test@mail.vdl it should do the same and not create a new created file named test, thank in advance for your help.
# dovecot --version 2.2.4
dovecot.conf auth_debug = yes auth_debug_passwords = yes auth_verbose = yes default_internal_user = root default_login_user = mail disable_plaintext_auth = no first_valid_uid = 100 mail_access_groups = mail users sysadmin popusers mail_location = mbox:%h/mail:LAYOUT=maildir++:INDEX=MEMORY:CONTROL=%h/mail/control:INBOX=/var/spool/vmail/%d/%n mail_max_userip_connections = 40 mail_plugins = " quota sieve" managesieve_notify_capability = mailto managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date ihave mbox_lazy_writes = no passdb { args = /vdl/etc/dovecot/dovecot-sql.conf driver = sql } plugin { sieve = %h/mail/sieve/%n sieve_global_dir = /vdl/etc/dovecot/ sieve_vacation_default_period = 1d sieve_vacation_max_period = 7d } postmaster_address = x@x.x protocols = imap pop3 service auth { unix_listener auth-userdb { mode = 0600 user = popusers } } service imap-login { inet_listener imap { port = 143 } process_min_avail = 4 vsz_limit = 256 M } service pop3-login { inet_listener pop3 { port = 110 } process_min_avail = 16 } ssl = no submission_host = localhost:25 userdb { args = /vdl/etc/dovecot/dovecot-sql.conf driver = sql } protocol imap { mail_plugins = quota imap_quota mail_log notify } protocol pop3 { mail_plugins = quota } protocol lda { mail_plugins = quota sieve }
dovecot-sql.conf password_query = SELECT
concat(s_courriel_utilisateur.utilisateur, '@', s_courriel_domaine.nom) AS user,s_courriel_utilisateur.password as password
FROM s_courriel_utilisateur left join s_courriel_alias on s_courriel_utilisateur.id=s_courriel_alias.utilisateur and s_courriel_alias.archive !=1 ,s_courriel_domaine
WHERE s_courriel_utilisateur.archive !=1
and s_courriel_domaine.archive !=1
and s_courriel_utilisateur.domaine=s_courriel_domaine.id
and s_courriel_domaine.nom = '%d'
and ( s_courriel_utilisateur.utilisateur = '%n' or s_courriel_alias.alias = '%n' )user_query = SELECT
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur) as home,
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/index") as "index",
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/control") as control,
concat("/var/spool/vmail/",s_courriel_domaine.nom,"/",s_courriel_utilisateur.utilisateur) as inbox,
"maildir++" as layout,
s_courriel_utilisateur.uid as uid,s_courriel_domaine.gid as gid
FROM s_courriel_utilisateur left join s_courriel_alias on s_courriel_utilisateur.id=s_courriel_alias.utilisateur and s_courriel_alias.archive !=1 ,s_courriel_domaine
WHERE s_courriel_utilisateur.archive !=1
and s_courriel_domaine.archive !=1
and s_courriel_utilisateur.domaine=s_courriel_domaine.id
and s_courriel_domaine.nom = '%d'
and ( s_courriel_utilisateur.utilisateur = '%n' or s_courriel_alias.alias = '%n' )Transaction debug for cedrict@mail.vdl with message added to file /var/spool/vmail/mail.vdl/cedrict
SELECT concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur) as home, concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/index") as "index", concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/control") as control, concat("/var/spool/vmail/",s_courriel_domaine.nom,"/",s_courriel_utilisateur.utilisateur) as inbox, "maildir++" as layout, s_courriel_utilisateur.uid as uid,s_courriel_domaine.gid as gid FROM s_courriel_utilisateur left join s_courriel_alias on s_courriel_utilisateur.id=s_courriel_alias.utilisateur and s_courriel_alias.archive !=1 ,s_courriel_domaine WHERE s_courriel_utilisateur.archive !=1 and s_courriel_domaine.archive !=1 and s_courriel_utilisateur.domaine=s_courriel_domaine.id and s_courriel_domaine.nom = 'mail.vdl' and ( s_courriel_utilisateur.utilisateur = 'cedrict' or s_courriel_alias.alias = 'cedrict'); +------------------------------+-----------------------------------------+-------------------------------------------+-----------------------------------+-----------+-------+------+
| home | index | control | inbox | layout | uid | gid | +------------------------------+-----------------------------------------+-------------------------------------------+-----------------------------------+-----------+-------+------+
| /vhome/mail.vdl/home/cedrict | /vhome/mail.vdl/home/cedrict/mail/index | /vhome/mail.vdl/home/cedrict/mail/control | /var/spool/vmail/mail.vdl/cedrict | maildir++ | 60001 | 231 | +------------------------------+-----------------------------------------+-------------------------------------------+-----------------------------------+-----------+-------+------+
Jul 17 14:00:56 devshed dovecot: auth: Debug: master in: USER 1 cedrict@mail.vdl service=lda Jul 17 14:00:56 devshed dovecot: auth-worker(7009): Debug: Loading modules from directory: /vdl/lib/dovecot/auth Jul 17 14:00:56 devshed dovecot: auth-worker(7009): Debug: sql(cedrict@mail.vdl): SELECT concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur) as home, concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/index") as "index", concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/control") as control, concat("/var/spool/vmail/",s_courriel_domaine.nom,"/",s_courriel_utilisateur.utilisateur) as inbox, "maildir++" as layout, s_courriel_utilisateur.uid as uid,s_courriel_domaine.gid as gid FROM s_courriel_utilisateur left join s_courriel_alias on s_courriel_utilisateur.id=s_courriel_alias.utilisateur and s_courriel_alias.archive !=1 ,s_courriel_domaine WHERE s_courriel_utilisateur.archive !=1 and s_courriel_domaine.archive !=1 and s_courriel_utilisateur.domaine=s_courriel_domaine.id and s_courriel_domaine.nom = 'mail.vdl' and ( s_courriel_utilisateur.utilisateur = 'cedrict' or s_courriel_alias.alias = 'cedrict' Jul 17 14:00:56 devshed dovecot: auth: Debug: userdb out: USER 1 cedrict@mail.vdl home=/vhome/mail.vdl/home/cedrict index=/vhome/mail.vdl/home/cedrict/mail/index control=/vhome/mail.vdl/home/cedrict/mail/control inbox=/var/spool/vmail/mail.vdl/cedrict layout=maildir++ uid=60001 gid=231 Jul 17 14:00:56 devshed dovecot: lda: Debug: auth input: cedrict@mail.vdl home=/vhome/mail.vdl/home/cedrict index=/vhome/mail.vdl/home/cedrict/mail/index control=/vhome/mail.vdl/home/cedrict/mail/control inbox=/var/spool/vmail/mail.vdl/cedrict layout=maildir++ uid=60001 gid=231 Jul 17 14:00:56 devshed dovecot: lda: Debug: Added userdb setting: plugin/control=/vhome/mail.vdl/home/cedrict/mail/control Jul 17 14:00:56 devshed dovecot: lda: Debug: Added userdb setting: plugin/inbox=/var/spool/vmail/mail.vdl/cedrict Jul 17 14:00:56 devshed dovecot: lda: Debug: Added userdb setting: plugin/index=/vhome/mail.vdl/home/cedrict/mail/index Jul 17 14:00:56 devshed dovecot: lda: Debug: Added userdb setting: plugin/layout=maildir++ Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: Effective uid=60001, gid=231, home=/vhome/mail.vdl/home/cedrict Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: quota: No quota setting - plugin disabled Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: maildir++: root=/vhome/mail.vdl/home/cedrict/mail, index=, indexpvt=, control=/vhome/mail.vdl/home/cedrict/mail/control, inbox=/var/spool/vmail/mail.vdl/cedrict, alt= Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: quota: No quota setting - plugin disabled Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: none: root=, index=, indexpvt=, control=, inbox=, alt= Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: Destination address: cedrict@mail.vdl (source: user@hostname) Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: sieve: Pigeonhole version 0.4.1 initializing Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: sieve: script file /vhome/mail.vdl/home/cedrict/mail/sieve/cedrict not found Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: sieve: user's script /vhome/mail.vdl/home/cedrict/mail/sieve/cedrict doesn't exist (trying default script location instead) Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: sieve: no default script configured for user Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: sieve: user has no valid location for a personal script Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): Debug: sieve: no scripts to execute: reverting to default delivery. Jul 17 14:00:56 devshed dovecot: lda(cedrict@mail.vdl): msgid=201307171800.r6HI0unE007004@devshed.derytelecom.ca: saved mail to INBOX
Transaction debug for alias test@mail.vdl with message added to file /var/spool/vmail/mail.vdl/test
mysql> SELECT concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur) as home, concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/index") as "index", concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/control") as control, concat("/var/spool/vmail/",s_courriel_domaine.nom,"/",s_courriel_utilisateur.utilisateur) as inbox, "maildir++" as layout, s_courriel_utilisateur.uid as uid,s_courriel_domaine.gid as gid FROM s_courriel_utilisateur left join s_courriel_alias on s_courriel_utilisateur.id=s_courriel_alias.utilisateur and s_courriel_alias.archive !=1 ,s_courriel_domaine WHERE s_courriel_utilisateur.archive !=1 and s_courriel_domaine.archive !=1 and s_courriel_utilisateur.domaine=s_courriel_domaine.id and s_courriel_domaine.nom = 'mail.vdl' and ( s_courriel_utilisateur.utilisateur = 'test' or s_courriel_alias.alias = 'test' ); +------------------------------+-----------------------------------------+-------------------------------------------+-----------------------------------+-----------+-------+------+
| home | index | control | inbox | layout | uid | gid | +------------------------------+-----------------------------------------+-------------------------------------------+-----------------------------------+-----------+-------+------+
| /vhome/mail.vdl/home/cedrict | /vhome/mail.vdl/home/cedrict/mail/index | /vhome/mail.vdl/home/cedrict/mail/control | /var/spool/vmail/mail.vdl/cedrict | maildir++ | 60001 | 231 | +------------------------------+-----------------------------------------+-------------------------------------------+-----------------------------------+-----------+-------+------+
1 row in set (0,00 sec)
Jul 17 14:03:10 devshed dovecot: auth-worker(7135): Debug: sql(test@mail.vdl): SELECT concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur) as home, concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/index") as "index", concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/control") as control, concat("/var/spool/vmail/",s_courriel_domaine.nom,"/",s_courriel_utilisateur.utilisateur) as inbox, "maildir++" as layout, s_courriel_utilisateur.uid as uid,s_courriel_domaine.gid as gid FROM s_courriel_utilisateur left join s_courriel_alias on s_courriel_utilisateur.id=s_courriel_alias.utilisateur and s_courriel_alias.archive !=1 ,s_courriel_domaine WHERE s_courriel_utilisateur.archive !=1 and s_courriel_domaine.archive !=1 and s_courriel_utilisateur.domaine=s_courriel_domaine.id and s_courriel_domaine.nom = 'mail.vdl' and ( s_courriel_utilisateur.utilisateur = 'test' or s_courriel_alias.alias = 'test' ) Jul 17 14:03:10 devshed dovecot: auth: Debug: userdb out: USER 1 test@mail.vdl home=/vhome/mail.vdl/home/cedrict index=/vhome/mail.vdl/home/cedrict/mail/index control=/vhome/mail.vdl/home/cedrict/mail/control inbox=/var/spool/vmail/mail.vdl/cedrict layout=maildir++ uid=60001 gid=231 Jul 17 14:03:10 devshed dovecot: lda: Debug: auth input: test@mail.vdl home=/vhome/mail.vdl/home/cedrict index=/vhome/mail.vdl/home/cedrict/mail/index control=/vhome/mail.vdl/home/cedrict/mail/control inbox=/var/spool/vmail/mail.vdl/cedrict layout=maildir++ uid=60001 gid=231 Jul 17 14:03:10 devshed dovecot: lda: Debug: Added userdb setting: plugin/control=/vhome/mail.vdl/home/cedrict/mail/control Jul 17 14:03:10 devshed dovecot: lda: Debug: Added userdb setting: plugin/inbox=/var/spool/vmail/mail.vdl/cedrict Jul 17 14:03:10 devshed dovecot: lda: Debug: Added userdb setting: plugin/index=/vhome/mail.vdl/home/cedrict/mail/index Jul 17 14:03:10 devshed dovecot: lda: Debug: Added userdb setting: plugin/layout=maildir++ Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: Effective uid=60001, gid=231, home=/vhome/mail.vdl/home/cedrict Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: quota: No quota setting - plugin disabled Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: maildir++: root=/vhome/mail.vdl/home/cedrict/mail, index=, indexpvt=, control=/vhome/mail.vdl/home/cedrict/mail/control, inbox=/var/spool/vmail/mail.vdl/test, alt= Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: quota: No quota setting - plugin disabled Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: none: root=, index=, indexpvt=, control=, inbox=, alt= Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: Destination address: test@mail.vdl (source: user@hostname) Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: sieve: Pigeonhole version 0.4.1 initializing Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: sieve: script file /vhome/mail.vdl/home/cedrict/mail/sieve/test not found Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: sieve: user's script /vhome/mail.vdl/home/cedrict/mail/sieve/test doesn't exist (trying default script location instead) Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: sieve: no default script configured for user Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: sieve: user has no valid location for a personal script Jul 17 14:03:10 devshed dovecot: lda(test@mail.vdl): Debug: sieve: no scripts to execute: reverting to default delivery.
I also tried adding the username in the sql query, same problem, there's the debug :
[root@devshed ~]# Jul 17 14:11:59 devshed dovecot: lda: Debug: Loading modules from directory: /vdl/lib/dovecot Jul 17 14:11:59 devshed dovecot: lda: Debug: Module loaded: /vdl/lib/dovecot/lib10_quota_plugin.so Jul 17 14:11:59 devshed dovecot: lda: Debug: Module loaded: /vdl/lib/dovecot/lib90_sieve_plugin.so Jul 17 14:11:59 devshed dovecot: auth: Debug: master in: USER 1 test@mail.vdl service=lda Jul 17 14:11:59 devshed dovecot: auth-worker(7385): Debug: Loading modules from directory: /vdl/lib/dovecot/auth Jul 17 14:11:59 devshed dovecot: auth-worker(7385): Debug: sql(test@mail.vdl): SELECT s_courriel_utilisateur.utilisateur as username, concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur) as home, concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/index") as "index", concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/control") as control, concat("/var/spool/vmail/",s_courriel_domaine.nom,"/",s_courriel_utilisateur.utilisateur) as inbox, "maildir++" as layout, s_courriel_utilisateur.uid as uid,s_courriel_domaine.gid as gid FROM s_courriel_utilisateur left join s_courriel_alias on s_courriel_utilisateur.id=s_courriel_alias.utilisateur and s_courriel_alias.archive !=1 ,s_courriel_domaine WHERE s_courriel_utilisateur.archive !=1 and s_courriel_domaine.archive !=1 and s_courriel_utilisateur.domaine=s_courriel_domaine.id and s_courriel_domaine.nom = 'mail.vdl' and ( s_courriel_utilisateur.utilisateur = 'tes Jul 17 14:11:59 devshed dovecot: auth-worker(7385): Debug: auth(test@mail.vdl): username changed test@mail.vdl -> cedrict@mail.vdl Jul 17 14:11:59 devshed dovecot: auth: Debug: userdb out: USER 1 test@mail.vdl home=/vhome/mail.vdl/home/cedrict index=/vhome/mail.vdl/home/cedrict/mail/index control=/vhome/mail.vdl/home/cedrict/mail/control inbox=/var/spool/vmail/mail.vdl/cedrict layout=maildir++ uid=60001 gid=231 Jul 17 14:11:59 devshed dovecot: lda: Debug: auth input: test@mail.vdl home=/vhome/mail.vdl/home/cedrict index=/vhome/mail.vdl/home/cedrict/mail/index control=/vhome/mail.vdl/home/cedrict/mail/control inbox=/var/spool/vmail/mail.vdl/cedrict layout=maildir++ uid=60001 gid=231 Jul 17 14:11:59 devshed dovecot: lda: Debug: Added userdb setting: plugin/control=/vhome/mail.vdl/home/cedrict/mail/control Jul 17 14:11:59 devshed dovecot: lda: Debug: Added userdb setting: plugin/inbox=/var/spool/vmail/mail.vdl/cedrict Jul 17 14:11:59 devshed dovecot: lda: Debug: Added userdb setting: plugin/index=/vhome/mail.vdl/home/cedrict/mail/index Jul 17 14:11:59 devshed dovecot: lda: Debug: Added userdb setting: plugin/layout=maildir++ Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: Effective uid=60001, gid=231, home=/vhome/mail.vdl/home/cedrict Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: quota: No quota setting - plugin disabled Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: maildir++: root=/vhome/mail.vdl/home/cedrict/mail, index=, indexpvt=, control=/vhome/mail.vdl/home/cedrict/mail/control, inbox=/var/spool/vmail/mail.vdl/test, alt= Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: quota: No quota setting - plugin disabled Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: none: root=, index=, indexpvt=, control=, inbox=, alt= Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: Destination address: test@mail.vdl (source: user@hostname) Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: sieve: Pigeonhole version 0.4.1 initializing Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: sieve: script file /vhome/mail.vdl/home/cedrict/mail/sieve/test not found Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: sieve: user's script /vhome/mail.vdl/home/cedrict/mail/sieve/test doesn't exist (trying default script location instead) Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: sieve: no default script configured for user Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: sieve: user has no valid location for a personal script Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): Debug: sieve: no scripts to execute: reverting to default delivery. Jul 17 14:11:59 devshed dovecot: lda(test@mail.vdl): msgid=201307171811.r6HIBxWe007380@devshed.derytelecom.ca: saved mail to INBOX
Cedric
--
Le 22 juil. 2013 à 16:24, Cedric a écrit :
HI,
I'll try to explain my problem another way just in case.
Hello Cedric,
It's still a bit difficult to be sure of all the details, as it seems that the doveconf -n output and the password_query/user_query you have provided are a bit out of sync with your log excerpts.
So could you please provide that configuration (doveconf -n, password_query/user_query) again, and ensure your log entries are emitted under that configuration?
For message delivery i'm using sendmail/dovecot-lda
Do you mean that you are running commands such as: me$ sendmail cedrict@mail.vdl [...] . me$ and: me$ sendmail test@mail.vdl [...] . me$ and that postfix is configured to deliver those messages thru dovecot-lda?
BTW, how in postfix' main.cf do you invoke dovecot-lda? And could you tell us a bit more about that alias "test@mail.vdl" (or is it "test")?
Finally, could you post the whole log excerpt (including the entries written by both postfix and dovecot) related to the sending of a message to test@mail.vdl?
Thanks, Axel
Hi,
There's the information again :
I use sendmail with dovecot-lda delivery :
Mvirtual, P=/vdl/libexec/dovecot/dovecot-lda, F=lsDFMShP, S=10, R=20/40, A=/vdl/libexec/dovecot/dovecot-lda -d $u@$h
The current query :
user_query = SELECT
s_courriel_utilisateur.utilisateur as user,
s_courriel_utilisateur.utilisateur as username,
s_courriel_domaine.nom as domain,
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur)
as home,
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/index")
as "index",
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/control")
as control,
concat("/var/spool/vmail/",s_courriel_domaine.nom,"/",s_courriel_utilisateur.utilisateur)
as inbox,
"maildir++" as layout,
s_courriel_utilisateur.uid as uid,s_courriel_domaine.gid
as gid
FROM s_courriel_utilisateur left join s_courriel_alias on
s_courriel_utilisateur.id=s_courriel_alias.utilisateur and
s_courriel_alias.archive !=1 ,s_courriel_domaine
WHERE s_courriel_utilisateur.archive !=1
and s_courriel_domaine.archive !=1
and s_courriel_utilisateur.domaine=s_courriel_domaine.id
and s_courriel_domaine.nom = '%Ld'
and ( s_courriel_utilisateur.utilisateur = '%Ln' or
s_courriel_alias.alias = '%Ln' )
The query, including the output :
mysql> SELECT concat(s_courriel_utilisateur.utilisateur,"@",s_courriel_domaine.nom) as user,s_courriel_utilisateur.utilisateur as username,concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur) as home, concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/index") as "index", concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/control") as control, concat("/var/spool/vmail/",s_courriel_domaine.nom,"/",s_courriel_utilisateur.utilisateur) as inbox, "maildir++" as layout, s_courriel_utilisateur.uid as uid,s_courriel_domaine.gid as gid FROM s_courriel_utilisateur left join s_courriel_alias on s_courriel_utilisateur.id=s_courriel_alias.utilisateur and s_courriel_alias.archive !=1 ,s_courriel_domaine WHERE s_courriel_utilisateur.archive !=1 and s_courriel_domaine.archive !=1 and s_courriel_utilisateur.domaine=s_courriel_domaine.id and s_courriel_domaine.nom = 'mail.vdl' and ( s_courriel_utilisateur.utilisateur = 'test' or s_courriel_alias.alias = 'test' )\G; *************************** 1. row *************************** user: cedrict@mail.vdl username: cedrict home: /vhome/mail.vdl/home/cedrict index: /vhome/mail.vdl/home/cedrict/mail/index control: /vhome/mail.vdl/home/cedrict/mail/control inbox: /var/spool/vmail/mail.vdl/cedrict layout: maildir++ uid: 60001
The dovecot log , you can see dovecot lda deliver the message to inbox=/var/spool/vmail/mail.vdl/test and not inbox=/var/spool/vmail/mail.vdl/cedrict
[root@devshed vdl]# Jul 22 13:29:47 devshed sendmail[32409]: dangerous
permissions=40777 on queue directory /var/spool/clientmqueue/
Jul 22 13:29:47 devshed sendmail[32409]: r6MHTlCf032409: from=root,
size=34, class=0, nrcpts=1,
msgid=201307221729.r6MHTlCf032409@devshed.derytelecom.ca,
relay=root@localhost
Jul 22 13:29:47 devshed sendmail[32410]: STARTTLS=server,
relay=devshed.derytelecom.ca [127.0.0.1], version=TLSv1/SSLv3,
verify=NO, cipher=DHE-RSA-AES256-SHA, bits=256/256
Jul 22 13:29:47 devshed sendmail[32409]: STARTTLS=client,
relay=[127.0.0.1], version=TLSv1/SSLv3, verify=FAIL,
cipher=DHE-RSA-AES256-SHA, bits=256/256
Jul 22 13:29:47 devshed sendmail[32410]: r6MHTlQS032410:
from=root@devshed.derytelecom.ca, size=330, class=0, nrcpts=1,
msgid=201307221729.r6MHTlCf032409@devshed.derytelecom.ca, proto=ESMTP,
daemon=MTA-RX, relay=devshed.derytelecom.ca [127.0.0.1]
Jul 22 13:29:47 devshed sendmail[32409]: r6MHTlCf032409:
to=test@mail.vdl, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00,
mailer=relay, pri=30034, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0,
stat=Sent (r6MHTlQS032410 Message accepted for delivery)
Jul 22 13:29:47 devshed dovecot: lda: Debug: Loading modules from
directory: /vdl/lib/dovecot
Jul 22 13:29:47 devshed dovecot: lda: Debug: Module loaded:
/vdl/lib/dovecot/lib10_quota_plugin.so
Jul 22 13:29:47 devshed dovecot: lda: Debug: Module loaded:
/vdl/lib/dovecot/lib90_sieve_plugin.so
Jul 22 13:29:47 devshed dovecot: auth: Debug: master in: USER 1
test@mail.vdl service=lda
Jul 22 13:29:47 devshed dovecot: auth-worker(32406): Debug:
sql(test@mail.vdl): SELECT s_courriel_utilisateur.utilisateur as user,
s_courriel_utilisateur.utilisateur as username, s_courriel_domaine.nom
as domain,
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur)
as home,
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/index")
as "index",
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/control")
as control,
concat("/var/spool/vmail/",s_courriel_domaine.nom,"/",s_courriel_utilisateur.utilisateur)
as inbox, "maildir++" as layout, s_courriel_utilisateur.uid as
uid,s_courriel_domaine.gid as gid FROM s_courriel_utilisateur left
join s_courriel_alias on
s_courriel_utilisateur.id=s_courriel_alias.utilisateur and
s_courriel_alias.archive !=1 ,s_courriel_domaine WHERE
s_courriel_utilisateur.archive !=1 and s_courriel_domaine.archive !=1
and s_courriel_utilisateur.domaine=s_courriel_domaine.id and s_co
Jul 22 13:29:47 devshed dovecot: auth-worker(32406): Debug:
auth(test@mail.vdl): username changed test@mail.vdl -> cedrict
Jul 22 13:29:47 devshed dovecot: auth-worker(32406): Debug:
auth(cedrict): username changed cedrict -> cedrict@mail.vdl
Jul 22 13:29:47 devshed dovecot: auth: Debug: userdb out: USER 1
test@mail.vdl home=/vhome/mail.vdl/home/cedrict
index=/vhome/mail.vdl/home/cedrict/mail/index
control=/vhome/mail.vdl/home/cedrict/mail/control
inbox=/var/spool/vmail/mail.vdl/cedrict layout=maildir++ uid=60001
gid=231
Jul 22 13:29:47 devshed dovecot: lda: Debug: auth input: test@mail.vdl
home=/vhome/mail.vdl/home/cedrict
index=/vhome/mail.vdl/home/cedrict/mail/index
control=/vhome/mail.vdl/home/cedrict/mail/control
inbox=/var/spool/vmail/mail.vdl/cedrict layout=maildir++ uid=60001 gid=231
Jul 22 13:29:47 devshed dovecot: lda: Debug: Added userdb setting:
plugin/control=/vhome/mail.vdl/home/cedrict/mail/control
Jul 22 13:29:47 devshed dovecot: lda: Debug: Added userdb setting:
plugin/inbox=/var/spool/vmail/mail.vdl/cedrict
Jul 22 13:29:47 devshed dovecot: lda: Debug: Added userdb setting:
plugin/index=/vhome/mail.vdl/home/cedrict/mail/index
Jul 22 13:29:47 devshed dovecot: lda: Debug: Added userdb setting:
plugin/layout=maildir++
Jul 22 13:29:47 devshed dovecot: lda(test@mail.vdl): Debug: Effective
uid=60001, gid=231, home=/vhome/mail.vdl/home/cedrict
Jul 22 13:29:47 devshed dovecot: lda(test@mail.vdl): Debug: quota: No
quota setting - plugin disabled
Jul 22 13:29:47 devshed dovecot: lda(test@mail.vdl): Debug: maildir++:
root=/vhome/mail.vdl/home/cedrict/mail, index=, indexpvt=,
control=/vhome/mail.vdl/home/cedrict/mail/control,
inbox=/var/spool/vmail/mail.vdl/test, alt=
Jul 22 13:29:47 devshed dovecot: lda(test@mail.vdl): Debug: quota: No
quota setting - plugin disabled
Jul 22 13:29:47 devshed dovecot: lda(test@mail.vdl): Debug: none: root=,
index=, indexpvt=, control=, inbox=, alt=
Jul 22 13:29:47 devshed dovecot: lda(test@mail.vdl): Debug: Destination
address: test@mail.vdl (source: user@hostname)
Jul 22 13:29:47 devshed dovecot: lda(test@mail.vdl): Debug: sieve:
Pigeonhole version 0.4.1 initializing
Jul 22 13:29:47 devshed dovecot: lda(test@mail.vdl): Debug: sieve:
script file /vhome/mail.vdl/home/cedrict/mail/sieve/test not found
Jul 22 13:29:47 devshed dovecot: lda(test@mail.vdl): Debug: sieve:
user's script /vhome/mail.vdl/home/cedrict/mail/sieve/test doesn't exist
(trying default script location instead)
Jul 22 13:29:47 devshed dovecot: lda(test@mail.vdl): Debug: sieve: no
default script configured for user
Jul 22 13:29:47 devshed dovecot: lda(test@mail.vdl): Debug: sieve: user
has no valid location for a personal script
Jul 22 13:29:47 devshed dovecot: lda(test@mail.vdl): Debug: sieve: no
scripts to execute: reverting to default delivery.
Jul 22 13:29:47 devshed dovecot: lda(test@mail.vdl):
msgid=201307221729.r6MHTlCf032409@devshed.derytelecom.ca: saved mail
to INBOX
Jul 22 13:29:47 devshed sendmail[32412]: r6MHTlQS032410:
to=test@mail.vdl, ctladdr=root@devshed.derytelecom.ca (0/0),
delay=00:00:00, xdelay=00:00:00, mailer=virtual, pri=120330,
relay=mail.vdl, d
Thank in advance.
Le 2013-07-22 12:47, Axel Luttgens a écrit :
Le 22 juil. 2013 à 16:24, Cedric a écrit :
HI,
I'll try to explain my problem another way just in case. Hello Cedric,
It's still a bit difficult to be sure of all the details, as it seems that the doveconf -n output and the password_query/user_query you have provided are a bit out of sync with your log excerpts.
So could you please provide that configuration (doveconf -n, password_query/user_query) again, and ensure your log entries are emitted under that configuration?
For message delivery i'm using sendmail/dovecot-lda Do you mean that you are running commands such as: me$ sendmail cedrict@mail.vdl [...] . me$ and: me$ sendmail test@mail.vdl [...] . me$ and that postfix is configured to deliver those messages thru dovecot-lda?
BTW, how in postfix' main.cf do you invoke dovecot-lda? And could you tell us a bit more about that alias "test@mail.vdl" (or is it "test")?
Finally, could you post the whole log excerpt (including the entries written by both postfix and dovecot) related to the sending of a message to test@mail.vdl?
Thanks, Axel
Le 22 juil. 2013 à 19:31, Cedric a écrit :
Hi,
There's the information again :
I use sendmail with dovecot-lda delivery :
Mvirtual, P=/vdl/libexec/dovecot/dovecot-lda, F=lsDFMShP, S=10, R=20/40, A=/vdl/libexec/dovecot/dovecot-lda -d $u@$h
Ha... So, there are still people using Sendmail for new installations. ;-) Sorry, I don't know why I have thought about postfix. My memories about Sendmail are very, very tiny, so I'll assume the above is correct (doesn't seem too audacious, given the lines with "to=test@mail.vdl ... mailer=virtual" written by Sendmail in the log).
Please find hereafter my quick interpretation of what's happening when sending a message to "test@mail.vdl" (note that the same description should apply for a message to "cedrict@mail.vdl" as well).
The current query :
user_query = SELECT
s_courriel_utilisateur.utilisateur as user, \
According to the query output you provide below, you are replacing here "test@mail.vdl" by "cedrict@mail.vdl"
s_courriel_utilisateur.utilisateur as username, \
and here "test" by "cedrict"
s_courriel_domaine.nom as domain, \
and here "mail.vdl" by NULL? Or something like that. Anyway, those substitutions should explain the "username changed test@mail.vdl -> cedrict" and "cedrict -> cedrict@mail.vdl" infos in the log. The problem is, the effect of such substitutions isn't really defined in a user_query: at best they don't do anything, at worse they may lead to strange interpretations of %n, %u, %d in doevecot.conf.
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur) as home,
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/index") as "index",
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/control") as control,
concat("/var/spool/vmail/",s_courriel_domaine.nom,"/",s_courriel_utilisateur.utilisateur) as inbox, \
Not sure, but I think you are trying to split into three pieces (index, control, inbox) what Dovecot expects to be returned as a single column "mail" (which, when not NULL, overrides mail_location) from a user_query.
"maildir++" as layout, \
Is this OK in the context of a user_query?
s_courriel_utilisateur.uid as uid,s_courriel_domaine.gid as gid \
FROM s_courriel_utilisateur left join s_courriel_alias on s_courriel_utilisateur.id=s_courriel_alias.utilisateur and s_courriel_alias.archive !=1 ,s_courriel_domaine
WHERE s_courriel_utilisateur.archive !=1
and s_courriel_domaine.archive !=1
and s_courriel_utilisateur.domaine=s_courriel_domaine.id
and s_courriel_domaine.nom = '%Ld'
and ( s_courriel_utilisateur.utilisateur = '%Ln' or s_courriel_alias.alias = '%Ln' )The query, including the output :
[...] *************************** 1. row *************************** user: cedrict@mail.vdl username: cedrict home: /vhome/mail.vdl/home/cedrict index: /vhome/mail.vdl/home/cedrict/mail/index control: /vhome/mail.vdl/home/cedrict/mail/control inbox: /var/spool/vmail/mail.vdl/cedrict layout: maildir++ uid: 60001
The dovecot log , you can see dovecot lda deliver the message to inbox=/var/spool/vmail/mail.vdl/test and not inbox=/var/spool/vmail/mail.vdl/cedrict
[root@devshed vdl]# Jul 22 13:29:47 devshed sendmail[32409]: dangerous permissions=40777 on queue directory /var/spool/clientmqueue/ [...] Jul 22 13:29:47 devshed dovecot: auth: Debug: master in: USER 1 test@mail.vdl service=lda [...] Jul 22 13:29:47 devshed dovecot: auth-worker(32406): Debug: auth(test@mail.vdl): username changed test@mail.vdl -> cedrict Jul 22 13:29:47 devshed dovecot: auth-worker(32406): Debug: auth(cedrict): username changed cedrict -> cedrict@mail.vdl Jul 22 13:29:47 devshed dovecot: auth: Debug: userdb out: USER 1 test@mail.vdl home=/vhome/mail.vdl/home/cedrict index=/vhome/mail.vdl/home/cedrict/mail/index control=/vhome/mail.vdl/home/cedrict/mail/control inbox=/var/spool/vmail/mail.vdl/cedrict layout=maildir++ uid=60001 gid=231 Jul 22 13:29:47 devshed dovecot: lda: Debug: auth input: test@mail.vdl home=/vhome/mail.vdl/home/cedrict index=/vhome/mail.vdl/home/cedrict/mail/index control=/vhome/mail.vdl/home/cedrict/mail/control inbox=/var/spool/vmail/mail.vdl/cedrict layout=maildir++ uid=60001 gid=231 Jul 22 13:29:47 devshed dovecot: lda: Debug: Added userdb setting: plugin/control=/vhome/mail.vdl/home/cedrict/mail/control Jul 22 13:29:47 devshed dovecot: lda: Debug: Added userdb setting: plugin/inbox=/var/spool/vmail/mail.vdl/cedrict Jul 22 13:29:47 devshed dovecot: lda: Debug: Added userdb setting: plugin/index=/vhome/mail.vdl/home/cedrict/mail/index Jul 22 13:29:47 devshed dovecot: lda: Debug: Added userdb setting: plugin/layout=maildir++
Note here "plugin/control", "plugin/inbox", "plugin/index" and "plugin/layout": considered as unknown settings and placed into plugin sections.
Jul 22 13:29:47 devshed dovecot: lda(test@mail.vdl): Debug: Effective uid=60001, gid=231, home=/vhome/mail.vdl/home/cedrict Jul 22 13:29:47 devshed dovecot: lda(test@mail.vdl): Debug: quota: No quota setting - plugin disabled Jul 22 13:29:47 devshed dovecot: lda(test@mail.vdl): Debug: maildir++: root=/vhome/mail.vdl/home/cedrict/mail, index=, indexpvt=, control=/vhome/mail.vdl/home/cedrict/mail/control, inbox=/var/spool/vmail/mail.vdl/test, alt=
The home directory is thus the one provided without ambiguity by the user_query. See below for the control and the inbox.
Jul 22 13:29:47 devshed dovecot: lda(test@mail.vdl): Debug: quota: No quota setting - plugin disabled Jul 22 13:29:47 devshed dovecot: lda(test@mail.vdl): Debug: none: root=, index=, indexpvt=, control=, inbox=, alt= Jul 22 13:29:47 devshed dovecot: lda(test@mail.vdl): Debug: Destination address: test@mail.vdl (source: user@hostname)
Dovecot is now a bit lost and seems to revert to "reasonable" guesses: the domain seems to have been lost (hence the hostname), but the original user ("test") is still at hand.
So, there was still a way to find out something, with the help of that line in dovecot.conf:
mail_location = mbox:%h/mail:LAYOUT=maildir++:INDEX=MEMORY:CONTROL=%h/mail/control:INBOX=/var/spool/vmail/%d/%n
[...]
Thank in advance.
HTH, Axel
Hi,
Ok thank for the interpretation, we used sendmail the last 16 years and I'm trying to migrate a old linuxconf/imapd setup here. Le 2013-07-22 18:02, Axel Luttgens a écrit :
Le 22 juil. 2013 à 19:31, Cedric a écrit :
Hi,
There's the information again :
I use sendmail with dovecot-lda delivery :
Mvirtual, P=/vdl/libexec/dovecot/dovecot-lda, F=lsDFMShP, S=10, R=20/40, A=/vdl/libexec/dovecot/dovecot-lda -d $u@$h Ha... So, there are still people using Sendmail for new installations. ;-) Sorry, I don't know why I have thought about postfix. My memories about Sendmail are very, very tiny, so I'll assume the above is correct (doesn't seem too audacious, given the lines with "to=test@mail.vdl ... mailer=virtual" written by Sendmail in the log).
Please find hereafter my quick interpretation of what's happening when sending a message to "test@mail.vdl" (note that the same description should apply for a message to "cedrict@mail.vdl" as well).
The current query :
user_query = SELECT
s_courriel_utilisateur.utilisateur as user,
According to the query output you provide below, you are replacing here "test@mail.vdl" by "cedrict@mail.vdl"s_courriel_utilisateur.utilisateur as username, \
and here "test" by "cedrict"
s_courriel_domaine.nom as domain, \
and here "mail.vdl" by NULL? Or something like that. Anyway, those substitutions should explain the "username changed test@mail.vdl -> cedrict" and "cedrict -> cedrict@mail.vdl" infos in the log. The problem is, the effect of such substitutions isn't really defined in a user_query: at best they don't do anything, at worse they may lead to strange interpretations of %n, %u, %d in doevecot.conf.
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur) as home,
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/index") as "index",
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/control") as control,
concat("/var/spool/vmail/",s_courriel_domaine.nom,"/",s_courriel_utilisateur.utilisateur) as inbox,
Not sure, but I think you are trying to split into three pieces (index, control, inbox) what Dovecot expects to be returned as a single column "mail" (which, when not NULL, overrides mail_location) from a user_query."maildir++" as layout, \
Is this OK in the context of a user_query? nope it was all in hope to resolve the issue.
s_courriel_utilisateur.uid as uid,s_courriel_domaine.gid as gid \
FROM s_courriel_utilisateur left join s_courriel_alias on s_courriel_utilisateur.id=s_courriel_alias.utilisateur and s_courriel_alias.archive !=1 ,s_courriel_domaine
WHERE s_courriel_utilisateur.archive !=1
and s_courriel_domaine.archive !=1
and s_courriel_utilisateur.domaine=s_courriel_domaine.id
and s_courriel_domaine.nom = '%Ld'
and ( s_courriel_utilisateur.utilisateur = '%Ln' or s_courriel_alias.alias = '%Ln' )The query, including the output :
[...] *************************** 1. row *************************** user: cedrict@mail.vdl username: cedrict home: /vhome/mail.vdl/home/cedrict index: /vhome/mail.vdl/home/cedrict/mail/index control: /vhome/mail.vdl/home/cedrict/mail/control inbox: /var/spool/vmail/mail.vdl/cedrict layout: maildir++ uid: 60001
The dovecot log , you can see dovecot lda deliver the message to inbox=/var/spool/vmail/mail.vdl/test and not inbox=/var/spool/vmail/mail.vdl/cedrict
[root@devshed vdl]# Jul 22 13:29:47 devshed sendmail[32409]: dangerous permissions=40777 on queue directory /var/spool/clientmqueue/ [...] Jul 22 13:29:47 devshed dovecot: auth: Debug: master in: USER 1 test@mail.vdl service=lda [...] Jul 22 13:29:47 devshed dovecot: auth-worker(32406): Debug: auth(test@mail.vdl): username changed test@mail.vdl -> cedrict Jul 22 13:29:47 devshed dovecot: auth-worker(32406): Debug: auth(cedrict): username changed cedrict -> cedrict@mail.vdl Jul 22 13:29:47 devshed dovecot: auth: Debug: userdb out: USER 1 test@mail.vdl home=/vhome/mail.vdl/home/cedrict index=/vhome/mail.vdl/home/cedrict/mail/index control=/vhome/mail.vdl/home/cedrict/mail/control inbox=/var/spool/vmail/mail.vdl/cedrict layout=maildir++ uid=60001 gid=231 Jul 22 13:29:47 devshed dovecot: lda: Debug: auth input: test@mail.vdl home=/vhome/mail.vdl/home/cedrict index=/vhome/mail.vdl/home/cedrict/mail/index control=/vhome/mail.vdl/home/cedrict/mail/control inbox=/var/spool/vmail/mail.vdl/cedrict layout=maildir++ uid=60001 gid=231 Jul 22 13:29:47 devshed dovecot: lda: Debug: Added userdb setting: plugin/control=/vhome/mail.vdl/home/cedrict/mail/control Jul 22 13:29:47 devshed dovecot: lda: Debug: Added userdb setting: plugin/inbox=/var/spool/vmail/mail.vdl/cedrict Jul 22 13:29:47 devshed dovecot: lda: Debug: Added userdb setting: plugin/index=/vhome/mail.vdl/home/cedrict/mail/index Jul 22 13:29:47 devshed dovecot: lda: Debug: Added userdb setting: plugin/layout=maildir++
Note here "plugin/control", "plugin/inbox", "plugin/index" and "plugin/layout": considered as unknown settings and placed into plugin sections.
Jul 22 13:29:47 devshed dovecot: lda(test@mail.vdl): Debug: Effective uid=60001, gid=231, home=/vhome/mail.vdl/home/cedrict Jul 22 13:29:47 devshed dovecot: lda(test@mail.vdl): Debug: quota: No quota setting - plugin disabled Jul 22 13:29:47 devshed dovecot: lda(test@mail.vdl): Debug: maildir++: root=/vhome/mail.vdl/home/cedrict/mail, index=, indexpvt=, control=/vhome/mail.vdl/home/cedrict/mail/control, inbox=/var/spool/vmail/mail.vdl/test, alt= The home directory is thus the one provided without ambiguity by the user_query. See below for the control and the inbox.
Jul 22 13:29:47 devshed dovecot: lda(test@mail.vdl): Debug: quota: No quota setting - plugin disabled Jul 22 13:29:47 devshed dovecot: lda(test@mail.vdl): Debug: none: root=, index=, indexpvt=, control=, inbox=, alt= Jul 22 13:29:47 devshed dovecot: lda(test@mail.vdl): Debug: Destination address: test@mail.vdl (source: user@hostname) Dovecot is now a bit lost and seems to revert to "reasonable" guesses: the domain seems to have been lost (hence the hostname), but the original user ("test") is still at hand.
So, there was still a way to find out something, with the help of that line in dovecot.conf:
mail_location = mbox:%h/mail:LAYOUT=maildir++:INDEX=MEMORY:CONTROL=%h/mail/control:INBOX=/var/spool/vmail/%d/%n
Below i provided two differents sql attempt, your input on how to make dovecot lda understand it should deliver the mail to the correct file are welcome
[...]
Thank in advance. HTH, Axel
There's a new debug output fixing the domain entry
The querry i pasted seem to be wrong for a previous configuration there's the correct one :
mysql> SELECT concat(s_courriel_utilisateur.utilisateur,"@",s_courriel_domaine.nom) as user,s_courriel_utilisateur.utilisateur as username,s_courriel_domaine.nom as domain,concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur) as home, concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/index") as "index", concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/control") as control, concat("/var/spool/vmail/",s_courriel_domaine.nom,"/",s_courriel_utilisateur.utilisateur) as inbox, "maildir++" as layout, s_courriel_utilisateur.uid as uid,s_courriel_domaine.gid as gid FROM s_courriel_utilisateur left join s_courriel_alias on s_courriel_utilisateur.id=s_courriel_alias.utilisateur and s_courriel_alias.archive !=1 ,s_courriel_domaine WHERE s_courriel_utilisateur.archive !=1 and s_courriel_domaine.archive !=1 and s_courriel_utilisateur.domaine=s_courriel_domaine.id and s_courriel_domaine.nom = 'mail.vdl' and ( s_courriel_utilisateur.utilisateur = 'test' or s_courriel_alias.alias = 'test' )\G; *************************** 1. row *************************** user: cedrict@mail.vdl username: cedrict domain: mail.vdl home: /vhome/mail.vdl/home/cedrict index: /vhome/mail.vdl/home/cedrict/mail/index control: /vhome/mail.vdl/home/cedrict/mail/control inbox: /var/spool/vmail/mail.vdl/cedrict layout: maildir++ uid: 60001 gid: 231
Jul 22 20:27:05 devshed sendmail[11778]: r6N0R5bq011778: from=root,
size=36, class=0, nrcpts=1,
msgid=201307230027.r6N0R5bq011778@devshed.derytelecom.ca,
relay=root@localhost
Jul 22 20:27:05 devshed sendmail[11779]: STARTTLS=server,
relay=devshed.derytelecom.ca [127.0.0.1], version=TLSv1/SSLv3,
verify=NO, cipher=DHE-RSA-AES256-SHA, bits=256/256
Jul 22 20:27:05 devshed sendmail[11778]: STARTTLS=client,
relay=[127.0.0.1], version=TLSv1/SSLv3, verify=FAIL,
cipher=DHE-RSA-AES256-SHA, bits=256/256
Jul 22 20:27:05 devshed sendmail[11779]: r6N0R5hL011779:
from=root@devshed.derytelecom.ca, size=332, class=0, nrcpts=1,
msgid=201307230027.r6N0R5bq011778@devshed.derytelecom.ca, proto=ESMTP,
daemon=MTA-RX, relay=devshed.derytelecom.ca [127.0.0.1]
Jul 22 20:27:05 devshed sendmail[11778]: r6N0R5bq011778:
to=test@mail.vdl, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00,
mailer=relay, pri=30036, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0,
stat=Sent (r6N0R5hL011779 Message accepted for delivery)
Jul 22 20:27:05 devshed dovecot: lda: Debug: Loading modules from
directory: /vdl/lib/dovecot
Jul 22 20:27:05 devshed dovecot: lda: Debug: Module loaded:
/vdl/lib/dovecot/lib10_quota_plugin.so
Jul 22 20:27:05 devshed dovecot: lda: Debug: Module loaded:
/vdl/lib/dovecot/lib90_sieve_plugin.so
Jul 22 20:27:05 devshed dovecot: auth: Debug: master in: USER 1
test@mail.vdl service=lda
Jul 22 20:27:05 devshed dovecot: auth-worker(11783): Debug: Loading
modules from directory: /vdl/lib/dovecot/auth
Jul 22 20:27:05 devshed dovecot: auth-worker(11783): Debug:
sql(test@mail.vdl): SELECT
concat(s_courriel_utilisateur.utilisateur,'@',s_courriel_domaine.nom) as
user, s_courriel_utilisateur.utilisateur as username,
s_courriel_domaine.nom as domain,
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur)
as home,
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/index")
as "index",
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur,"/mail/control")
as control,
concat("/var/spool/vmail/",s_courriel_domaine.nom,"/",s_courriel_utilisateur.utilisateur)
as inbox, "maildir++" as layout, s_courriel_utilisateur.uid as
uid,s_courriel_domaine.gid as gid FROM s_courriel_utilisateur left
join s_courriel_alias on
s_courriel_utilisateur.id=s_courriel_alias.utilisateur and
s_courriel_alias.archive !=1 ,s_courriel_domaine WHERE
s_courriel_utilisateur.archive !=1 and s_courriel_domaine.archive !=1
and s_courriel_utilisateur.dom
Jul 22 20:27:06 devshed dovecot: auth-worker(11783): Debug:
auth(test@mail.vdl): username changed test@mail.vdl -> cedrict@mail.vdl
Jul 22 20:27:06 devshed dovecot: auth: Debug: userdb out: USER 1
test@mail.vdl home=/vhome/mail.vdl/home/cedrict
index=/vhome/mail.vdl/home/cedrict/mail/index
control=/vhome/mail.vdl/home/cedrict/mail/control
inbox=/var/spool/vmail/mail.vdl/cedrict layout=maildir++ uid=60001
gid=231
Jul 22 20:27:06 devshed dovecot: lda: Debug: auth input: test@mail.vdl
home=/vhome/mail.vdl/home/cedrict
index=/vhome/mail.vdl/home/cedrict/mail/index
control=/vhome/mail.vdl/home/cedrict/mail/control
inbox=/var/spool/vmail/mail.vdl/cedrict layout=maildir++ uid=60001 gid=231
Jul 22 20:27:06 devshed dovecot: lda: Debug: Added userdb setting:
plugin/control=/vhome/mail.vdl/home/cedrict/mail/control
Jul 22 20:27:06 devshed dovecot: lda: Debug: Added userdb setting:
plugin/inbox=/var/spool/vmail/mail.vdl/cedrict
Jul 22 20:27:06 devshed dovecot: lda: Debug: Added userdb setting:
plugin/index=/vhome/mail.vdl/home/cedrict/mail/index
Jul 22 20:27:06 devshed dovecot: lda: Debug: Added userdb setting:
plugin/layout=maildir++
Jul 22 20:27:06 devshed dovecot: lda(test@mail.vdl): Debug: Effective
uid=60001, gid=231, home=/vhome/mail.vdl/home/cedrict
Jul 22 20:27:06 devshed dovecot: lda(test@mail.vdl): Debug: quota: No
quota setting - plugin disabled
Jul 22 20:27:06 devshed dovecot: lda(test@mail.vdl): Debug: maildir++:
root=/vhome/mail.vdl/home/cedrict/mail, index=, indexpvt=,
control=/vhome/mail.vdl/home/cedrict/mail/control,
inbox=/var/spool/vmail/mail.vdl/test, alt=
Jul 22 20:27:06 devshed dovecot: lda(test@mail.vdl): Debug: quota: No
quota setting - plugin disabled
Jul 22 20:27:06 devshed dovecot: lda(test@mail.vdl): Debug: none: root=,
index=, indexpvt=, control=, inbox=, alt=
Jul 22 20:27:06 devshed dovecot: lda(test@mail.vdl): Debug: Destination
address: test@mail.vdl (source: user@hostname)
Jul 22 20:27:06 devshed dovecot: lda(test@mail.vdl): Debug: sieve:
Pigeonhole version 0.4.1 initializing
Jul 22 20:27:06 devshed dovecot: lda(test@mail.vdl): Debug: sieve:
script file /vhome/mail.vdl/home/cedrict/mail/sieve/test not found
Jul 22 20:27:06 devshed dovecot: lda(test@mail.vdl): Debug: sieve:
user's script /vhome/mail.vdl/home/cedrict/mail/sieve/test doesn't exist
(trying default script location instead)
Jul 22 20:27:06 devshed dovecot: lda(test@mail.vdl): Debug: sieve: no
default script configured for user
Jul 22 20:27:06 devshed dovecot: lda(test@mail.vdl): Debug: sieve: user
has no valid location for a personal script
Jul 22 20:27:06 devshed dovecot: lda(test@mail.vdl): Debug: sieve: no
scripts to execute: reverting to default delivery.
Jul 22 20:27:06 devshed dovecot: lda(test@mail.vdl):
msgid=201307230027.r6N0R5bq011778@devshed.derytelecom.ca: saved mail
to INBOX
Jul 22 20:27:06 devshed sendmail[11781]: r6N0R5hL011779:
to=test@mail.vdl, ctladdr=root@devshed.derytelecom.ca (0/0),
delay=00:00:01, xdelay=00:00:01, mailer=virtual, pri=120332,
relay=mail.vdl, dsn=2.0.0, stat=Sent
There's a second config with without domain,maildir,control or user
mysql> SELECT concat(s_courriel_utilisateur.utilisateur,'@',s_courriel_domaine.nom) as user, concat("/var/spool/vmail/",s_courriel_domaine.nom,"/",s_courriel_utilisateur.utilisateur) as inbox, concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur) as home, s_courriel_utilisateur.uid as uid,s_courriel_domaine.gid as gid FROM s_courriel_utilisateur left join s_courriel_alias on s_courriel_utilisateur.id=s_courriel_alias.utilisateur and s_courriel_alias.archive !=1 ,s_courriel_domaine WHERE s_courriel_utilisateur.archive !=1 and s_courriel_domaine.archive !=1 and s_courriel_utilisateur.domaine=s_courriel_domaine.id and s_courriel_domaine.nom = 'mail.vdl' and ( s_courriel_utilisateur.utilisateur = 'test' or s_courriel_alias.alias = 'test' )\G; *************************** 1. row *************************** user: cedrict@mail.vdl inbox: /var/spool/vmail/mail.vdl/cedrict home: /vhome/mail.vdl/home/cedrict uid: 60001 gid: 231 1 row in set (0,54 sec)
Jul 22 20:39:22 devshed dovecot: auth: Debug: master in: USER 1
test@mail.vdl service=lda
Jul 22 20:39:22 devshed dovecot: auth-worker(12131): Debug:
sql(test@mail.vdl): SELECT
concat(s_courriel_utilisateur.utilisateur,'@',s_courriel_domaine.nom) as
user,
concat("/var/spool/vmail/",s_courriel_domaine.nom,"/",s_courriel_utilisateur.utilisateur)
as inbox,
concat("/vhome/",s_courriel_domaine.nom,"/home/",s_courriel_utilisateur.utilisateur)
as home, s_courriel_utilisateur.uid as uid,s_courriel_domaine.gid as gid
FROM s_courriel_utilisateur left join s_courriel_alias on
s_courriel_utilisateur.id=s_courriel_alias.utilisateur and
s_courriel_alias.archive !=1 ,s_courriel_domaine WHERE
s_courriel_utilisateur.archive !=1 and s_courriel_domaine.archive !=1
and s_courriel_utilisateur.domaine=s_courriel_domaine.id and
s_courriel_domaine.nom = 'mail.vdl' and (
s_courriel_utilisateur.utilisateur = 'test' or s_courriel_alias.alias =
'test' )
Jul 22 20:39:22 devshed dovecot: auth-worker(12131): Debug:
auth(test@mail.vdl): username changed test@mail.vdl -> cedrict@mail.vdl
Jul 22 20:39:22 devshed dovecot: auth: Debug: userdb out: USER 1
test@mail.vdl inbox=/var/spool/vmail/mail.vdl/cedrict
home=/vhome/mail.vdl/home/cedrict uid=60001 gid=231
Jul 22 20:39:22 devshed dovecot: lda: Debug: auth input: test@mail.vdl
inbox=/var/spool/vmail/mail.vdl/cedrict
home=/vhome/mail.vdl/home/cedrict uid=60001 gid=231
Jul 22 20:39:22 devshed dovecot: lda: Debug: Added userdb setting:
plugin/inbox=/var/spool/vmail/mail.vdl/cedrict
Jul 22 20:39:22 devshed dovecot: lda(test@mail.vdl): Debug: Effective
uid=60001, gid=231, home=/vhome/mail.vdl/home/cedrict
Jul 22 20:39:22 devshed dovecot: lda(test@mail.vdl): Debug: quota: No
quota setting - plugin disabled
Jul 22 20:39:22 devshed dovecot: lda(test@mail.vdl): Debug: maildir++:
root=/vhome/mail.vdl/home/cedrict/mail, index=, indexpvt=,
control=/vhome/mail.vdl/home/cedrict/mail/control,
inbox=/var/spool/vmail/mail.vdl/test, alt=
Jul 22 20:39:22 devshed dovecot: lda(test@mail.vdl): Debug: quota: No
quota setting - plugin disabled
Jul 22 20:39:22 devshed dovecot: lda(test@mail.vdl): Debug: none: root=,
index=, indexpvt=, control=, inbox=, alt=
Jul 22 20:39:22 devshed dovecot: lda(test@mail.vdl): Debug: Destination
address: test@mail.vdl (source: user@hostname)
Jul 22 20:39:22 devshed dovecot: lda(test@mail.vdl): Debug: sieve:
Pigeonhole version 0.4.1 initializing
Jul 22 20:39:22 devshed dovecot: lda(test@mail.vdl): Debug: sieve:
script file /vhome/mail.vdl/home/cedrict/mail/sieve/test not found
Jul 22 20:39:22 devshed dovecot: lda(test@mail.vdl): Debug: sieve:
user's script /vhome/mail.vdl/home/cedrict/mail/sieve/test doesn't exist
(trying default script location instead)
Jul 22 20:39:22 devshed dovecot: lda(test@mail.vdl): Debug: sieve: no
default script configured for user
Jul 22 20:39:22 devshed dovecot: lda(test@mail.vdl): Debug: sieve: user
has no valid location for a personal script
Jul 22 20:39:22 devshed dovecot: lda(test@mail.vdl): Debug: sieve: no
scripts to execute: reverting to default delivery.
Jul 22 20:39:22 devshed dovecot: lda(test@mail.vdl):
msgid=201307230039.r6N0dLKl012153@devshed.derytelecom.ca: saved mail
to INBOX
Jul 22 20:39:22 devshed sendmail[12156]: r6N0dL0O012154:
to=test@mail.vdl, ctladdr=root@devshed.derytelecom.ca (0/0),
delay=00:00:00, xdelay=00:00:00, mailer=virtual, pri=120329,
relay=mail.vdl, dsn=2.0.0, stat=Sent
Thank in advance Cedric
Le 23 juil. 2013 à 02:41, Cedric a écrit :
Hi,
Ok thank for the interpretation, we used sendmail the last 16 years and I'm trying to migrate a old linuxconf/imapd setup here. [...] Below i provided two differents sql attempt, your input on how to make dovecot lda understand it should deliver the mail to the correct file are welcome [...] There's a new debug output fixing the domain entry
The querry i pasted seem to be wrong for a previous configuration there's the correct one :
[...] *************************** 1. row *************************** user: cedrict@mail.vdl username: cedrict domain: mail.vdl home: /vhome/mail.vdl/home/cedrict index: /vhome/mail.vdl/home/cedrict/mail/index control: /vhome/mail.vdl/home/cedrict/mail/control inbox: /var/spool/vmail/mail.vdl/cedrict layout: maildir++ uid: 60001 gid: 231
[...] *************************** 1. row *************************** user: cedrict@mail.vdl inbox: /var/spool/vmail/mail.vdl/cedrict home: /vhome/mail.vdl/home/cedrict uid: 60001 gid: 231 1 row in set (0,54 sec)
[...]
Hello Cédric,
In both cases, your queries provide sufficient info for overriding or for providing a full substitute to mail_home (left empty in your dovecot.conf), but fail to do the same for mail_location.
Perhaps could you try something like this:
SELECT
concat(
s_courriel_utilisateur.utilisateur,
'@',
s_courriel_domaine.nom
) AS user,
concat(
'mbox:~/mail:LAYOUT=maildir++:INDEX=MEMORY:CONTROL=~/mail/control:INBOX=/var/spool/vmail/',
s_courriel_domaine.nom,
'/',
s_courriel_utilisateur.utilisateur
) AS mail,
concat(
"/vhome/",
s_courriel_domaine.nom,
"/home/",
s_courriel_utilisateur.utilisateur
) AS home,
s_courriel_utilisateur.uid AS uid,
s_courriel_domaine.gid AS gid
FROM
[...]
Not sure whether you still need the "AS user" part, but it should not hurt with such a query.
More info at:
http://wiki2.dovecot.org/UserDatabase
http://wiki2.dovecot.org/AuthDatabase/SQL
HTH, Axel
Hi,
Thank you,it fixed the issue i had.
Regards Cedric
Le 2013-07-23 03:49, Axel Luttgens a écrit :
Le 23 juil. 2013 à 02:41, Cedric a écrit :
Hi,
Ok thank for the interpretation, we used sendmail the last 16 years and I'm trying to migrate a old linuxconf/imapd setup here. [...] Below i provided two differents sql attempt, your input on how to make dovecot lda understand it should deliver the mail to the correct file are welcome [...] There's a new debug output fixing the domain entry
The querry i pasted seem to be wrong for a previous configuration there's the correct one :
[...] *************************** 1. row *************************** user:cedrict@mail.vdl username: cedrict domain: mail.vdl home: /vhome/mail.vdl/home/cedrict index: /vhome/mail.vdl/home/cedrict/mail/index control: /vhome/mail.vdl/home/cedrict/mail/control inbox: /var/spool/vmail/mail.vdl/cedrict layout: maildir++ uid: 60001 gid: 231
[...] *************************** 1. row *************************** user:cedrict@mail.vdl inbox: /var/spool/vmail/mail.vdl/cedrict home: /vhome/mail.vdl/home/cedrict uid: 60001 gid: 231 1 row in set (0,54 sec)
[...] Hello Cédric,
In both cases, your queries provide sufficient info for overriding or for providing a full substitute to mail_home (left empty in your dovecot.conf), but fail to do the same for mail_location.
Perhaps could you try something like this:
SELECT concat( s_courriel_utilisateur.utilisateur, '@', s_courriel_domaine.nom ) AS user, concat( 'mbox:~/mail:LAYOUT=maildir++:INDEX=MEMORY:CONTROL=~/mail/control:INBOX=/var/spool/vmail/', s_courriel_domaine.nom, '/', s_courriel_utilisateur.utilisateur ) AS mail, concat( "/vhome/", s_courriel_domaine.nom, "/home/", s_courriel_utilisateur.utilisateur ) AS home, s_courriel_utilisateur.uid AS uid, s_courriel_domaine.gid AS gid FROM [...]
Not sure whether you still need the "AS user" part, but it should not hurt with such a query.
More info at:
http://wiki2.dovecot.org/UserDatabase http://wiki2.dovecot.org/AuthDatabase/SQL
HTH, Axel
participants (3)
-
Axel Luttgens
-
Cedric
-
Steffen Kaiser