[Dovecot] Dovecot 2.2.4/sendmail with sql user and aliases

Cedric cedrict at derytelecom.ca
Mon Jul 22 20:31:03 EEST 2013


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 at 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 at 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 at devshed.derytelecom.ca>, 
relay=root at 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 at devshed.derytelecom.ca>, size=330, class=0, nrcpts=1, 
msgid=<201307221729.r6MHTlCf032409 at 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 at 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 at mail.vdl   service=lda
Jul 22 13:29:47 devshed dovecot: auth-worker(32406): Debug: 
sql(test at 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 at mail.vdl): username changed test at mail.vdl -> cedrict
Jul 22 13:29:47 devshed dovecot: auth-worker(32406): Debug: 
auth(cedrict): username changed cedrict -> cedrict at mail.vdl
Jul 22 13:29:47 devshed dovecot: auth: Debug: userdb out: USER 1       
test at 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 at 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 at mail.vdl): Debug: Effective 
uid=60001, gid=231, home=/vhome/mail.vdl/home/cedrict
Jul 22 13:29:47 devshed dovecot: lda(test at mail.vdl): Debug: quota: No 
quota setting - plugin disabled
Jul 22 13:29:47 devshed dovecot: lda(test at 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 at mail.vdl): Debug: quota: No 
quota setting - plugin disabled
Jul 22 13:29:47 devshed dovecot: lda(test at mail.vdl): Debug: none: root=, 
index=, indexpvt=, control=, inbox=, alt=
Jul 22 13:29:47 devshed dovecot: lda(test at mail.vdl): Debug: Destination 
address: test at mail.vdl (source: user at hostname)
Jul 22 13:29:47 devshed dovecot: lda(test at mail.vdl): Debug: sieve: 
Pigeonhole version 0.4.1 initializing
Jul 22 13:29:47 devshed dovecot: lda(test at 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 at 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 at mail.vdl): Debug: sieve: no 
default script configured for user
Jul 22 13:29:47 devshed dovecot: lda(test at mail.vdl): Debug: sieve: user 
has no valid location for a personal script
Jul 22 13:29:47 devshed dovecot: lda(test at mail.vdl): Debug: sieve: no 
scripts to execute: reverting to default delivery.
Jul 22 13:29:47 devshed dovecot: lda(test at mail.vdl): 
msgid=<201307221729.r6MHTlCf032409 at devshed.derytelecom.ca>: saved mail 
to INBOX
Jul 22 13:29:47 devshed sendmail[32412]: r6MHTlQS032410: 
to=<test at mail.vdl>, ctladdr=<root at 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 at mail.vdl
> 	[...]
> 	.
> 	me$
> and:
> 	me$ sendmail test at 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 at 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 at mail.vdl?
>
> Thanks,
> Axel
>




More information about the dovecot mailing list