Smtp ошибка 220 ошибка авторизации roundcube

I’m trying to get a roundcube/dovecot/postfix on a debian box on amazon running. I can log in and receive emails, but I cannot send. I get an error in roundcube, smtp authentication error (220) Authentication failed.

Roundcube error logs:

[24-Sep-2020 08:47:24 +0000]: <a83d4mll> PHP Error: STARTTLS failed (POST /?_task=mail&_unlock=loading1600937244456&_framed=1&_lang=en_US&_action=send)
[24-Sep-2020 08:47:24 +0000]: <a83d4mll> PHP Error: Invalid response code received from server (POST /?_task=mail&_unlock=loading1600937244456&_framed=1&_lang=en_US&_action=send)
[24-Sep-2020 08:47:24 +0000]: <a83d4mll> SMTP Error: Authentication failure: STARTTLS failed (Code: ) in /opt/bitnami/apps/roundcube/htdocs/program/lib/Roundcube/rcube.php on line 1702 (POST /?_task=mail&_unlock=loading1600937244456&_framed=1&_lang=en_US&_action=send)

roundcube SMTP log:

[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Connecting to tls://webmail.theomnihealthgroup.com:587...
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 220 mail.theomnihealthgroup.com ESMTP Postfix (Debian/GNU)
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Send: EHLO webmail.theomnihealthgroup.com
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250-mail.theomnihealthgroup.com
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250-PIPELINING
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250-SIZE 10240000
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250-VRFY
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250-ETRN
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250-STARTTLS
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250-ENHANCEDSTATUSCODES
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250-8BITMIME
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250-DSN
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250-SMTPUTF8
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250 CHUNKING
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Send: STARTTLS
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 220 2.0.0 Ready to start TLS
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Send: QUIT
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: ^V^C^C^A,^L^@^A(^C^@^] <80>ÄS<96>ñrgY(v^P¿<97>Åjò<¬<9e>ò^U­')gÔ<86>hG|¦^P^H^D^A^@Dv(RV<92>Tíìãô^HÂè<9c>è<98>ûÐU§­Ð^Bfã<87><9a>4BNPÙ<82>GÏs¬

I’m pretty sure this has to do with the certs but I’m not sure how to fix it.

  • Roundcube is running on apache at https://webmail.theomnihealthgroup.com
  • I have an ssl cert associated with the webmail domain
  • server is at theomnihealthgroup.org

postfix main.cf:

# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2



# TLS parameters
stmpd_tls_security_level = may
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
#smtpd_tls_cert_file=/opt/bitnami/letsencrypt/certificates/webmail.theomnihealthgroup.com.crt
#smtpd_tls_key_file=/opt/bitnami/letsencrypt/certificates/webmail.theomnihealthgroup.com.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = mail.theomnihealthgroup.com
#myhostname = theomnihealthgroup.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = theomnihealthgroup.com
mydomain = theomnihealthgroup.com
mydestination = $myhostname, ip-172-30-0-246.ec2.internal, localhost.ec2.internal, localhost, $mydomain, localhost.$mydomain
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
home_mailbox = Maildir/
local_recipient_maps = proxy:unix:passwd.byname $alias_maps
policyd-spf_time_limit = 3600
smtpd_recipient_restrictions =
   permit_mynetworks,
   permit_sasl_authenticated,
   reject_unauth_destination,
   check_policy_service unix:private/policyd-spf
# Milter configuration
milter_default_action = accept
milter_protocol = 6
smtpd_milters = local:opendkim/opendkim.sock
non_smtpd_milters = $smtpd_milters

dovecot config:

mail_location = maildir:~/Maildir
mail_privileged_group = mail
namespace inbox {
  inbox = yes
  location =
  mailbox Drafts {
    special_use = \Drafts
  }
  mailbox Junk {
    special_use = \Junk
  }
  mailbox Sent {
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }
  mailbox Trash {
    special_use = \Trash
  }
  prefix =
}
passdb {
  driver = pam
}
protocols = " imap"
service auth {
  unix_listener /var/spool/postfix/private/auth {
    mode = 0666
  }
  unix_listener auth-userdb {
    mode = 0666
  }
}
service imap-login {
  inet_listener imap {
    port = 143
  }
}
ssl_cert = </etc/dovecot/private/dovecot.pem
ssl_client_ca_dir = /etc/ssl/certs
ssl_dh = # hidden, use -P to show it
ssl_key = # hidden, use -P to show it
userdb {
  driver = passwd
}

roundcube config.inc.php

$config = array();
$config['debug_level'] = 1;
$config['smtp_debug'] = true;

// Database connection string (DSN) for read+write operations
// Format (compatible with PEAR MDB2): db_provider://user:password@host/database
// Currently supported db_providers: mysql, pgsql, sqlite, mssql, sqlsrv, oracle
// For examples see http://pear.php.net/manual/en/package.database.mdb2.intro-dsn.php
// NOTE: for SQLite use absolute path (Linux): 'sqlite:////full/path/to/sqlite.db?mode=0646'
//       or (Windows): 'sqlite:///C:/full/path/to/sqlite.db'
$config['db_dsnw'] = 'mysql://bn_roundcube:22223abcde@localhost:3306/bitnami_roundcube';

// The IMAP host chosen to perform the log-in.
// Leave blank to show a textbox at login, give a list of hosts
// to display a pulldown menu or set one host as string.
// Enter hostname with prefix ssl:// to use Implicit TLS, or use
// prefix tls:// to use STARTTLS.
// Supported replacement variables:
// %n - hostname ($_SERVER['SERVER_NAME'])
// %t - hostname without the first part
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
// %s - domain name after the '@' from e-mail address provided at login screen
// For example %n = mail.domain.tld, %t = domain.tld
$config['default_host'] = 'mail.theomnihealthgroup.com';

// SMTP server host (for sending mails).
// Enter hostname with prefix ssl:// to use Implicit TLS, or use
// prefix tls:// to use STARTTLS.
// Supported replacement variables:
// %h - user's IMAP hostname
// %n - hostname ($_SERVER['SERVER_NAME'])
// %t - hostname without the first part
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
// %z - IMAP domain (IMAP hostname without the first part)
// For example %n = mail.domain.tld, %t = domain.tld

# Also tried: $config['smtp_server'] = 'tls://theomnihealthgroup.com';
$config['smtp_server'] = 'tls://webmail.theomnihealthgroup.com';

// SMTP port. Use 25 for cleartext, 465 for Implicit TLS, or 587 for STARTTLS (default)
$config['smtp_port'] = 587;

// 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';
$config['smtp_auth_type'] = '';

// provide an URL where a user can get support for this Roundcube installation
// PLEASE DO NOT LINK TO THE ROUNDCUBE.NET WEBSITE HERE!
$config['support_url'] = 'https://community.bitnami.com/';

// Name your service. This is displayed on the login screen and in the window title
$config['product_name'] = 'Omni Mail';

// This key is used to encrypt the users imap password which is stored
// in the session record. For the default cipher method it must be
// exactly 24 characters long.
// YOUR KEY MUST BE DIFFERENT THAN THE SAMPLE VALUE FOR SECURITY REASONS
$config['des_key'] = 'KJDKJIJEIKDJ';

// List of active plugins (in plugins/ directory)
$config['plugins'] = array(
    'archive',
    'zipdownload',
);

// skin name: folder from skins/
$config['skin'] = 'elastic';
$config['default_port'] = 143;
$config['mime_param_folding'] = 0;

This is the full transcript. I removed the milters’ logs to reduce the complexity

Apr 28 14:07:56 host postfix/smtpd[12840]: connect from localhost[127.0.0.1]
Apr 28 14:07:56 host postfix/smtpd[12840]: smtp_stream_setup: maxtime=300 enable_deadline=0
Apr 28 14:07:56 host postfix/smtpd[12840]: match_hostname: smtpd_client_event_limit_exceptions: localhost ~? 127.0.0.1/32
Apr 28 14:07:56 host postfix/smtpd[12840]: match_hostaddr: smtpd_client_event_limit_exceptions: 127.0.0.1 ~? 127.0.0.1/32
Apr 28 14:07:56 host postfix/smtpd[12840]: report connect to all milters
Apr 28 14:07:56 host postfix/smtpd[12840]: trying... [127.0.0.1]
Apr 28 14:07:56 host postfix/smtpd[12840]: vstream_tweak_tcp: TCP_MAXSEG 32741
Apr 28 14:07:56 host postfix/smtpd[12840]: fd=24: stream buffer size old=0 new=130964
Apr 28 14:07:56 host postfix/smtpd[12840]: event: SMFIC_CONNECT; macros: j=host.example.com {daemon_name}=ORIGINATING {daemon_addr}=127.0.0.1 v=Postfix 3.4.14
Apr 28 14:07:56 host postfix/smtpd[12840]: reply: SMFIR_CONTINUE data 0 bytes
Apr 28 14:07:56 host postfix/smtpd[12840]: trying... [127.0.0.1]
Apr 28 14:07:56 host postfix/smtpd[12840]: vstream_tweak_tcp: TCP_MAXSEG 32741
Apr 28 14:07:56 host postfix/smtpd[12840]: fd=25: stream buffer size old=0 new=130964
Apr 28 14:07:56 host postfix/smtpd[12840]: event: SMFIC_CONNECT; macros: j=host.example.com {daemon_name}=ORIGINATING {daemon_addr}=127.0.0.1 v=Postfix 3.4.14
Apr 28 14:07:56 host postfix/smtpd[12840]: reply: SMFIR_ACCEPT data 0 bytes
Apr 28 14:07:56 host postfix/smtpd[12840]: > localhost[127.0.0.1]: 220 host.example.com ESMTP
Apr 28 14:07:56 host postfix/smtpd[12840]: watchdog_pat: 0x$abc
Apr 28 14:07:56 host postfix/smtpd[12840]: < localhost[127.0.0.1]: EHLO webmail.example.com
Apr 28 14:07:56 host postfix/smtpd[12840]: report helo to all milters
Apr 28 14:07:56 host postfix/smtpd[12840]: match_list_match: localhost: no match
Apr 28 14:07:56 host postfix/smtpd[12840]: match_list_match: 127.0.0.1: no match
Apr 28 14:07:56 host postfix/smtpd[12840]: > localhost[127.0.0.1]: 250-host.example.com
Apr 28 14:07:56 host postfix/smtpd[12840]: > localhost[127.0.0.1]: 250-PIPELINING
Apr 28 14:07:56 host postfix/smtpd[12840]: > localhost[127.0.0.1]: 250-SIZE 102400000
Apr 28 14:07:56 host postfix/smtpd[12840]: > localhost[127.0.0.1]: 250-ETRN
Apr 28 14:07:56 host postfix/smtpd[12840]: > localhost[127.0.0.1]: 250-STARTTLS
Apr 28 14:07:56 host postfix/smtpd[12840]: > localhost[127.0.0.1]: 250-ENHANCEDSTATUSCODES
Apr 28 14:07:56 host postfix/smtpd[12840]: > localhost[127.0.0.1]: 250-8BITMIME
Apr 28 14:07:56 host postfix/smtpd[12840]: > localhost[127.0.0.1]: 250-DSN
Apr 28 14:07:56 host postfix/smtpd[12840]: > localhost[127.0.0.1]: 250-SMTPUTF8
Apr 28 14:07:56 host postfix/smtpd[12840]: > localhost[127.0.0.1]: 250 CHUNKING
Apr 28 14:07:56 host postfix/smtpd[12840]: watchdog_pat: 0x$abc
Apr 28 14:07:56 host postfix/smtpd[12840]: < localhost[127.0.0.1]: STARTTLS
Apr 28 14:07:56 host postfix/smtpd[12840]: query milter states for other event
Apr 28 14:07:56 host postfix/smtpd[12840]: > localhost[127.0.0.1]: 220 2.0.0 Ready to start TLS
Apr 28 14:07:56 host postfix/smtpd[12840]: abort all milters
Apr 28 14:07:56 host postfix/smtpd[12840]: send attr request = seed
Apr 28 14:07:56 host postfix/smtpd[12840]: send attr size = 32
Apr 28 14:07:56 host postfix/smtpd[12840]: private/tlsmgr: wanted attribute: status
Apr 28 14:07:56 host postfix/smtpd[12840]: input attribute name: status
Apr 28 14:07:56 host postfix/smtpd[12840]: input attribute value: 0
Apr 28 14:07:56 host postfix/smtpd[12840]: private/tlsmgr: wanted attribute: seed
Apr 28 14:07:56 host postfix/smtpd[12840]: input attribute name: seed
Apr 28 14:07:56 host postfix/smtpd[12840]: input attribute value: $base64
Apr 28 14:07:56 host postfix/smtpd[12840]: private/tlsmgr: wanted attribute: (list terminator)
Apr 28 14:07:56 host postfix/smtpd[12840]: input attribute name: (end)
Apr 28 14:07:56 host postfix/smtpd[12840]: send attr request = tktkey
Apr 28 14:07:56 host postfix/smtpd[12840]: send attr keyname = [data 0 bytes]
Apr 28 14:07:56 host postfix/smtpd[12840]: private/tlsmgr: wanted attribute: status
Apr 28 14:07:56 host postfix/smtpd[12840]: input attribute name: status
Apr 28 14:07:56 host postfix/smtpd[12840]: input attribute value: 0
Apr 28 14:07:56 host postfix/smtpd[12840]: private/tlsmgr: wanted attribute: keybuf
Apr 28 14:07:56 host postfix/smtpd[12840]: input attribute name: keybuf
Apr 28 14:07:56 host postfix/smtpd[12840]: input attribute value: $base64
Apr 28 14:07:56 host postfix/smtpd[12840]: private/tlsmgr: wanted attribute: (list terminator)
Apr 28 14:07:56 host postfix/smtpd[12840]: input attribute name: (end)
Apr 28 14:07:56 host postfix/smtpd[12840]: Anonymous TLS connection established from localhost[127.0.0.1]: TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)
Apr 28 14:07:56 host postfix/smtpd[12840]: xsasl_dovecot_server_create: SASL service=smtp, realm=host.example.com
Apr 28 14:07:56 host postfix/smtpd[12840]: name_mask: noanonymous
Apr 28 14:07:56 host postfix/smtpd[12840]: xsasl_dovecot_server_connect: Connecting
Apr 28 14:07:56 host postfix/smtpd[12840]: xsasl_dovecot_server_connect: auth reply: VERSION?1?2
Apr 28 14:07:56 host postfix/smtpd[12840]: xsasl_dovecot_server_connect: auth reply: MECH?PLAIN?plaintext
Apr 28 14:07:56 host postfix/smtpd[12840]: name_mask: plaintext
Apr 28 14:07:56 host postfix/smtpd[12840]: xsasl_dovecot_server_connect: auth reply: MECH?LOGIN?plaintext
Apr 28 14:07:56 host postfix/smtpd[12840]: name_mask: plaintext
Apr 28 14:07:56 host postfix/smtpd[12840]: xsasl_dovecot_server_connect: auth reply: SPID?$XXX
Apr 28 14:07:56 host postfix/smtpd[12840]: xsasl_dovecot_server_connect: auth reply: CUID?$XXX
Apr 28 14:07:56 host postfix/smtpd[12840]: xsasl_dovecot_server_connect: auth reply: COOKIE?$XXX
Apr 28 14:07:56 host postfix/smtpd[12840]: xsasl_dovecot_server_connect: auth reply: DONE
Apr 28 14:07:56 host postfix/smtpd[12840]: xsasl_dovecot_server_mech_filter: keep mechanism: PLAIN
Apr 28 14:07:56 host postfix/smtpd[12840]: xsasl_dovecot_server_mech_filter: keep mechanism: LOGIN
Apr 28 14:07:56 host postfix/smtpd[12840]: watchdog_pat: 0x$abc
Apr 28 14:07:56 host postfix/smtpd[12840]: smtp_get: EOF
Apr 28 14:07:56 host postfix/smtpd[12840]: match_hostname: smtpd_client_event_limit_exceptions: localhost ~? 127.0.0.1/32
Apr 28 14:07:56 host postfix/smtpd[12840]: match_hostaddr: smtpd_client_event_limit_exceptions: 127.0.0.1 ~? 127.0.0.1/32
Apr 28 14:07:56 host postfix/smtpd[12840]: lost connection after STARTTLS from localhost[127.0.0.1]
Apr 28 14:07:56 host postfix/smtpd[12840]: disconnect event to all milters
Apr 28 14:07:57 host postfix/smtpd[12840]: disconnect from localhost[127.0.0.1] ehlo=1 starttls=1 commands=2
Apr 28 14:07:57 host postfix/smtpd[12840]: free all milters

I’m trying to get a roundcube/dovecot/postfix on a debian box on amazon running. I can log in and receive emails, but I cannot send. I get an error in roundcube, smtp authentication error (220) Authentication failed.

Roundcube error logs:

[24-Sep-2020 08:47:24 +0000]: <a83d4mll> PHP Error: STARTTLS failed (POST /?_task=mail&_unlock=loading1600937244456&_framed=1&_lang=en_US&_action=send)
[24-Sep-2020 08:47:24 +0000]: <a83d4mll> PHP Error: Invalid response code received from server (POST /?_task=mail&_unlock=loading1600937244456&_framed=1&_lang=en_US&_action=send)
[24-Sep-2020 08:47:24 +0000]: <a83d4mll> SMTP Error: Authentication failure: STARTTLS failed (Code: ) in /opt/bitnami/apps/roundcube/htdocs/program/lib/Roundcube/rcube.php on line 1702 (POST /?_task=mail&_unlock=loading1600937244456&_framed=1&_lang=en_US&_action=send)

roundcube SMTP log:

[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Connecting to tls://webmail.theomnihealthgroup.com:587...
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 220 mail.theomnihealthgroup.com ESMTP Postfix (Debian/GNU)
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Send: EHLO webmail.theomnihealthgroup.com
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250-mail.theomnihealthgroup.com
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250-PIPELINING
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250-SIZE 10240000
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250-VRFY
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250-ETRN
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250-STARTTLS
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250-ENHANCEDSTATUSCODES
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250-8BITMIME
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250-DSN
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250-SMTPUTF8
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250 CHUNKING
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Send: STARTTLS
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 220 2.0.0 Ready to start TLS
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Send: QUIT
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: ^V^C^C^A,^L^@^A(^C^@^] <80>ÄS<96>ñrgY(v^P¿<97>Åjò<¬<9e>ò^U­')gÔ<86>hG|¦^P^H^D^A^@Dv(RV<92>Tíìãô^HÂè<9c>è<98>ûÐU§­Ð^Bfã<87><9a>4BNPÙ<82>GÏs¬

I’m pretty sure this has to do with the certs but I’m not sure how to fix it.

  • Roundcube is running on apache at https://webmail.theomnihealthgroup.com
  • I have an ssl cert associated with the webmail domain
  • server is at theomnihealthgroup.org

postfix main.cf:

# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2



# TLS parameters
stmpd_tls_security_level = may
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
#smtpd_tls_cert_file=/opt/bitnami/letsencrypt/certificates/webmail.theomnihealthgroup.com.crt
#smtpd_tls_key_file=/opt/bitnami/letsencrypt/certificates/webmail.theomnihealthgroup.com.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = mail.theomnihealthgroup.com
#myhostname = theomnihealthgroup.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = theomnihealthgroup.com
mydomain = theomnihealthgroup.com
mydestination = $myhostname, ip-172-30-0-246.ec2.internal, localhost.ec2.internal, localhost, $mydomain, localhost.$mydomain
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
home_mailbox = Maildir/
local_recipient_maps = proxy:unix:passwd.byname $alias_maps
policyd-spf_time_limit = 3600
smtpd_recipient_restrictions =
   permit_mynetworks,
   permit_sasl_authenticated,
   reject_unauth_destination,
   check_policy_service unix:private/policyd-spf
# Milter configuration
milter_default_action = accept
milter_protocol = 6
smtpd_milters = local:opendkim/opendkim.sock
non_smtpd_milters = $smtpd_milters

dovecot config:

mail_location = maildir:~/Maildir
mail_privileged_group = mail
namespace inbox {
  inbox = yes
  location =
  mailbox Drafts {
    special_use = Drafts
  }
  mailbox Junk {
    special_use = Junk
  }
  mailbox Sent {
    special_use = Sent
  }
  mailbox "Sent Messages" {
    special_use = Sent
  }
  mailbox Trash {
    special_use = Trash
  }
  prefix =
}
passdb {
  driver = pam
}
protocols = " imap"
service auth {
  unix_listener /var/spool/postfix/private/auth {
    mode = 0666
  }
  unix_listener auth-userdb {
    mode = 0666
  }
}
service imap-login {
  inet_listener imap {
    port = 143
  }
}
ssl_cert = </etc/dovecot/private/dovecot.pem
ssl_client_ca_dir = /etc/ssl/certs
ssl_dh = # hidden, use -P to show it
ssl_key = # hidden, use -P to show it
userdb {
  driver = passwd
}

roundcube config.inc.php

$config = array();
$config['debug_level'] = 1;
$config['smtp_debug'] = true;

// Database connection string (DSN) for read+write operations
// Format (compatible with PEAR MDB2): db_provider://user:password@host/database
// Currently supported db_providers: mysql, pgsql, sqlite, mssql, sqlsrv, oracle
// For examples see http://pear.php.net/manual/en/package.database.mdb2.intro-dsn.php
// NOTE: for SQLite use absolute path (Linux): 'sqlite:////full/path/to/sqlite.db?mode=0646'
//       or (Windows): 'sqlite:///C:/full/path/to/sqlite.db'
$config['db_dsnw'] = 'mysql://bn_roundcube:22223abcde@localhost:3306/bitnami_roundcube';

// The IMAP host chosen to perform the log-in.
// Leave blank to show a textbox at login, give a list of hosts
// to display a pulldown menu or set one host as string.
// Enter hostname with prefix ssl:// to use Implicit TLS, or use
// prefix tls:// to use STARTTLS.
// Supported replacement variables:
// %n - hostname ($_SERVER['SERVER_NAME'])
// %t - hostname without the first part
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
// %s - domain name after the '@' from e-mail address provided at login screen
// For example %n = mail.domain.tld, %t = domain.tld
$config['default_host'] = 'mail.theomnihealthgroup.com';

// SMTP server host (for sending mails).
// Enter hostname with prefix ssl:// to use Implicit TLS, or use
// prefix tls:// to use STARTTLS.
// Supported replacement variables:
// %h - user's IMAP hostname
// %n - hostname ($_SERVER['SERVER_NAME'])
// %t - hostname without the first part
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
// %z - IMAP domain (IMAP hostname without the first part)
// For example %n = mail.domain.tld, %t = domain.tld

# Also tried: $config['smtp_server'] = 'tls://theomnihealthgroup.com';
$config['smtp_server'] = 'tls://webmail.theomnihealthgroup.com';

// SMTP port. Use 25 for cleartext, 465 for Implicit TLS, or 587 for STARTTLS (default)
$config['smtp_port'] = 587;

// 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';
$config['smtp_auth_type'] = '';

// provide an URL where a user can get support for this Roundcube installation
// PLEASE DO NOT LINK TO THE ROUNDCUBE.NET WEBSITE HERE!
$config['support_url'] = 'https://community.bitnami.com/';

// Name your service. This is displayed on the login screen and in the window title
$config['product_name'] = 'Omni Mail';

// This key is used to encrypt the users imap password which is stored
// in the session record. For the default cipher method it must be
// exactly 24 characters long.
// YOUR KEY MUST BE DIFFERENT THAN THE SAMPLE VALUE FOR SECURITY REASONS
$config['des_key'] = 'KJDKJIJEIKDJ';

// List of active plugins (in plugins/ directory)
$config['plugins'] = array(
    'archive',
    'zipdownload',
);

// skin name: folder from skins/
$config['skin'] = 'elastic';
$config['default_port'] = 143;
$config['mime_param_folding'] = 0;

This is the full transcript. I removed the milters’ logs to reduce the complexity

Apr 28 14:07:56 host postfix/smtpd[12840]: connect from localhost[127.0.0.1]
Apr 28 14:07:56 host postfix/smtpd[12840]: smtp_stream_setup: maxtime=300 enable_deadline=0
Apr 28 14:07:56 host postfix/smtpd[12840]: match_hostname: smtpd_client_event_limit_exceptions: localhost ~? 127.0.0.1/32
Apr 28 14:07:56 host postfix/smtpd[12840]: match_hostaddr: smtpd_client_event_limit_exceptions: 127.0.0.1 ~? 127.0.0.1/32
Apr 28 14:07:56 host postfix/smtpd[12840]: report connect to all milters
Apr 28 14:07:56 host postfix/smtpd[12840]: trying... [127.0.0.1]
Apr 28 14:07:56 host postfix/smtpd[12840]: vstream_tweak_tcp: TCP_MAXSEG 32741
Apr 28 14:07:56 host postfix/smtpd[12840]: fd=24: stream buffer size old=0 new=130964
Apr 28 14:07:56 host postfix/smtpd[12840]: event: SMFIC_CONNECT; macros: j=host.example.com {daemon_name}=ORIGINATING {daemon_addr}=127.0.0.1 v=Postfix 3.4.14
Apr 28 14:07:56 host postfix/smtpd[12840]: reply: SMFIR_CONTINUE data 0 bytes
Apr 28 14:07:56 host postfix/smtpd[12840]: trying... [127.0.0.1]
Apr 28 14:07:56 host postfix/smtpd[12840]: vstream_tweak_tcp: TCP_MAXSEG 32741
Apr 28 14:07:56 host postfix/smtpd[12840]: fd=25: stream buffer size old=0 new=130964
Apr 28 14:07:56 host postfix/smtpd[12840]: event: SMFIC_CONNECT; macros: j=host.example.com {daemon_name}=ORIGINATING {daemon_addr}=127.0.0.1 v=Postfix 3.4.14
Apr 28 14:07:56 host postfix/smtpd[12840]: reply: SMFIR_ACCEPT data 0 bytes
Apr 28 14:07:56 host postfix/smtpd[12840]: > localhost[127.0.0.1]: 220 host.example.com ESMTP
Apr 28 14:07:56 host postfix/smtpd[12840]: watchdog_pat: 0x$abc
Apr 28 14:07:56 host postfix/smtpd[12840]: < localhost[127.0.0.1]: EHLO webmail.example.com
Apr 28 14:07:56 host postfix/smtpd[12840]: report helo to all milters
Apr 28 14:07:56 host postfix/smtpd[12840]: match_list_match: localhost: no match
Apr 28 14:07:56 host postfix/smtpd[12840]: match_list_match: 127.0.0.1: no match
Apr 28 14:07:56 host postfix/smtpd[12840]: > localhost[127.0.0.1]: 250-host.example.com
Apr 28 14:07:56 host postfix/smtpd[12840]: > localhost[127.0.0.1]: 250-PIPELINING
Apr 28 14:07:56 host postfix/smtpd[12840]: > localhost[127.0.0.1]: 250-SIZE 102400000
Apr 28 14:07:56 host postfix/smtpd[12840]: > localhost[127.0.0.1]: 250-ETRN
Apr 28 14:07:56 host postfix/smtpd[12840]: > localhost[127.0.0.1]: 250-STARTTLS
Apr 28 14:07:56 host postfix/smtpd[12840]: > localhost[127.0.0.1]: 250-ENHANCEDSTATUSCODES
Apr 28 14:07:56 host postfix/smtpd[12840]: > localhost[127.0.0.1]: 250-8BITMIME
Apr 28 14:07:56 host postfix/smtpd[12840]: > localhost[127.0.0.1]: 250-DSN
Apr 28 14:07:56 host postfix/smtpd[12840]: > localhost[127.0.0.1]: 250-SMTPUTF8
Apr 28 14:07:56 host postfix/smtpd[12840]: > localhost[127.0.0.1]: 250 CHUNKING
Apr 28 14:07:56 host postfix/smtpd[12840]: watchdog_pat: 0x$abc
Apr 28 14:07:56 host postfix/smtpd[12840]: < localhost[127.0.0.1]: STARTTLS
Apr 28 14:07:56 host postfix/smtpd[12840]: query milter states for other event
Apr 28 14:07:56 host postfix/smtpd[12840]: > localhost[127.0.0.1]: 220 2.0.0 Ready to start TLS
Apr 28 14:07:56 host postfix/smtpd[12840]: abort all milters
Apr 28 14:07:56 host postfix/smtpd[12840]: send attr request = seed
Apr 28 14:07:56 host postfix/smtpd[12840]: send attr size = 32
Apr 28 14:07:56 host postfix/smtpd[12840]: private/tlsmgr: wanted attribute: status
Apr 28 14:07:56 host postfix/smtpd[12840]: input attribute name: status
Apr 28 14:07:56 host postfix/smtpd[12840]: input attribute value: 0
Apr 28 14:07:56 host postfix/smtpd[12840]: private/tlsmgr: wanted attribute: seed
Apr 28 14:07:56 host postfix/smtpd[12840]: input attribute name: seed
Apr 28 14:07:56 host postfix/smtpd[12840]: input attribute value: $base64
Apr 28 14:07:56 host postfix/smtpd[12840]: private/tlsmgr: wanted attribute: (list terminator)
Apr 28 14:07:56 host postfix/smtpd[12840]: input attribute name: (end)
Apr 28 14:07:56 host postfix/smtpd[12840]: send attr request = tktkey
Apr 28 14:07:56 host postfix/smtpd[12840]: send attr keyname = [data 0 bytes]
Apr 28 14:07:56 host postfix/smtpd[12840]: private/tlsmgr: wanted attribute: status
Apr 28 14:07:56 host postfix/smtpd[12840]: input attribute name: status
Apr 28 14:07:56 host postfix/smtpd[12840]: input attribute value: 0
Apr 28 14:07:56 host postfix/smtpd[12840]: private/tlsmgr: wanted attribute: keybuf
Apr 28 14:07:56 host postfix/smtpd[12840]: input attribute name: keybuf
Apr 28 14:07:56 host postfix/smtpd[12840]: input attribute value: $base64
Apr 28 14:07:56 host postfix/smtpd[12840]: private/tlsmgr: wanted attribute: (list terminator)
Apr 28 14:07:56 host postfix/smtpd[12840]: input attribute name: (end)
Apr 28 14:07:56 host postfix/smtpd[12840]: Anonymous TLS connection established from localhost[127.0.0.1]: TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)
Apr 28 14:07:56 host postfix/smtpd[12840]: xsasl_dovecot_server_create: SASL service=smtp, realm=host.example.com
Apr 28 14:07:56 host postfix/smtpd[12840]: name_mask: noanonymous
Apr 28 14:07:56 host postfix/smtpd[12840]: xsasl_dovecot_server_connect: Connecting
Apr 28 14:07:56 host postfix/smtpd[12840]: xsasl_dovecot_server_connect: auth reply: VERSION?1?2
Apr 28 14:07:56 host postfix/smtpd[12840]: xsasl_dovecot_server_connect: auth reply: MECH?PLAIN?plaintext
Apr 28 14:07:56 host postfix/smtpd[12840]: name_mask: plaintext
Apr 28 14:07:56 host postfix/smtpd[12840]: xsasl_dovecot_server_connect: auth reply: MECH?LOGIN?plaintext
Apr 28 14:07:56 host postfix/smtpd[12840]: name_mask: plaintext
Apr 28 14:07:56 host postfix/smtpd[12840]: xsasl_dovecot_server_connect: auth reply: SPID?$XXX
Apr 28 14:07:56 host postfix/smtpd[12840]: xsasl_dovecot_server_connect: auth reply: CUID?$XXX
Apr 28 14:07:56 host postfix/smtpd[12840]: xsasl_dovecot_server_connect: auth reply: COOKIE?$XXX
Apr 28 14:07:56 host postfix/smtpd[12840]: xsasl_dovecot_server_connect: auth reply: DONE
Apr 28 14:07:56 host postfix/smtpd[12840]: xsasl_dovecot_server_mech_filter: keep mechanism: PLAIN
Apr 28 14:07:56 host postfix/smtpd[12840]: xsasl_dovecot_server_mech_filter: keep mechanism: LOGIN
Apr 28 14:07:56 host postfix/smtpd[12840]: watchdog_pat: 0x$abc
Apr 28 14:07:56 host postfix/smtpd[12840]: smtp_get: EOF
Apr 28 14:07:56 host postfix/smtpd[12840]: match_hostname: smtpd_client_event_limit_exceptions: localhost ~? 127.0.0.1/32
Apr 28 14:07:56 host postfix/smtpd[12840]: match_hostaddr: smtpd_client_event_limit_exceptions: 127.0.0.1 ~? 127.0.0.1/32
Apr 28 14:07:56 host postfix/smtpd[12840]: lost connection after STARTTLS from localhost[127.0.0.1]
Apr 28 14:07:56 host postfix/smtpd[12840]: disconnect event to all milters
Apr 28 14:07:57 host postfix/smtpd[12840]: disconnect from localhost[127.0.0.1] ehlo=1 starttls=1 commands=2
Apr 28 14:07:57 host postfix/smtpd[12840]: free all milters

I’m trying to get a roundcube/dovecot/postfix on a debian box on amazon running. I can log in and receive emails, but I cannot send. I get an error in roundcube, smtp authentication error (220) Authentication failed.

Roundcube error logs:

[24-Sep-2020 08:47:24 +0000]: <a83d4mll> PHP Error: STARTTLS failed (POST /?_task=mail&_unlock=loading1600937244456&_framed=1&_lang=en_US&_action=send)
[24-Sep-2020 08:47:24 +0000]: <a83d4mll> PHP Error: Invalid response code received from server (POST /?_task=mail&_unlock=loading1600937244456&_framed=1&_lang=en_US&_action=send)
[24-Sep-2020 08:47:24 +0000]: <a83d4mll> SMTP Error: Authentication failure: STARTTLS failed (Code: ) in /opt/bitnami/apps/roundcube/htdocs/program/lib/Roundcube/rcube.php on line 1702 (POST /?_task=mail&_unlock=loading1600937244456&_framed=1&_lang=en_US&_action=send)

roundcube SMTP log:

[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Connecting to tls://webmail.theomnihealthgroup.com:587...
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 220 mail.theomnihealthgroup.com ESMTP Postfix (Debian/GNU)
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Send: EHLO webmail.theomnihealthgroup.com
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250-mail.theomnihealthgroup.com
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250-PIPELINING
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250-SIZE 10240000
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250-VRFY
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250-ETRN
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250-STARTTLS
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250-ENHANCEDSTATUSCODES
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250-8BITMIME
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250-DSN
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250-SMTPUTF8
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 250 CHUNKING
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Send: STARTTLS
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: 220 2.0.0 Ready to start TLS
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Send: QUIT
[24-Sep-2020 08:52:08 +0000]: <a83d4mll> Recv: ^V^C^C^A,^L^@^A(^C^@^] <80>ÄS<96>ñrgY(v^P¿<97>Åjò<¬<9e>ò^U­')gÔ<86>hG|¦^P^H^D^A^@Dv(RV<92>Tíìãô^HÂè<9c>è<98>ûÐU§­Ð^Bfã<87><9a>4BNPÙ<82>GÏs¬

I’m pretty sure this has to do with the certs but I’m not sure how to fix it.

  • Roundcube is running on apache at https://webmail.theomnihealthgroup.com
  • I have an ssl cert associated with the webmail domain
  • server is at theomnihealthgroup.org

postfix main.cf:

# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2



# TLS parameters
stmpd_tls_security_level = may
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
#smtpd_tls_cert_file=/opt/bitnami/letsencrypt/certificates/webmail.theomnihealthgroup.com.crt
#smtpd_tls_key_file=/opt/bitnami/letsencrypt/certificates/webmail.theomnihealthgroup.com.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = mail.theomnihealthgroup.com
#myhostname = theomnihealthgroup.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = theomnihealthgroup.com
mydomain = theomnihealthgroup.com
mydestination = $myhostname, ip-172-30-0-246.ec2.internal, localhost.ec2.internal, localhost, $mydomain, localhost.$mydomain
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
home_mailbox = Maildir/
local_recipient_maps = proxy:unix:passwd.byname $alias_maps
policyd-spf_time_limit = 3600
smtpd_recipient_restrictions =
   permit_mynetworks,
   permit_sasl_authenticated,
   reject_unauth_destination,
   check_policy_service unix:private/policyd-spf
# Milter configuration
milter_default_action = accept
milter_protocol = 6
smtpd_milters = local:opendkim/opendkim.sock
non_smtpd_milters = $smtpd_milters

dovecot config:

mail_location = maildir:~/Maildir
mail_privileged_group = mail
namespace inbox {
  inbox = yes
  location =
  mailbox Drafts {
    special_use = Drafts
  }
  mailbox Junk {
    special_use = Junk
  }
  mailbox Sent {
    special_use = Sent
  }
  mailbox "Sent Messages" {
    special_use = Sent
  }
  mailbox Trash {
    special_use = Trash
  }
  prefix =
}
passdb {
  driver = pam
}
protocols = " imap"
service auth {
  unix_listener /var/spool/postfix/private/auth {
    mode = 0666
  }
  unix_listener auth-userdb {
    mode = 0666
  }
}
service imap-login {
  inet_listener imap {
    port = 143
  }
}
ssl_cert = </etc/dovecot/private/dovecot.pem
ssl_client_ca_dir = /etc/ssl/certs
ssl_dh = # hidden, use -P to show it
ssl_key = # hidden, use -P to show it
userdb {
  driver = passwd
}

roundcube config.inc.php

$config = array();
$config['debug_level'] = 1;
$config['smtp_debug'] = true;

// Database connection string (DSN) for read+write operations
// Format (compatible with PEAR MDB2): db_provider://user:password@host/database
// Currently supported db_providers: mysql, pgsql, sqlite, mssql, sqlsrv, oracle
// For examples see http://pear.php.net/manual/en/package.database.mdb2.intro-dsn.php
// NOTE: for SQLite use absolute path (Linux): 'sqlite:////full/path/to/sqlite.db?mode=0646'
//       or (Windows): 'sqlite:///C:/full/path/to/sqlite.db'
$config['db_dsnw'] = 'mysql://bn_roundcube:22223abcde@localhost:3306/bitnami_roundcube';

// The IMAP host chosen to perform the log-in.
// Leave blank to show a textbox at login, give a list of hosts
// to display a pulldown menu or set one host as string.
// Enter hostname with prefix ssl:// to use Implicit TLS, or use
// prefix tls:// to use STARTTLS.
// Supported replacement variables:
// %n - hostname ($_SERVER['SERVER_NAME'])
// %t - hostname without the first part
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
// %s - domain name after the '@' from e-mail address provided at login screen
// For example %n = mail.domain.tld, %t = domain.tld
$config['default_host'] = 'mail.theomnihealthgroup.com';

// SMTP server host (for sending mails).
// Enter hostname with prefix ssl:// to use Implicit TLS, or use
// prefix tls:// to use STARTTLS.
// Supported replacement variables:
// %h - user's IMAP hostname
// %n - hostname ($_SERVER['SERVER_NAME'])
// %t - hostname without the first part
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
// %z - IMAP domain (IMAP hostname without the first part)
// For example %n = mail.domain.tld, %t = domain.tld

# Also tried: $config['smtp_server'] = 'tls://theomnihealthgroup.com';
$config['smtp_server'] = 'tls://webmail.theomnihealthgroup.com';

// SMTP port. Use 25 for cleartext, 465 for Implicit TLS, or 587 for STARTTLS (default)
$config['smtp_port'] = 587;

// 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';
$config['smtp_auth_type'] = '';

// provide an URL where a user can get support for this Roundcube installation
// PLEASE DO NOT LINK TO THE ROUNDCUBE.NET WEBSITE HERE!
$config['support_url'] = 'https://community.bitnami.com/';

// Name your service. This is displayed on the login screen and in the window title
$config['product_name'] = 'Omni Mail';

// This key is used to encrypt the users imap password which is stored
// in the session record. For the default cipher method it must be
// exactly 24 characters long.
// YOUR KEY MUST BE DIFFERENT THAN THE SAMPLE VALUE FOR SECURITY REASONS
$config['des_key'] = 'KJDKJIJEIKDJ';

// List of active plugins (in plugins/ directory)
$config['plugins'] = array(
    'archive',
    'zipdownload',
);

// skin name: folder from skins/
$config['skin'] = 'elastic';
$config['default_port'] = 143;
$config['mime_param_folding'] = 0;


0

2

Roundcube настроен так:

$rcmail_config['smtp_server'] = 'localhost';
$rcmail_config['smtp_port'] = 25;
$rcmail_config['smtp_user'] = '%u';
$rcmail_config['smtp_pass'] = '%p';
$rcmail_config['smtp_auth_type'] = '';
$rcmail_config['smtp_auth_cid'] = null;
$rcmail_config['smtp_auth_pw'] = null;
$rcmail_config['smtp_helo_host'] = 'localhost.localdomain';
$rcmail_config['smtp_timeout'] = 0;

при попытке отправить почту вываливается ошибка:

[27-May-2013 21:44:05 +0400]: SMTP Error: SMTP error: Authentication failure: SMTP server does not support authentication (Code: ) in /usr/share/roundcubemail/program/include/rcmail.php on line 1009 (POST /mail/?_unlock=loading1369676645733&_lang=ru?_task=mail&_action=send)

При этом smtp авторизация через thunderbird проходит наура.

Topic: SMTP error (220)  (Read 3302 times)

Roundcube Webmail 1.1.2:

$config['smtp_server'] = 'tls://smtp.example.com';
$config['smtp_port'] = 587;
$config['smtp_user'] = '%u';
$config['smtp_pass'] = '%p';
$config['smtp_auth_type'] = 'DIGEST-MD5';

SMTP sent OK

Roundcube Webmail 1.1.10:

$config['smtp_server'] = 'tls://smtp.example.com';
$config['smtp_port'] = 587;
$config['smtp_user'] = '%u';
$config['smtp_pass'] = '%p';
$config['smtp_auth_type'] = 'DIGEST-MD5';

SMTP error (220): Authorisation Error.

maillog:

postfix/smtpd[5636]: connect from mail.example.com[192.168.1.5]
postfix/smtpd[5636]: setting up TLS connection from mail.example.com[192.168.1.5]
postfix/smtpd[5636]: Anonymous TLS connection established from mail.example.com[192.168.1.5]: TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)
dovecot: auth: Debug: auth client connected (pid=0)
postfix/smtpd[5636]: lost connection after STARTTLS from mail.example.com[192.168.1.5]
postfix/smtpd[5636]: disconnect from mail.example.com[192.168.1.5]


What could be the problem?

« Last Edit: November 26, 2017, 03:09:56 PM by dmrc »


Logged


Can anyone help me to figure out «SMTP error (220)» in roundcube webmail.
Via webmail im unable to send a mail but through outlook and thunderbird its working.


Logged


  • #1

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

  • #2

Hi,

if you use STARTTLS, you should use port 587

//$config[‘smtp_port’] = 25;
$config[‘smtp_port’] = 587;

hope that helps. Cheers, Tom

  • #3

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: Aug 5, 2018

  • #4

@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!

  • #5

@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

  • #6

@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……..

  • #7

@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

  • #8

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.

  • #9

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………

  • #10

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’;

  • #11

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

  • #12

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$

  • #13

try playing around with the values, localhost 25, localhost 587, etc…

regards
Jan

  • #14

try playing around with the values, localhost 25, localhost 587, etc…

regards
Jan

not works

  • #15

@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!

  • #16

@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…..

  • #17

@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: Aug 10, 2018

  • #18

@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……..

  • #19

@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

  • #20

@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: Aug 10, 2018

The undocumented parameter: socket_options , let me authenticate when I got this error:
authentication failure [SMTP: STARTTLS failed (code: 220, response: TLS go ahead)].

I just need add :
‘auth’ => «PLAIN»,
‘socket_options’ => array(‘ssl’ => array(‘verify_peer_name’ => false)),

Taken from: https://pear.php.net/manual/en/package.mail.mail.factory.php


I was getting this error, but even disabling STARTTLS (as several of the above comments suggest) didn’t help, as it then reported an authentication error. I found the proper fix for at least my situation.

If you’re using PHP 5.6, there are changes to SSL:
http://php.net/manual/en/migration56.openssl.php

Mainly, there is extra verification done on the connection. This verification wasn’t done on 5.5 so these issues were ignored. But in my situation, the server was sending the SMTP EHLO command with «localhost» and apparently that causes PHP’s new verification to fail.

The solution is to patch osTicket’s mail class at /include/pear/Net/SMTP.php — change this line:

$this->_socket_options =$socket_options;

to

$this->_socket_options = array(‘ssl’ => array(‘verify_peer_name’ => false));

This turns the verification off. For my setup, the mail server is on the same local network as the osTicket server, so I’m not overly concerned about the security.

The other solution is to downgrade to PHP 5.5 which doesn’t have this extra verification.

It’d be nice if osTicket somehow offered a setting for this so patching the code isn’t necessary every time.

Taken from: https://github.com/pear/Net_SMTP/issues/14

я пытаюсь отправить письмо с вложением в PHP, используя SMTP и PEAR, но получаю сообщение об ошибке «Ошибка аутентификации [SMTP: STARTTLS не удалось (код: 220, ответ: 2.0.0 Готов запустить TLS)]»

<?php
require_once "Mail.php"; // PEAR Mail package
require_once ('Mail/mime.php'); // PEAR Mail_Mime packge

$from = "Your Mom <sender@gmail.com>";
$to = "Me <recepient address@gmail.com>";
$subject = 'Call Me!';

$headers = array ('From' => $from,'To' => $to, 'Subject' => $subject);

// text and html versions of email.
$text = 'Hi son, what are you doing?nnHeres an picture of a cat for you.';
$html = 'Hi son, what are you doing?<br /><br />Here is an picture of a cat
for you.';

// attachment
$file = 'fromc.xls';
$crlf = "n";

$mime = new Mail_mime($crlf);
$mime->setTXTBody($text);
$mime->setHTMLBody($html);
$mime->addAttachment($file, 'text/plain');

$body = $mime->get();
$headers = $mime->headers($headers);

$host = "smtp.gmail.com";
$username = "xyz@gmail.com";
$password = "xyz";

$smtp = Mail::factory('smtp', array ('host' => $host, 'auth' => true,
'username' => $username,'password' => $password));

$mail = $smtp->send($to, $headers, $body);

if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
}
else {
echo("<p>Message successfully sent!</p>");
}
?>`

Версия PHP: 1.10.1
Версия PEAR: 7.1.6
получил код от Вот
пожалуйста, помогите мне исправить ошибку …

0

Решение

Другие решения

Недокументированный параметр: socket_options, позвольте мне пройти аутентификацию, когда я получил эту ошибку:
ошибка аутентификации [SMTP: сбой STARTTLS (код: 220, ответ: вперед TLS)].

Мне просто нужно добавить:
‘auth’ => «PLAIN»,
‘socket_options’ => array (‘ssl’ => array (‘verify_peer_name’ => false)),

Взято из: https://pear.php.net/manual/en/package.mail.mail.factory.php


Я получал эту ошибку, но даже отключение STARTTLS (как предлагают некоторые из приведенных выше комментариев) не помогло, так как тогда сообщалось об ошибке аутентификации. Я нашел правильное решение по крайней мере для моей ситуации.

Если вы используете PHP 5.6, есть изменения в SSL:
http://php.net/manual/en/migration56.openssl.php

В основном, проводится дополнительная проверка соединения. Эта проверка не была выполнена на 5.5, поэтому эти проблемы были проигнорированы. Но в моей ситуации сервер отправлял команду SMTP EHLO с «localhost», что, очевидно, приводит к сбою новой проверки PHP.

Решением является исправление класса почты osTicket по адресу /include/pear/Net/SMTP.php — измените эту строку:

$ this -> _ socket_options = $ socket_options;

в

$ this -> _ socket_options = array (‘ssl’ => array (‘verify_peer_name’ => false));

Это отключает проверку. Для моей настройки почтовый сервер находится в той же локальной сети, что и сервер osTicket, поэтому я не слишком обеспокоен безопасностью.

Другое решение — перейти на PHP 5.5, который не имеет этой дополнительной проверки.

Было бы хорошо, если бы osTicket каким-то образом предложил настройку для этого, так что исправление кода не нужно каждый раз.

Взято из: https://github.com/pear/Net_SMTP/issues/14

3


0

2

Roundcube настроен так:

$rcmail_config['smtp_server'] = 'localhost';
$rcmail_config['smtp_port'] = 25;
$rcmail_config['smtp_user'] = '%u';
$rcmail_config['smtp_pass'] = '%p';
$rcmail_config['smtp_auth_type'] = '';
$rcmail_config['smtp_auth_cid'] = null;
$rcmail_config['smtp_auth_pw'] = null;
$rcmail_config['smtp_helo_host'] = 'localhost.localdomain';
$rcmail_config['smtp_timeout'] = 0;

при попытке отправить почту вываливается ошибка:

[27-May-2013 21:44:05 +0400]: SMTP Error: SMTP error: Authentication failure: SMTP server does not support authentication (Code: ) in /usr/share/roundcubemail/program/include/rcmail.php on line 1009 (POST /mail/?_unlock=loading1369676645733&_lang=ru?_task=mail&_action=send)

При этом smtp авторизация через thunderbird проходит наура.

Topic: SMTP error (220)  (Read 3406 times)

Roundcube Webmail 1.1.2:

$config['smtp_server'] = 'tls://smtp.example.com';
$config['smtp_port'] = 587;
$config['smtp_user'] = '%u';
$config['smtp_pass'] = '%p';
$config['smtp_auth_type'] = 'DIGEST-MD5';

SMTP sent OK

Roundcube Webmail 1.1.10:

$config['smtp_server'] = 'tls://smtp.example.com';
$config['smtp_port'] = 587;
$config['smtp_user'] = '%u';
$config['smtp_pass'] = '%p';
$config['smtp_auth_type'] = 'DIGEST-MD5';

SMTP error (220): Authorisation Error.

maillog:

postfix/smtpd[5636]: connect from mail.example.com[192.168.1.5]
postfix/smtpd[5636]: setting up TLS connection from mail.example.com[192.168.1.5]
postfix/smtpd[5636]: Anonymous TLS connection established from mail.example.com[192.168.1.5]: TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)
dovecot: auth: Debug: auth client connected (pid=0)
postfix/smtpd[5636]: lost connection after STARTTLS from mail.example.com[192.168.1.5]
postfix/smtpd[5636]: disconnect from mail.example.com[192.168.1.5]


What could be the problem?

« Last Edit: November 26, 2017, 03:09:56 PM by dmrc »


Logged


Can anyone help me to figure out «SMTP error (220)» in roundcube webmail.
Via webmail im unable to send a mail but through outlook and thunderbird its working.


Logged


Support Center > Knowledgebase > DirectAdmin > eMail > Webmail Clients > RoundCube > Roundcube: SMTP Error (220): Authentication failed.

Guide is to help if you run into the error

SMTP Error (220): Authentication failed.

when trying to send an email through RoundCube, after you’re already logged in successfully.

Because you were able to login, which uses Dovecot, then the issue focuses on exim.

  1. Check the /var/log/exim/mainlog to see if there are any message relating to the rejection
  2. if you cannot see any entries at all, it could be a certificate issue if RC is setup to use tls for sending.  Edit:

    /var/www/html/roundcube/config/config.inc.php

    and if you have tls, change:

    $config[‘smtp_server’] = ‘tls://localhost;

    to be your hostname:

    $config[‘smtp_server’] = ‘tls://server.hostname.com’;

    such that is matches the ssl host value in your /etc/exim.cert file.

Also Read

  • #1

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

  • #2

Hi,

if you use STARTTLS, you should use port 587

//$config[‘smtp_port’] = 25;
$config[‘smtp_port’] = 587;

hope that helps. Cheers, Tom

  • #3

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:

  • #4

@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!

  • #5

@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

  • #6

@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……..

  • #7

@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

  • #8

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.

  • #9

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………

  • #10

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’;

  • #11

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

  • #12

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$

  • #13

try playing around with the values, localhost 25, localhost 587, etc…

regards
Jan

  • #14

try playing around with the values, localhost 25, localhost 587, etc…

regards
Jan

not works :(

  • #15

@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!

  • #16

@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…..

  • #17

@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:

  • #18

@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……..

  • #19

@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

  • #20

@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:

Topic: SMTP error (220)  (Read 3524 times)

Roundcube Webmail 1.1.2:

$config['smtp_server'] = 'tls://smtp.example.com';
$config['smtp_port'] = 587;
$config['smtp_user'] = '%u';
$config['smtp_pass'] = '%p';
$config['smtp_auth_type'] = 'DIGEST-MD5';

SMTP sent OK

Roundcube Webmail 1.1.10:

$config['smtp_server'] = 'tls://smtp.example.com';
$config['smtp_port'] = 587;
$config['smtp_user'] = '%u';
$config['smtp_pass'] = '%p';
$config['smtp_auth_type'] = 'DIGEST-MD5';

SMTP error (220): Authorisation Error.

maillog:

postfix/smtpd[5636]: connect from mail.example.com[192.168.1.5]
postfix/smtpd[5636]: setting up TLS connection from mail.example.com[192.168.1.5]
postfix/smtpd[5636]: Anonymous TLS connection established from mail.example.com[192.168.1.5]: TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)
dovecot: auth: Debug: auth client connected (pid=0)
postfix/smtpd[5636]: lost connection after STARTTLS from mail.example.com[192.168.1.5]
postfix/smtpd[5636]: disconnect from mail.example.com[192.168.1.5]


What could be the problem?

« Last Edit: November 26, 2017, 03:09:56 PM by dmrc »


Logged


Can anyone help me to figure out «SMTP error (220)» in roundcube webmail.
Via webmail im unable to send a mail but through outlook and thunderbird its working.


Logged


Понравилась статья? Поделить с друзьями:
  • Smtp код ошибки 535
  • Slui exe ошибка приложения
  • Smtp yandex ошибка 535
  • Smtp 501 ошибка
  • Smtp 500 ошибка