0013424: failing smtp authentication after upgrade to tine 2017.08.3 CE #6640

Closed
Gloirin opened this Issue Jun 9, 2018 · 6 comments

Comments

Projects
None yet
1 participant
@Gloirin

Gloirin commented Jun 9, 2018

Reported by mknoeller on 8 Sep 2017 08:53

Version: 2017.08.3 Community Edition

Sending Emails not possible in cause of smtp authenticaten failure! After upgrade from 2017.02.5 to 2017.08.3 domainname is not appended to loginname during smtp authentication! So the smtp username is incomplete and smtp connection is refused.

Steps to reproduce: Allways reproducable by simple upgrade to 2017.08.3. Even with different Linux Distri, php version and apache version.

Additional information: imap authentication works as normal, because domainname is appended to loginname and the imap username is correct.

I think here is the same problem:
https://www.tine20.org/forum/viewtopic.php?f=12&t=18546

@Gloirin Gloirin added this to the 2017.08.6 Community Edition milestone Jun 9, 2018

@Gloirin Gloirin self-assigned this Jun 9, 2018

@Gloirin Gloirin closed this Jun 9, 2018

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by pschuele on 11 Sep 2017 07:21

thanks for the report, we'll have a look.

Gloirin commented Jun 11, 2018

Comment posted by pschuele on 11 Sep 2017 07:21

thanks for the report, we'll have a look.

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by lab-at-nohl on 26 Sep 2017 22:40

This only happens to non-ldap Backends (especially Standard-SMTP).

As far as I can see, in protected function _getEmailUserName (Tinebase/User/Plugin/Abstract.php, line 160) $this->_config['domain'] is always unset. Only $this->_config['primaryDomain'] is available which btw reflects the functionality of protected function _appendDomain (line 114)...

If I change the like the following primaryDomain from Setup is used:

protected function _getEmailUserName(Tinebase_Model_FullUser $user, $alternativeLoginName = null)
{
    $domainConfigKey = ($this instanceof Tinebase_EmailUser_Imap_Interface) ? 'domain' : 'primarydomain';
    if (isset($this->_config['useEmailAsUsername']) && $this->_config['useEmailAsUsername']) {
        $emailUsername = $user->accountEmailAddress;
    } else if (isset($this->_config['instanceName']) && ! empty($this->_config['instanceName'])) {
        $emailUsername = $user->getId() . '@' . $this->_config['instanceName'];
    } else if (isset($this->_config[$domainConfigKey]) && $this->_config[$domainConfigKey] !== null) {
        $emailUsername = $this->_appendDomain($user->accountLoginName);
    } else if ($alternativeLoginName !== null) {
        $emailUsername = $emailAddress;
    } else {
        $emailUsername = $user->accountLoginName;
    }

    return $emailUsername;
}

Unfortunately I' totally lost within this area of code. I really can't figure out how functionality is meant here. It seems unusal to me that domain from IMAP config is requested...

Gloirin commented Jun 11, 2018

Comment posted by lab-at-nohl on 26 Sep 2017 22:40

This only happens to non-ldap Backends (especially Standard-SMTP).

As far as I can see, in protected function _getEmailUserName (Tinebase/User/Plugin/Abstract.php, line 160) $this->_config['domain'] is always unset. Only $this->_config['primaryDomain'] is available which btw reflects the functionality of protected function _appendDomain (line 114)...

If I change the like the following primaryDomain from Setup is used:

protected function _getEmailUserName(Tinebase_Model_FullUser $user, $alternativeLoginName = null)
{
    $domainConfigKey = ($this instanceof Tinebase_EmailUser_Imap_Interface) ? 'domain' : 'primarydomain';
    if (isset($this->_config['useEmailAsUsername']) && $this->_config['useEmailAsUsername']) {
        $emailUsername = $user->accountEmailAddress;
    } else if (isset($this->_config['instanceName']) && ! empty($this->_config['instanceName'])) {
        $emailUsername = $user->getId() . '@' . $this->_config['instanceName'];
    } else if (isset($this->_config[$domainConfigKey]) && $this->_config[$domainConfigKey] !== null) {
        $emailUsername = $this->_appendDomain($user->accountLoginName);
    } else if ($alternativeLoginName !== null) {
        $emailUsername = $emailAddress;
    } else {
        $emailUsername = $user->accountLoginName;
    }

    return $emailUsername;
}

Unfortunately I' totally lost within this area of code. I really can't figure out how functionality is meant here. It seems unusal to me that domain from IMAP config is requested...

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by pschuele on 27 Sep 2017 08:49

thanks @johannes.

does this work for you @mknoeller ?

Gloirin commented Jun 11, 2018

Comment posted by pschuele on 27 Sep 2017 08:49

thanks @johannes.

does this work for you @mknoeller ?

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by pschuele on 27 Sep 2017 08:50

https://gerrit.tine20.com/customers/5847

Gloirin commented Jun 11, 2018

Comment posted by pschuele on 27 Sep 2017 08:50

https://gerrit.tine20.com/customers/5847

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by koelschejung on 27 Sep 2017 15:15

On my dev-maschine work this workaround.

After this change, i can sent mails.

Thanks a lot.

uli

Gloirin commented Jun 11, 2018

Comment posted by koelschejung on 27 Sep 2017 15:15

On my dev-maschine work this workaround.

After this change, i can sent mails.

Thanks a lot.

uli

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by pschuele on 28 Sep 2017 09:01

great, thank you both :)

Gloirin commented Jun 11, 2018

Comment posted by pschuele on 28 Sep 2017 09:01

great, thank you both :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment