• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Roundcube stopped sending mails

ToniSoftware

New Pleskian
Hello there,

I'm using Plesk Onyx 17.8.11 on a Ubuntu 16.04.5 VPS.
All of the sudden my roundcube stopped sending emails via smtp tonight.
Receiving emails is still working.
First it gave me the error Code 220 but now after some time trying to fix it, I get no error code and after some time roundcube just stops sending the email (or at least the notification of trying to send it goes away)

Here's my error log:
[03-Aug-2018 07:53:28 UTC] ERROR: STARTTLS failed ()
[03-Aug-2018 07:53:28 UTC] ERROR: Invalid response code received from server (-1)
[03-Aug-2018 07:53:28 UTC] ERROR: Invalid response code received from server (-1)
[03-Aug-2018 07:53:28 +0000]: <n3tgarjj> SMTP Error: Authentication failure: STARTTLS failed (Code: ) in /usr/share/psa-roundcube/program/lib/Roundcube/rcube.php on line 1667 (POST /?_task=mail&_unlock=loading1533282806325&_lang=de_DE&_framed=1&_action=send)

my master.cf:
smtp inet n - - - - smtpd
submission inet n - - - - smtpd
-o smtpd_sasl_auth_enable=yes
smtps inet n - - - - smtpd -o smtpd_tls_wrappermode=yes
-o smtpd_sasl_auth_enable=yes

my main.cf:
smtpd_banner = mail.domain.tld
biff = no

readme_directory = no

smtpd_tls_cert_file = /etc/postfix/postfix_default.pem
smtpd_tls_key_file = $smtpd_tls_cert_file
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = $mydomain, localhost, localhost.localdomain
alias_maps = hash:/etc/aliases, hash:/var/spool/postfix/plesk/aliases
alias_database = hash:/etc/aliases
myorigin = mail.domain.tld
mydestination = localhost.contabo.host, localhost, localhost.localdomain, mail.domain.tld
relayhost =
mynetworks = localhost
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
virtual_mailbox_domains = $virtual_mailbox_maps, hash:/var/spool/postfix/plesk/virtual_domains
virtual_alias_maps = $virtual_maps, hash:/var/spool/postfix/plesk/virtual
virtual_mailbox_maps = , hash:/var/spool/postfix/plesk/vmailbox
transport_maps = , hash:/var/spool/postfix/plesk/transport
smtpd_tls_security_level = may
smtp_tls_security_level = may
smtp_use_tls = yes
smtpd_timeout = 3600s
smtpd_proxy_timeout = 3600s
disable_vrfy_command = yes
smtpd_sender_restrictions = check_sender_access hash:/var/spool/postfix/plesk/blacklists, permit_sasl_authenticated
smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated
smtp_send_xforward_command = yes
smtpd_authorized_xforward_hosts = 127.0.0.0/8 [::1]/128
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
virtual_mailbox_base = /var/qmail/mailnames
virtual_uid_maps = static:30
virtual_gid_maps = static:31
smtpd_milters = ,, inet:127.0.0.1:12768
non_smtpd_milters =
milter_default_action = accept
milter_protocol = 6
sender_dependent_default_transport_maps = hash:/var/spool/postfix/plesk/sdd_transport_maps
virtual_transport = plesk_virtual
plesk_virtual_destination_recipient_limit = 1
mailman_destination_recipient_limit = 1
virtual_mailbox_limit = 0
smtpd_tls_ciphers = medium
smtpd_tls_mandatory_ciphers = medium
tls_medium_cipherlist = HIGH:!aNULL:!MD5
smtpd_tls_mandatory_protocols = TLSv1 TLSv1.1 TLSv1.2
smtpd_tls_protocols = TLSv1 TLSv1.1 TLSv1.2
recipient_canonical_maps = tcp:127.0.0.1:12346
recipient_canonical_classes = envelope_recipient,header_recipient


and my defaults.inc.php (just the smtp part of it):
$config['smtp_server'] = 'tls://localhost';

$config['smtp_port'] = 25;

$config['smtp_user'] = '%u';

$config['smtp_pass'] = '%p';

$config['smtp_auth_type'] = 'PLAIN';

$config['smtp_auth_cid'] = null;

$config['smtp_auth_pw'] = null;

$config['smtp_helo_host'] = '';

$config['smtp_timeout'] = 0;

I hope somebody out there could help me!

Thanks in Advance
Toni
 
Hi,

if you use STARTTLS, you should use port 587

//$config['smtp_port'] = 25;
$config['smtp_port'] = 587;

hope that helps. Cheers, Tom
 
Hey,

no this actually doesn't fix my problem..

The interesting thing is, that if I switch the mail service to Horde it works fine but on Roundcube it doesn't.. Horde is sending mails via SSL, if I try this within Roundcube I get another error.. So thats actually something I don't understand..
 
Last edited:
@ToniSoftware

As far as I can see, both your main.cf and master.cf are corrupted or not correct.

You should run the plesk sbin autoinstaller command from the command line (via SSH).

Just remove roundcube and then (re-)install it, that often is sufficient to solve the issue.

Kind regards......... and keep us posted!
 
@trialotto
Well i did a reinstall which didn't fix my problem..
And my postfix server is working atm if using a mail client and not roundcube. Which is still kinda strange
So I will try it out tonight!

Kind regards
 
@trialotto
Well i did a reinstall which didn't fix my problem..
And my postfix server is working atm if using a mail client and not roundcube. Which is still kinda strange
So I will try it out tonight!

Kind regards

@ToniSofware,

I think that you have to do three things:

- check whether dovecot is running, run the command: service dovecot status (and start dovecot, if it is not running)
- even if dovecot is running, just restart it (read: this often helps when getting some issues with imap/pop3 related connections)
- re-install roundcube......... it can be the case that the installation is corrupted at the same time your postfix installation got corrupted

Just keeps us posted!

Regards........
 
@trialotto

I think there happened a little missunderstanding.
My IMAP Server (Courier) aswell as SMTP (postfix) are both up and working.
If I use a mail client receiving and sending works.
If I use Horde webmail receiving and sending works too.
Just if I use Roundcube the sending doesn't work and it gives me "220: Authentication failed" error..

So yeah I reinstalled Roundcube and it still isn't working.. Now I get a SMTP Error(-1): Connection failed..

regards
 
I'm having the same problem, after updating Plesk.

I'm using Plesk Onyx 17.8.11 on a Ubuntu 16.04.5 VPS.

Postfix.

After update, when i use roundcube, an error appears: SMTP Error(-1): Connection failed


If I use horde, the email is sent normally.
 
I'm having the same problem, after updating Plesk.

I'm using Plesk Onyx 17.8.11 on a Ubuntu 16.04.5 VPS.

Postfix.

After update, when i use roundcube, an error appears: SMTP Error(-1): Connection failed


If I use horde, the email is sent normally.

@Ricardo Guerreiro

You stated "after updating" and I have to ask: what do you mean exactly?

A micro-update, an OS (Ubuntu) update/upgrade, a package upgrade and/or an upgrade from Plesk 17.5.3 to version 17.8.11??

Anyway, please post some output from the logs, that will help in analyzing the issue.

Also provide the output of the command plesk -v

Regards.........
 
hi Trialotto!

i did an upgrade from Plesk 17.5.3 to version 17.8.11

error log:

[08-Aug-2018 20:15:08 UTC] ERROR: stream_socket_client(): unable to connect to $
[08-Aug-2018 20:15:08 UTC] ERROR: Failed to connect socket: stream_socket_clien$
[08-Aug-2018 20:15:08 +0000]: <c1hk1r0d> SMTP Error: Connection failed: Failed $

usr/share/psa-roundcube/config/defaults.inc.php:

$config['smtp_server'] = 'ssl://localhost';

// SMTP port (default is 25; use 587 for STARTTLS or 465 for the
// deprecated SSL over SMTP (aka SMTPS))
$config['smtp_port'] = 465;

// SMTP username (if required) if you use %u as the username Roundcube
// will use the current username for login
$config['smtp_user'] = '%u';

// SMTP password (if required) if you use %p as the password Roundcube
// will use the current user's password for login
$config['smtp_pass'] = '%p';

// SMTP AUTH type (DIGEST-MD5, CRAM-MD5, LOGIN, PLAIN or empty to use
// best server supported one)
$config['smtp_auth_type'] = 'PLAIN';
 
these changes worked for me:

- remove and re-install roundcube
- change /usr/share/psa-roundcube/config/default.inc.php

$config['smtp_server'] = 'tls://localhost';
$config['smtp_port'] = 587;
$config['smtp_auth_type'] = '';

make sure submission port 587 is enabled.

hope this helps

regards
Jan
 
these changes worked for me:

- remove and re-install roundcube
- change /usr/share/psa-roundcube/config/default.inc.php

$config['smtp_server'] = 'tls://localhost';
$config['smtp_port'] = 587;
$config['smtp_auth_type'] = '';

make sure submission port 587 is enabled.

hope this helps

regards
Jan

Now, error is SMTP 220.

[10-Aug-2018 11:14:20 UTC] ERROR: STARTTLS failed ()
[10-Aug-2018 11:14:20 UTC] ERROR: Invalid response code received from server (-$
[10-Aug-2018 11:14:20 UTC] ERROR: Failed to write to socket: unknown error ()
[10-Aug-2018 11:14:20 +0000]: <anfbepgq> SMTP Error: Authentication failure: ST$
 
@Ricardo Guerreiro

Please check your firewall settings, I am pretty sure that your case (which has a different root cause for the problem at hand, compared to the case of @ToniSoftware) is related to the VPS config and/or hosting provider default config ..... so try to determine what actually happens when using a local and an external connection to (on the one hand) smtp/smtps and on (the other hand) pop3/pop3s/imap/imaps: if that all works fine, then check the full roundcube config.

Essentially, the process above is a step-by-step analysis:

1 - check smtp and smtps connections: use for example telnet from a local and external machine.......if this works, no firewall issues and no postfix issues
2 - check pop3, pop3s, imap and imaps connections: if this works, no firewall issues and no dovecot or courier issues
3 - if either step 1 or 2 does not work: repair it and retry steps 1 and 2
4 - if steps 1 and 2 do work, but the issue still persists: then you are likely to have a broken roundcube config/setup (read: re-install roundcube)

Hope the above helps a bit.......regards!
 
@trialotto

I think there happened a little missunderstanding.
My IMAP Server (Courier) aswell as SMTP (postfix) are both up and working.
If I use a mail client receiving and sending works.
If I use Horde webmail receiving and sending works too.
Just if I use Roundcube the sending doesn't work and it gives me "220: Authentication failed" error..

So yeah I reinstalled Roundcube and it still isn't working.. Now I get a SMTP Error(-1): Connection failed..

regards

@ToniSoftware

Please change courier to dovecot, via the plesk sbin autoinstaller ........ it is recommended to NOT use courier: it increases the attack surface for hack attempts.

In the process of switching from courier to dovecot, you might be able to resolve your issue. Just let me know whether the problem gets solved!

Regards.....
 
@ToniSoftware

Please change courier to dovecot, via the plesk sbin autoinstaller ........ it is recommended to NOT use courier: it increases the attack surface for hack attempts.

In the process of switching from courier to dovecot, you might be able to resolve your issue. Just let me know whether the problem gets solved!

Regards.....


But why do I need to change my imap server even if it's working? I mean just regarding my problem. But anyway thanks therefore.

It's just the issue is with roundcube and my smtp server?

Regards
 
Last edited:
@ToniSoftware

With respect to your statement

But why do I need to change my smtp server even if it's working? It's just the issue with roundcube. I'm afraid of losing data or even worse

I really have to emphasize that

- you do not change the smtp server by switching from courier to dovecot: that is simply changing the imap/pop3 front-end,
- courier is not safe, it is prone to vulnerabilities and hack attempts: you do not want that,
- you do not lose data, you do not even lose mail data if you switch from postfix to qmail or vice versa (read: postfix and qmail are the default mail servers shipped with Plesk)
- your Roundcube setup, config and/or entire installation already has been become corrupted: you cannot send mail via Roundcube (read: this should work by default!)

and, in conclusion, you have nothing to lose by changing to dovecot and/or to re-install Roundcube (if you do, please remove all files properly!).

No worries mate!

Regards........
 
@ToniSoftware

With respect to your statement



I really have to emphasize that

- you do not change the smtp server by switching from courier to dovecot: that is simply changing the imap/pop3 front-end,
- courier is not safe, it is prone to vulnerabilities and hack attempts: you do not want that,
- you do not lose data, you do not even lose mail data if you switch from postfix to qmail or vice versa (read: postfix and qmail are the default mail servers shipped with Plesk)
- your Roundcube setup, config and/or entire installation already has been become corrupted: you cannot send mail via Roundcube (read: this should work by default!)

and, in conclusion, you have nothing to lose by changing to dovecot and/or to re-install Roundcube (if you do, please remove all files properly!).

No worries mate!

Regards........

Yeah regarding the smtp server, I'm sorry I confused them... I'll try now everything once again and will tell you what happened..

Regards
 
@trialotto
@ToniSoftware

With respect to your statement



I really have to emphasize that

- you do not change the smtp server by switching from courier to dovecot: that is simply changing the imap/pop3 front-end,
- courier is not safe, it is prone to vulnerabilities and hack attempts: you do not want that,
- you do not lose data, you do not even lose mail data if you switch from postfix to qmail or vice versa (read: postfix and qmail are the default mail servers shipped with Plesk)
- your Roundcube setup, config and/or entire installation already has been become corrupted: you cannot send mail via Roundcube (read: this should work by default!)

and, in conclusion, you have nothing to lose by changing to dovecot and/or to re-install Roundcube (if you do, please remove all files properly!).

No worries mate!

Regards........

So I switched to from courier to dovecot, from postfix to qmail and reinstalled roundcube. Still the same error as mentioned above..
I'm kind of desperate right now..
I even gave plesk repair mail a try.. didn't fix anything

What do you mean by removing all files properly? Which files include that?


Regards
 
Last edited:
Back
Top