<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.E-MailFormatvorlage17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.E-MailFormatvorlage18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Some log-entries:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:34 mail cyrus/imap[14563]: sql canonuser plugin STARTING<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:34 mail cyrus/imap[14563]: sql canonuser plugin using mysql engine with select: select mailbox_name from mailbox_aliases where mailbox_alias='%u<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>' or mailbox_alias='%u@%r'<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:34 mail cyrus/imap[14563]: sql canonuser plugin STARTING<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:34 mail cyrus/imap[14563]: sql canonuser plugin using mysql engine with select: select mailbox_name from mailbox_aliases where mailbox_alias='%u<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>' or mailbox_alias='%u@%r'<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:34 mail cyrus/imap[14563]: sql auxprop plugin using mysql engine<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:49 mail cyrus/imap[14563]: canonusersql START LOOKUP<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:49 mail cyrus/imap[14563]: canonusersql plugin Parse the username webmaster@anywhere.local<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:49 mail cyrus/imap[14563]: canonusersql plugin: userin: webmaster@anywhere.local; user_realm=mail<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:49 mail cyrus/imap[14563]: canonusersql plugin create statement from webmaster@anywhere.local webmaster@anywhere.local mail<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:49 mail cyrus/imap[14563]: canonuersql plugin doing query select mailbox_name from mailbox_aliases where mailbox_alias='webmaster@anywhere.local' or mailbox_alias='webmaster@anywhere.local@mail';<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:49 mail cyrus/imap[14563]: canonusersql plugin done: lars@test.local (len 15)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:49 mail cyrus/imap[14563]: canonuersql plugin lookup done: out_user: lars@test.local, out_ulen: 15<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:49 mail cyrus/imap[14563]: sql plugin Parse the username lars@test.local<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:49 mail cyrus/imap[14563]: sql plugin try and connect to a host<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:49 mail cyrus/imap[14563]: sql plugin trying to open db 'mail' on host 'localhost'<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:49 mail cyrus/imap[14563]: sql plugin Parse the username lars@test.local<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:49 mail cyrus/imap[14563]: sql plugin try and connect to a host<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:49 mail cyrus/imap[14563]: sql plugin trying to open db 'mail' on host 'localhost'<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:49 mail cyrus/imap[14563]: canonusersql START LOOKUP<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:49 mail cyrus/imap[14563]: canonusersql plugin Parse the username lars@test.local<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:49 mail cyrus/imap[14563]: canonusersql plugin: userin: lars@test.local; user_realm=mail<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:49 mail cyrus/imap[14563]: canonusersql plugin create statement from lars@test.local lars@test.local mail<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:49 mail cyrus/imap[14563]: canonuersql plugin doing query select mailbox_name from mailbox_aliases where mailbox_alias='lars@test.local' or mailbox_alias='lars@test.local@mail';<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:49 mail cyrus/imap[14563]: canonusersql plugin done: webmaster@test.local (len 20)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:49 mail cyrus/imap[14563]: canonuersql plugin lookup done: out_user: webmaster@test.local, out_ulen: 20<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:49 mail cyrus/imap[14563]: sql plugin Parse the username webmaster@test.local<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:49 mail cyrus/imap[14563]: sql plugin create statement from userPassword webmaster test.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:49 mail cyrus/imap[14563]: sql plugin doing query select mailbox_password from mailbox where mailbox_name='webmaster' or mailbox_name='webmaster@test.';<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:49 mail cyrus/imap[14563]: sql plugin create statement from cmusaslsecretPLAIN webmaster test.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:49 mail cyrus/imap[14563]: sql plugin doing query select mailbox_password from mailbox where mailbox_name='webmaster' or mailbox_name='webmaster@test.';<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:49 mail cyrus/imap[14563]: commit transaction<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Mar 19 06:29:49 mail cyrus/imap[14563]: sql plugin Parse the username webmaster@test.local<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";mso-fareast-language:DE'>Von:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";mso-fareast-language:DE'> Lars Duesing [mailto:lars.duesing@camelotsweb.de] <br><b>Gesendet:</b> Donnerstag, 18. März 2010 06:50<br><b>An:</b> cyrus-sasl@lists.andrew.cmu.edu<br><b>Betreff:</b> multiple calls to canonuser-plugin?<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-US>Hi List,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>I am programming a sql canonuser-plugin. In short it does a sql-statement (SELECT main_account FROM accounts WHERE address=’%s’)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>This plugin is to be used in cyrus-imap. <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>All my code works fine. But: the canonuser-plugin is called multiple times within the same context.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>For instance:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>---<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>DB:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>main_account address<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><a href="mailto:webmaster@test.local">webmaster@test.local</a> <a href="mailto:lars@test.local">lars@test.local</a><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><a href="mailto:lars@test.local">lars@test.local</a> <a href="mailto:webmaster@anywhere.local">webmaster@anywhere.local</a><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>my code does (at the moment!) only one select statement, but is called twice.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>When I ask for <a href="mailto:webmaster@anywhere.local">webmaster@anywhere.local</a> sasl sends webmaster@t – because the length given back is the length from the first select.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>My problem is it seems like the code is called twice at the same time.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Is this a problem of sasl or of imap?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Regards,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Lars<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div></body></html>