1 (edited by ag 2016-01-07 18:16:03)

Topic: Roundcube SMTP Error (-1): Connection to server failed.

==== Required information ====
- iRedMail version: 0.8.3
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Web server (Apache or Nginx): Apache
- Linux/BSD distribution name and version: Debian 6
- Manage mail accounts with iRedAdmin-Pro? No
- Related log if you're reporting an issue:
====

Hello,
I have a problem with sending emails through Roundcube, I get error:

SMTP Error (-1): Connection to server failed.

What could it be?

I've read that it could be problem with port 587, should be open. I've checked:

netstat -tlpn | grep :587
tcp        0      0 0.0.0.0:587             0.0.0.0:*               LISTEN      1889/smtpd

But then I've checked also port 25 and I get:

tcp        0      0 111.xxx.xxx.xxx:25        0.0.0.0:*               LISTEN      2574/smtpd
tcp        0      0 222.xxx.xxx.xxx:25        0.0.0.0:*               LISTEN      15169/master
tcp        0      0 333.xxx.xxx.xxx:25        0.0.0.0:*               LISTEN      15169/master
tcp        0      0 444.xxx.xxx.xxx:25        0.0.0.0:*               LISTEN      15169/master
tcp        0      0 555.xxx.xxx.xxx:25        0.0.0.0:*               LISTEN      15169/master

Because I have 5 domains with 5 different IP, sholudnt resualt for 587 look the same? For each my IP? If so how can I set this?

----

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

2

Re: Roundcube SMTP Error (-1): Connection to server failed.

Any related error in Dovecot log file? /var/log/dovecot.log.

3 (edited by ag 2016-01-07 20:43:19)

Re: Roundcube SMTP Error (-1): Connection to server failed.

No errors in dovecot.log related, only this information related to login/sending:

Jan 07 12:27:15 imap-login: Info: Login: user=<myaddress@mydomain.com>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
Jan 07 12:27:17 IMAP(myaddress@mydomain.com): Info: Disconnected: Logged out bytes=29/419
Jan 07 12:27:18 imap-login: Info: Login: user=<myaddress@mydomain.com>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
Jan 07 12:27:19 IMAP(myaddress@mydomain.com): Info: Disconnected: Logged out bytes=70/638
Jan 07 12:27:20 imap-login: Info: Login: user=<myaddress@mydomain.com>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
Jan 07 12:27:20 imap-login: Info: Login: user=<myaddress@mydomain.com>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
Jan 07 12:27:21 IMAP(myaddress@mydomain.com): Info: Disconnected: Logged out bytes=233/879
Jan 07 12:27:22 IMAP(myaddress@mydomain.com): Info: Disconnected: Logged out bytes=50/410
Jan 07 12:27:24 imap-login: Info: Login: user=<myaddress@mydomain.com>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
Jan 07 12:27:24 IMAP(myaddress@mydomain.com): Info: Disconnected: Logged out bytes=32/390
Jan 07 12:27:24 imap-login: Info: Login: user=<myaddress@mydomain.com>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
Jan 07 12:27:25 IMAP(myaddress@mydomain.com): Info: Disconnected: Logged out bytes=44/537

but in mail.err I got something like this:

Jan  7 12:27:36 SERVER_NAME roundcube: SMTP Error: SMTP error: Connection failed: Failed to connect socket: Connection denied in /usr/share/apache2/roundcubemail-0.8.2/program/include/main.inc on line 1485 (POST /MAIL_ALIAS/?_unlock=loading1452166058963&_lang=undefined?_task=mail&_action=send)

4

Re: Roundcube SMTP Error (-1): Connection to server failed.

*) Any error in Postfix log file? /var/log/mail.log.
*) Is iRedAPD service running?

5 (edited by ag 2016-01-07 23:51:13)

Re: Roundcube SMTP Error (-1): Connection to server failed.

I don't see any error's related to roundcube/imap in mail.log

Yes, the service iRedAPD is running:

# service iredapd start
iredapd is already running.

What about this error in mail.err (my last post)?

6

Re: Roundcube SMTP Error (-1): Connection to server failed.

ag wrote:

What about this error in mail.err (my last post)?

It means Roundcube cannot connect to smtp service (connection denied).

7

Re: Roundcube SMTP Error (-1): Connection to server failed.

I can read wink I meant what usually cause this error?

8

Re: Roundcube SMTP Error (-1): Connection to server failed.

Maybe smtp service is not running, or not running well and cannot handle request correctly.
Without detailed log, i cannot help much, sorry.

9

Re: Roundcube SMTP Error (-1): Connection to server failed.

ZhangHuangbin wrote:

Maybe smtp service is not running, or not running well and cannot handle request correctly.
Without detailed log, i cannot help much, sorry.


Dear Friend,

I have exactly the same problem. I have upgraded my ubuntu server from 14 to 16 and I had to upgrade roundcube in order to have it functional again. i am unable to send emails now and I have this in mail.log:

SMTP Error: Connection failed: Failed to connect socket: Connection refused in /opt/www/roundcubemail-1.1.5/program/lib/Roundcube/rcube.php on line 1648 (POST /mail/?_task=mail&_unlock=loading1484956101491&_lang=en_US&_framed=1&_action=send)

Can You help me?

Best Regards!

10

Re: Roundcube SMTP Error (-1): Connection to server failed.

Spaxton wrote:

SMTP Error: Connection failed: Failed to connect socket: Connection refused in /opt/www/roundcubemail-1.1.5/program/lib/Roundcube/rcube.php on line 1648 (POST /mail/?_task=mail&_unlock=loading1484956101491&_lang=en_US&_framed=1&_action=send)

Is postfix running?

11 (edited by Spaxton 2017-01-22 23:52:20)

Re: Roundcube SMTP Error (-1): Connection to server failed.

ZhangHuangbin wrote:
Spaxton wrote:

SMTP Error: Connection failed: Failed to connect socket: Connection refused in /opt/www/roundcubemail-1.1.5/program/lib/Roundcube/rcube.php on line 1648 (POST /mail/?_task=mail&_unlock=loading1484956101491&_lang=en_US&_framed=1&_action=send)

Is postfix running?


Hi,

Thanks for reply!
Yes, postfix is running...

Everything I did was upgrade from ubuntu 14 to ubuntu 16.

Post's attachments

Unnamed QQ Screenshot20170122165035.jpg
Unnamed QQ Screenshot20170122165035.jpg 27.02 kb, 1 downloads since 2017-01-22 

You don't have the permssions to download the attachments of this post.

12 (edited by Spaxton 2017-01-23 00:28:47)

Re: Roundcube SMTP Error (-1): Connection to server failed.

I have just checked that receiving mails also doesn't work... sad Connect to the server via email client also not possible... There is nothing listening on ports 465 and 587 for example. I have checked netstat.

13

Re: Roundcube SMTP Error (-1): Connection to server failed.

It's hard to help without any log.

You may consider buying our support ticket to get support via email or direct ssh access:
http://www.iredmail.org/support.html

14

Re: Roundcube SMTP Error (-1): Connection to server failed.

ZhangHuangbin wrote:

It's hard to help without any log.

You may consider buying our support ticket to get support via email or direct ssh access:
http://www.iredmail.org/support.html


Hi friend,

I can give You any log. Just let me know where this can be traced.

Best Regards!

15

Re: Roundcube SMTP Error (-1): Connection to server failed.

Check if there's any error / warning / fatal message in Postfix log first.

16 (edited by Spaxton 2017-01-23 22:18:59)

Re: Roundcube SMTP Error (-1): Connection to server failed.

ZhangHuangbin wrote:

Check if there's any error / warning / fatal message in Postfix log first.


Here it is what I have found in the logs... logs were full yesterday but today only 4 lines.

PHP Warning:  stream_socket_client(): unable to connect to 127.0.0.1:587 (Connection refused) in /opt/www/roundcubemail-1.1.5/vendor/pear-pear.php.net/Net_Socket/Net/Socket.php on line 158

ERROR: Connection refused (111)

ERROR: Failed to connect socket: Connection refused ()

<7i6k6a85> SMTP Error: Connection failed: Failed to connect socket: Connection refused in /opt/www/roundcubemail-1.1.5/program/lib/Roundcube/rcube.php on line 1648 (POST /mail/?_task=mail&_unlock=loading1485175006983&_lang=en_US&_framed=1&_action=send)

postmulti[1266]: fatal: instance /etc/postfix, shlib_directory=/usr/lib/postfix conflicts with instance /etc/postfix, daemon_directory=/usr/lib/postfix

This is all...

17

Re: Roundcube SMTP Error (-1): Connection to server failed.

Here are netstat details

Post's attachments

Unnamed QQ Screenshot20170123134512.jpg
Unnamed QQ Screenshot20170123134512.jpg 68.05 kb, 4 downloads since 2017-01-23 

You don't have the permssions to download the attachments of this post.