1

Topic: Rouncube: SMTP error: Authfailure: STARTTLS failed (Code: )

Sending and receiving from external clients work perfectly.
When sending from Roundcube 1.02

==== Required information ====
- iRedMail version: v1.9.1 (MySQL)
- Store mail accounts in which backend (MySQL):
- Linux/BSD distribution name and version: FreeBSD 10.1-RELEASE
- Related log if you're reporting an issue: /var/log/maillog  (below)
- perl : v5.18.4
- PHP 5.6.0 (cli) (built: Jan  5 2015 13:10:37)
- Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
====

Jan 22 14:32:01 mail postfix/smtpd[88131]: connect from mail.nmsnj.com[127.0.0.1]
Jan 22 14:32:01 mail roundcube: Recv: 220 mail.nmsnj.com ESMTP Postfix
Jan 22 14:32:01 mail roundcube: Send: EHLO mail.nmsnj.com
Jan 22 14:32:01 mail roundcube: Recv: 250-mail.nmsnj.com
Jan 22 14:32:01 mail roundcube: Recv: 250-PIPELINING
Jan 22 14:32:01 mail roundcube: Recv: 250-SIZE 15728640
Jan 22 14:32:01 mail roundcube: Recv: 250-ETRN
Jan 22 14:32:01 mail roundcube: Recv: 250-STARTTLS
Jan 22 14:32:01 mail roundcube: Recv: 250-ENHANCEDSTATUSCODES
Jan 22 14:32:01 mail roundcube: Recv: 250-8BITMIME
Jan 22 14:32:01 mail roundcube: Recv: 250 DSN
Jan 22 14:32:01 mail roundcube: Send: STARTTLS
Jan 22 14:32:01 mail roundcube: Recv: 220 2.0.0 Ready to start TLS
Jan 22 14:32:01 mail roundcube: PHP Deprecated:  Non-static method PEAR::raiseError() should not be called statically, assuming $this from incompatible context in /usr/local/www/roundcube/program/lib/Net/SMTP.php on line 611
Jan 22 14:32:01 mail postfix/smtpd[88131]: lost connection after STARTTLS from mail.nmsnj.com[127.0.0.1]
Jan 22 14:32:01 mail postfix/smtpd[88131]: disconnect from mail.nmsnj.com[127.0.0.1]
Jan 22 14:32:01 mail roundcube: STARTTLS failed ():
Jan 22 14:32:01 mail roundcube: Send: RSET
Jan 22 14:32:01 mail roundcube: PHP Deprecated:  Non-static method PEAR::raiseError() should not be called statically, assuming $this from incompatible context in /usr/local/www/roundcube/program/lib/Net/SMTP.php on line 371
Jan 22 14:32:01 mail roundcube: Send: QUIT
Jan 22 14:32:01 mail roundcube: PHP Deprecated:  Non-static method PEAR::raiseError() should not be called statically, assuming $this from incompatible context in /usr/local/www/roundcube/program/lib/Net/SMTP.php on line 265
Jan 22 14:32:01 mail roundcube: SMTP Error: SMTP error: Authentication failure: STARTTLS failed (Code: ) in /usr/local/www/roundcube/program/lib/Roundcube/rcube.php on line 1504 (POST /mail/?_task=mail&_unlock=loading1421955117799&_lang=en_US&_framed=1?_task=mail&_action=send)

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Rouncube: SMTP error: Authfailure: STARTTLS failed (Code: )

sgroom wrote:

- Linux/BSD distribution name and version: FreeBSD 10.1-RELEASE

I have the same issue with php-5.6, but works fine with php-5.5.

By the way, does this ticket help?
http://trac.roundcube.net/ticket/1489999

3

Re: Rouncube: SMTP error: Authfailure: STARTTLS failed (Code: )

Any resolution to this? I am having same issue with php 5.6, and cannot roll back to 5.5 due to other dependencies.

4

Re: Rouncube: SMTP error: Authfailure: STARTTLS failed (Code: )

Answering my own question:

PHP 5.6 has changed to validate the Common Name in the SSL cert.

iRedMAil sets the roundcube SMTP host to tls://127.0.0.1 in config.inc.php. Since 127.0.0.1 does not match the hostname in the SSL cert that postfix uses, the TLS can't start and authentication fails. Prior to php 5.6 this would work, but in PHP 5.6 it does not due to the new validations.

There is even more work to do if you are using a self-signed cert. I am not in that scenario so I do not know the steps.

This is where I found the resolution:

https://bbs.archlinux.org/viewtopic.php?id=193012

5

Re: Rouncube: SMTP error: Authfailure: STARTTLS failed (Code: )

This solution has been shipped by iRedMail for a long time:
https://bitbucket.org/zhb/iredmail/src/ … ew-default

6

Re: Rouncube: SMTP error: Authfailure: STARTTLS failed (Code: )

Thanks! seems like I have been upgrading my iredmail install for way too long wink.

ZhangHuangbin wrote:

This solution has been shipped by iRedMail for a long time:
https://bitbucket.org/zhb/iredmail/src/ … ew-default