Summary | Horde_SMTP misses horde-auth authentication to SMTP server |
Queue | Horde Base |
Queue Version | 5.2.1 |
Type | Bug |
State | Not A Bug |
Priority | 1. Low |
Owners | |
Requester | Klaus.Steinberger (at) physik (dot) uni-muenchen (dot) de |
Created | 09/15/2014 (3947 days ago) |
Due | |
Updated | 09/16/2014 (3946 days ago) |
Assigned | 09/15/2014 (3947 days ago) |
Resolved | 09/15/2014 (3947 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
backends.conf (the smtp -> auth parameter).
Regardless, this is not a bug so this support discussion should move
to the imp mailing list.
killed it. So sorry about the confusion, some old examples led me to
the override.
backends.conf (the smtp -> auth parameter).
Regardless, this is not a bug so this support discussion should move
to the imp mailing list.
<?php
$servers['imap']['disabled'] = true;
$servers['advanced']['disabled'] = false;
$servers['advanced']['hordeauth'] = true;
$servers['advanced']['name'] = 'Fakultät IMAP Server';
$servers['advanced']['hostspec'] = 'localhost';
$servers['advanced']['secure'] = 'none';
$servers['advanced']['admin']['params']['admin_user'] = '*******';
$servers['advanced']['admin']['params']['admin_password'] = '*******';
$servers['advanced']['admin']['params']['userhierarchy'] = 'user/';
$servers['advanced']['smtp']['debug'] = '/tmp/smtp.log';
$servers['advanced']['smtp']['host'] = 'mail.physik.uni-muenchen.de';
$servers['advanced']['smtp']['port'] = 587;
$servers['advanced']['quota']['params']['unit'] = 'GB';
$servers['advanced']['cache'] = 'none';
$servers['advanced']['maildomain'] = 'physik.uni-muenchen.de';
As you can see $servers['advanced']['hordeauth'] = true; is set. And
it does not work, are you sure the configuration at your site really
works the way you want? See the smtp.log:
------------------------------
Connection to: smtp://mail.physik.uni-muenchen.de:587
C: EHLO testwebmail.physik.uni-muenchen.de
S: 250-mail.physik.uni-muenchen.de
S: 250-PIPELINING
S: 250-SIZE 31457280
S: 250-VRFY
S: 250-ETRN
S: 250-STARTTLS
S: 250-XVERP
S: 250-ENHANCEDSTATUSCODES
S: 250-8BITMIME
S: 250 DSN
C: STARTTLS
S: 220 2.0.0 Ready to start TLS
S: 250-mail.physik.uni-muenchen.de
S: 250-PIPELINING
S: 250-SIZE 31457280
S: 250-VRFY
S: 250-ETRN
S: 250-AUTH LOGIN PLAIN
S: 250-AUTH=LOGIN PLAIN
S: 250-XVERP
S: 250-ENHANCEDSTATUSCODES
S: 250-8BITMIME
S: 250 DSN
C: MAIL FROM:<Campus-admin@physik.uni-muenchen.de> SIZE=593 BODY=7BIT
C: RCPT TO:<Klaus.Steinberger@physik.uni-muenchen.de>
S: 250 2.1.0 Ok
S: 554 5.7.1
<testwebmail.physik.uni-muenchen.de[2001:4ca0:4102::2:200]>: Client
host rejected: Access denied
C: RSET
S: 250 2.0.0 Ok
C: QUIT
S: 221 2.0.0 Bye
As you can see authentication is never tried.
the imp/config/backends.local.php one line was missing. These are the
full contents of this file on my system:
<?php
$servers['imap']['disabled'] = true;
$servers['advanced']['disabled'] = false;
$servers['advanced']['hordeauth'] = true;
$servers['advanced']['maildomain'] = 'de-korte.org';
$servers['advanced']['cache'] = 'sql';
$servers['advanced']['quota']['params']['unit'] = 'GB';
$servers['advanced']['quota']['params']['hide_when_unlimited'] = false;
$servers['advanced']['spam']['innocent']['program'] = '/usr/bin/spamc
-C revoke';
$servers['advanced']['spam']['innocent']['display'] = true;
$servers['advanced']['spam']['spam']['program'] = '/usr/bin/spamc -C report';
$servers['advanced']['spam']['spam']['display'] = true;
$servers['advanced']['autocreate_special'] = true;
You may run into problems if the second line is missing, since then
Horde will use the 'imap' configuration, instead of the 'advanced'
configuration. The only other thing that would need an override in
your case, is
$servers['advanced']['smtp']['host'] = 'mail.physik.uni-muenchen.de';
the above configuration without overriding *any* 'smtp' value.
with an dedicated account!
users entered when logging into the Horde portal are used. I'm 100%
sure this works, since the SMTP FROM address is checked to verify that
a user is allowed to use a sender address (to prevent them from
spoofing addresses).
Horde authentication credentials are set in Horde_Core_Factory_Mail.
Note that username_auth and password_auth horde config values need to
be active (non-empty).
I added some debug output, as well as changed line 440/441 to respect
the horde_auth parameter, so the code tries authentication:
Connection to: smtp://mail.physik.uni-muenchen.de:587
S: 220 mail.physik.uni-muenchen.de ESMTP Postfix
C: EHLO testwebmail.physik.uni-muenchen.de
S: 250-mail.physik.uni-muenchen.de
S: 250-PIPELINING
S: 250-SIZE 31457280
S: 250-VRFY
S: 250-ETRN
S: 250-STARTTLS
S: 250-XVERP
S: 250-ENHANCEDSTATUSCODES
S: 250-8BITMIME
S: 250 DSN
C: STARTTLS
S: 220 2.0.0 Ready to start TLS
S: 250-mail.physik.uni-muenchen.de
S: 250-PIPELINING
S: 250-SIZE 31457280
S: 250-VRFY
S: 250-ETRN
S: 250-AUTH LOGIN PLAIN
S: 250-AUTH=LOGIN PLAIN
S: 250-XVERP
S: 250-ENHANCEDSTATUSCODES
S: 250-8BITMIME
S: 250 DSN
checking extensionENHANCEDSTATUSCODES
checking extensionPIPELINING
After required ESMTP extensions
Before check auth: LOGIN PLAIN
Try auth LOGIN
S: 334 VXNlcm5hbWU6
C:
S: 334 UGFzc3dvcmQ6
[AUTH Command - method: LOGIN; username: ]
S: 535 5.7.8 Error: authentication failed: generic failure
S: 535 5.7.8 Error: authentication failed: generic failure
C: QUIT
S: 221 2.0.0 Bye
quit
As you can see the code never gets the correct credentials. This is
due to the fact that in Line 776 in /usr/share/pear/Horde/smtp.php in
the function _auth username and password will be filled with the
parameters username and password, which resembled a dedicated login
for SMTP delivery.
But what we need is the login credentials of the user!
$servers['advanced']['disabled'] = false;
$servers['advanced']['hordeauth'] = true;
$servers['advanced']['smtp']['debug'] = '/tmp/smtp.log';
$servers['advanced']['smtp']['host'] = 'mail.physik.uni-muenchen.de';
should be sufficient (and works for me).
authentication with the user credentials, and this part is missing in
the code. Did you not read my comments correctly?
the above configuration without overriding *any* 'smtp' value.
with an dedicated account!
Jan: please do not mark it as no bug so fast!
I it as regression in the code.
is not used.
'auth' => true,
'horde_auth' => true,
'debug' => '/tmp/smtp.log',
'host' => 'mail.physik.uni-muenchen.de',
'port' => 587,
);
<?php
$servers['advanced']['disabled'] = false;
$servers['advanced']['hordeauth'] = true;
$servers['advanced']['smtp']['debug'] = '/tmp/smtp.log';
$servers['advanced']['smtp']['host'] = 'mail.physik.uni-muenchen.de';
should be sufficient (and works for me).
the change to Horde_SMTP), look into /usr/share/pear/Horde/Smtp.php
at line 440/441, the code looks only for "username" which is for
authentication with _one_ fixed account. We need to use horde_auth,
so that the credentials of the user are used.
the above configuration without overriding *any* 'smtp' value.
is not used.
$servers['advanced']['smtp'] = array(
'auth' => true,
'horde_auth' => true,
'debug' => '/tmp/smtp.log',
'host' => 'mail.physik.uni-muenchen.de',
'port' => 587,
);
horde_auth is not used anywhere in Horde_smtp (but it worked before
the change to Horde_SMTP), look into /usr/share/pear/Horde/Smtp.php at
line 440/441, the code looks only for "username" which is for
authentication with _one_ fixed account. We need to use horde_auth, so
that the credentials of the user are used.
I did change these two lines, but later in the code also horde_auth is
not used.
State ⇒ Feedback
Priority ⇒ 1. Low
Patch ⇒ No
State ⇒ Unconfirmed
Milestone ⇒
Queue ⇒ Horde Base
Summary ⇒ Horde_SMTP misses horde-auth authentication to SMTP server
Type ⇒ Bug
Priority ⇒ 3. High
horde_auth authentication.
Some investigating in the code shows that Horde_SMTP does not use the
horde_auth Parameter.
This is important functionality for us, which got lost with the change
from Net_SMTP to Horde_SMTP
Please reintroduce this functionality