6.0.0-beta1
7/18/25

[#10448] Preauth hook and authusername hook are not used
Summary Preauth hook and authusername hook are not used
Queue Ingo
Queue Version Git master
Type Bug
State Not A Bug
Priority 1. Low
Owners
Requester joniw (at) t-online (dot) de
Created 08/22/2011 (5079 days ago)
Due
Updated 12/14/2012 (4599 days ago)
Assigned
Resolved 08/22/2011 (5079 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
12/14/2012 10:00:34 PM aba (at) sundown (dot) cz Comment #12 Reply to this comment

[Show Quoted Text - 24 lines]
thank you Jonathan, next time I must read more carefully, euser for 
sieve is mentioned in this file

Petr
12/13/2012 10:59:28 PM joniw (at) t-online (dot) de Comment #11 Reply to this comment

[Show Quoted Text - 14 lines]
Try to add:

'euser' => $ob->getParam('username')

to the array.

with regards

Jonathan
12/13/2012 04:46:24 PM aba (at) sundown (dot) cz Comment #10 Reply to this comment
Just for my own knowledge:  Is there a "horde" way to access the Imp
auth data? Because for me it does make sense to couple the auth of
Ingo to Imp as its settings are also under the Imp menu and sieve
rules are set on the mail server.
$ob = $GLOBALS['registry']->call('mail/imapOb');
$username = $ob->getParam('username');
Hi,
I tried to use hooks to authenticate against dovecot managesieve in 
ingo 3.0.1 with no success. I'm using exactly same way how to get 
username and password from imap login, both values 'username' and 
'password' are filled correctly, but I stil receiving:
dovecot: managesieve-login: Disconnected (auth failed, 1 attempts): 
user=<neco@nekde.cz>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, 
secured


Thanks

Petr
this is my hooks.php

class Ingo_Hooks
{
     public function transport_auth($driver)
     {
             $ob = $GLOBALS['registry']->call('mail/imapOb');
             return array(
                 'username' => $ob->getParam('username'),
                 'password' => $ob->getParam('password')
             );

     }
}

What could be wrong?

Thanks

Petr
09/05/2012 10:02:24 PM joniw (at) t-online (dot) de Comment #9 Reply to this comment
Hello

With the introduction of the Factory folder the patch does not work 
anymore. When i want to get the imap object i have a infinit loop as 
imp is not initialized at this moment and the password is not already 
set

Do you have any ideas how i can get the credentials from imp in ingo?

With regards

Jonathan

08/30/2011 09:29:35 PM Michael Slusarz Comment #8 Reply to this comment
Just for my own knowledge:  Is there a "horde" way to access the Imp 
auth data? Because for me it does make sense to couple the auth of 
Ingo to Imp as its settings are also under the Imp menu and sieve 
rules are set on the mail server.
$ob = $GLOBALS['registry']->call('mail/imapOb');
$username = $ob->getParam('username');
08/30/2011 09:22:08 PM joniw (at) t-online (dot) de Comment #7 Reply to this comment

[Show Quoted Text - 10 lines]
I agree that it is a lot of overhead to add extra auth for Ingo.

Just for my own knowledge:  Is there a "horde" way to access the Imp 
auth data? Because for me it does make sense to couple the auth of 
Ingo to Imp as its settings are also under the Imp menu and sieve 
rules are set on the mail server.

If i should ask this on the mailing list just say it. I am using this 
ticket only because it may be interesting for other people.

Thanks for your help

Jonathan


08/30/2011 07:22:08 PM Michael Slusarz Comment #6 Reply to this comment

[Show Quoted Text - 9 lines]
Appinitialized is called when an application is first initialized.  In 
that app, you could do something like storing the value you want to 
use in ingo in a session variable.  You will still have to alter other 
code in ingo to use this value, however.

The issue for you is that you are trying to use ingo in a non-standard 
way.  The correct way to fix would be to add authentication to Ingo.   
But this is not-insignificant overhead, and I personally don't see the 
advantage to adding this feature (at the expense of performance) when 
its usage would be extremely limited.
08/24/2011 11:25:10 AM joniw (at) t-online (dot) de Comment #5 Reply to this comment
Even if 1 and 2 weren't issues, it still won't be added to Ingo 
since Ingo does not need full authentication.  Your particular use 
case is a fringe case, and I am not convinced that it couldn't be 
handled a different way (e.g. using the appinitialized hook).
Ok i get your point. As far as i understood it, ingo always uses the 
horde login and does not save an own login. So how can the 
appinitialized hook help me? If there is a "horde" way to do it i 
would use it.

My problem is that i only need an email address for applications which 
use the mailserver (like imp and ingo at the moment). All other 
authentication is done against the ldap server. So if i rewrite the 
username in the horde hooks all applications use the mail address 
which is not what i want.

I also tried to implement the authentication for ingo but that is a 
really hard thing for me.

08/24/2011 04:50:59 AM Michael Slusarz Comment #4 Reply to this comment
I added the ability in Ingo to use the imp user data. The patch is 
attached. has only been quickly tested.
That will probably work locally.  But that will not be added to Ingo 
since 1) it improperly accesses IMP directly and 2) is not the correct 
way to add authentication to an application.

Even if 1 and 2 weren't issues, it still won't be added to Ingo since 
Ingo does not need full authentication.  Your particular use case is a 
fringe case, and I am not convinced that it couldn't be handled a 
different way (e.g. using the appinitialized hook).
08/24/2011 12:25:44 AM joniw (at) t-online (dot) de Comment #3
New Attachment: 0001-added-ability-to-ingo-to-use-the-imp-auth.patch Download
Reply to this comment
I added the ability in Ingo to use the imp user data. The patch is 
attached. has only been quickly tested.

Perhabs you guys can have a look at it.

with regards

Jonathan
08/22/2011 05:55:37 PM Michael Slusarz Comment #2
State ⇒ Not A Bug
Reply to this comment
As Jan mentioned on the list, this is the correct behavior.  Ingo is 
currently written to only use Horde authentication values (e.g. 
Ingo_Application::_auth() is empty).  Thus, there is no need to call 
auth alteration methods during initial authentication into Ingo.

Two solutions for you:
1. Store this information in a separate variable.
2. Rewrite Ingo to use the application auth capability (e.g. similar 
to IMP), in which case these hooks become available.
08/22/2011 11:21:00 AM joniw (at) t-online (dot) de Comment #1
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Queue ⇒ Ingo
Summary ⇒ Preauth hook and authusername hook are not used
Type ⇒ Bug
Priority ⇒ 1. Low
Reply to this comment
I want to use ingo to manage my sieve filter through dovecot/managesieved.

The problem is that i use logins without a domain part for horde. I 
want to use a preauth hook with ingo to append the domain to the 
username.

In IMP it is working and i see my mails. In INGO the preauth hook is 
also executed but when i want to see the actual sieve script or save 
one to the server i get an "Authentication failed.".

In the dovecot log i can see that the horde username is used without 
the domain appended. I also tried to use the authusername hook but it 
also does not work because it seems that it is not used (No log 
message is seen in the log).

After digging into the code it looks like only the horde login is used 
in ingo/lib/Ingo.php, function getTransport().

Saved Queries