[dev] Horde Mailer login and authusername hook

Luis Felipe Marzagao lfbm.andamentos at gmail.com
Tue Jan 10 03:53:27 UTC 2017



Em 09/01/2017 09:26, Jan Schneider escreveu:
>
> Zitat von Luis Felipe Marzagao <lfbm.andamentos at gmail.com>:
>
>> Em 7 de janeiro de 2017 15:32:39 BRST, lang at b1-systems.de escreveu:
>>> Do you call horde_smto directly or through some factory? What classname
>>> is returned?
>>
>> No, I'm not calling it manually. I'm using regular IMP's new message 
>> form.
>>
>> I've added a debug entry inside the code and verified it's using the 
>> userid without the domain part and not the result of 
>> $registry->getAuth(), which has the domain part.
>
> If that's what you also use for logging into Horde, then the behavior 
> is correct. By default is uses the same user name for logging into 
> Horde like for authenticating to SMTP. This is also true if 
> implementing the username hook, at least if you implemented it 
> correctly for both directions.
>

Ok, I've found out the issue.

Now Horde_Smtp::getParam('username') is returning the full username 
(user at domain).

I was missing the $servers['imap']['smtp']['horde_auth'] setting in 
imp/config/backends.local.php. It must be set to true in order to 
retrieve horde-wide smtp credentials (which, in turn, in my case, is set 
to pull horde login credentials).

It's pretty confusing having part of these settings in one place 
(horde-wide config) and other part under imp's config, I mean, pulling 
settings from there to here, in a mixed way, but I think there must be a 
good design reason for that decision.

I don't know, maybe it would be nice to require IMP to have an isolated 
configuration (even at the cost of occasionally having to type in the 
same smtp server configuration again under imp's backends file).

It is also confusing to have an "smtp" setting, which represents a 
separate backend, configured under "imap" backend, as if it was 
dependent of it. In this way, the smtp options for IMP get completely 
hidden and it is hard to find them and make sense of them.

Add to the confusion part the fact that the setting "hordeauth" is also 
present for the imap backend itself, which is necessary but makes the 
documentation somewhat trickier to grasp at a first read. When I first 
read it I took one 'hourdeauth' explanation by another, because I found 
the param via search in my text editor and I just read the first 
"hourdeauth" that appeared. And they are different (hordeauth for imap 
backend has true, 'full' or false options, whereas hordeauth for 
['imap']['smtp'] accepts true of false.

I know it is completely my fault not reading the entire documentation 
from backends.php, but the same situation is likely to happen with a lot 
of people, I think.

Maybe it would help newcomers if the example imap server from 
imp/config/backends.php already brought a sample smtp server setting 
within, with some clarifying comments above each option, at least so the 
admin would know it can be configured this way at first glance.

If you think it's a good idea I'm willing to update the backends.php 
file and suggest something via github.

Thanks.

>>> Am 7. Januar 2017 04:12:52 MEZ schrieb Luis Felipe Marzagao
>>> <lfbm.andamentos at gmail.com>:
>>>> Is Horde_Smtp supposed to honor authusername hook during SMTP server
>>>> logins?
>>>>
>>>> I have an authusername hook set up which adds a domain to the userid
>>> so
>>>>
>>>> the converted username is "userid at example.com".
>>>>
>>>> But when the mailer tries to connect to the SMTP server it is using
>>>> just
>>>> the userid, without the domain part.
>>>>
>>>> In case this is the desired behaviour, could you provide any pointers
>>>> on
>>>> how to accomplish the SMTP login with the domain part?
>>>>
>>>> Thanks a lot.
>>>> Luis Felipe
>>>>
>>>>
>>>> -- 
>>>> dev mailing list
>>>> Frequently Asked Questions: http://wiki.horde.org/FAQ
>>>> To unsubscribe, mail: dev-unsubscribe at lists.horde.org
>>
>> -- 
>> Enviado de meu dispositivo Android com K-9 mail. Desculpe-me pela 
>> brevidade.
>
>
>



More information about the dev mailing list