Author Topic: STARTTLS to Postfix Mailrelay wont work.  (Read 2443 times)

Offline rounddove

  • Newbie
  • *
  • Posts: 1
STARTTLS to Postfix Mailrelay wont work.
« on: November 24, 2020, 06:48:25 AM »
Hello Together,

we're using roundcubemail-1.3.14 along with Dovecot as an IMAP Mail-Server on a Debian10 System.
IMAPS and STARTTLS over the MTA-Relay "Nullmailer" is working just fine, but the STARTTLS-SMTP configuration on roundcube wont work!

Unfortunately the SMTP-logs don't get us any further. It would be Great if you have any Ideas!
 

This is our config.inc.php file:
Code: [Select]
<?php

/* Local configuration for Roundcube Webmail */

// ----------------------------------
// SQL DATABASE
// ----------------------------------
// 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://database:password@localhost/roundcube';

// ----------------------------------
// IMAP
// ----------------------------------
// 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.
// To use SSL/TLS connection, enter hostname with prefix ssl:// or tls://
// 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
// WARNING: After hostname change update of mail_host column in users table is
//          required to match old user data records with the new host.
#$config['default_host'] = 'localhost';
$config['default_host'] = array(
  
'server-name.com.' => 'Webmail Server',
  
'imaps://server-name.com:993' => 'Secure Webmail Server'
);
$config['username_domain'] = 'server-name.com';

// ----------------------------------
// SMTP
// ----------------------------------
// SMTP server host (for sending mails).
// Enter hostname with prefix tls:// to use STARTTLS, or use
// prefix ssl:// to use the deprecated SSL over SMTP (aka SMTPS)
// 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
$config['smtp_server'] = 'tls://mail-postfix-relay.com';

// 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';
// Log SMTP conversation

// 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'] = 'server-name.com';

// This key is used for encrypting purposes, like storing of imap password
// in the session. For historical reasons it's called DES_key, but it's used
// with any configured cipher_method (see below).
$config['des_key'] = '*********************************';

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

// ----------------------------------
// PLUGINS
// ----------------------------------
// List of active plugins (in plugins/ directory)
$config['plugins'] = array();

// the default locale setting (leave empty for auto-detection)
// RFC1766 formatted language name like en_US, de_DE, de_CH, fr_FR, pt_BR
$config['language'] = 'de_DE';

// ----------------------------------
// LOGGING/DEBUGGING
// ----------------------------------
// system error reporting, sum of: 1 = log; 4 = show
$config['debug_level'] = 4;
// log driver:  'syslog', 'stdout' or 'file'.
$config['log_driver'] = 'file';

// date format for log entries
// (read http://php.net/manual/en/function.date.php for all format characters)
$config['log_date_format'] = 'd-M-Y H:i:s O';

// length of the session ID to prepend each log line with
// set to 0 to avoid session IDs being logged.
$config['log_session_id'] = 8;

// Syslog ident string to use, if using the 'syslog' log driver.
$config['syslog_id'] = 'roundcube';

// Syslog facility to use, if using the 'syslog' log driver.
// For possible values see installer or http://php.net/manual/en/function.openlog.php
$config['syslog_facility'] = LOG_USER;

// Activate this option if logs should be written to per-user directories.
// Data will only be logged if a directory <log_dir>/<username>/ exists and is writable.
$config['per_user_logging'] = false;

// Log sent messages to <log_dir>/sendmail or to syslog
$config['smtp_log'] = true;

// Log successful/failed logins to <log_dir>/userlogins or to syslog
$config['log_logins'] = false;

// Log session authentication errors to <log_dir>/session or to syslog
$config['log_session'] = false;

// Log SQL queries to <log_dir>/sql or to syslog
$config['sql_debug'] = false;

// Log IMAP conversation to <log_dir>/imap or to syslog
$config['imap_debug'] = false;

// Log LDAP conversation to <log_dir>/ldap or to syslog
$config['ldap_debug'] = false;

// Log SMTP conversation to <log_dir>/smtp or to syslog
$config['smtp_debug'] = true;

// Log Memcache conversation to <log_dir>/memcache or to syslog
$config['memcache_debug'] = false;

// Log APC conversation to <log_dir>/apc or to syslog
$config['apc_debug'] = false;

And this is the SMTP Debug Log:

Code: [Select]
24-Nov-2020 12:36:35 +0100]: <8na52g0r> Recv: 220 mail-postfix-relay.com ESMTP Postfix (Debian/GNU)
[24-Nov-2020 12:36:35 +0100]: <8na52g0r> Send: EHLO server-name.com
[24-Nov-2020 12:36:35 +0100]: <8na52g0r> Recv: 250-mail-postfix-relay.com
[24-Nov-2020 12:36:35 +0100]: <8na52g0r> Recv: 250-PIPELINING
[24-Nov-2020 12:36:35 +0100]: <8na52g0r> Recv: 250-SIZE
[24-Nov-2020 12:36:35 +0100]: <8na52g0r> Recv: 250-VRFY
[24-Nov-2020 12:36:35 +0100]: <8na52g0r> Recv: 250-ETRN
[24-Nov-2020 12:36:35 +0100]: <8na52g0r> Recv: 250-STARTTLS
[24-Nov-2020 12:36:35 +0100]: <8na52g0r> Recv: 250-ENHANCEDSTATUSCODES
[24-Nov-2020 12:36:35 +0100]: <8na52g0r> Recv: 250-8BITMIME
[24-Nov-2020 12:36:35 +0100]: <8na52g0r> Recv: 250 DSN
[24-Nov-2020 12:36:35 +0100]: <8na52g0r> Send: MAIL FROM:<test@server-name.com>
[24-Nov-2020 12:36:35 +0100]: <8na52g0r> Recv: 250 2.1.0 Ok
[24-Nov-2020 12:36:35 +0100]: <8na52g0r> Send: RCPT TO:<rcpt@server-name.com>
[24-Nov-2020 12:36:35 +0100]: <8na52g0r> Recv: 250 2.1.5 Ok
[24-Nov-2020 12:36:35 +0100]: <8na52g0r> Send: DATA
[24-Nov-2020 12:36:35 +0100]: <8na52g0r> Recv: 354 End data with <CR><LF>.<CR><LF>
[24-Nov-2020 12:36:35 +0100]: <8na52g0r> Send: MIME-Version: 1.0
Date: Tue, 24 Nov 2020 12:36:35 +0100
From: test@server-name.com
To: rcpt@server-name.com
Subject: TEST
Message-ID: <490bcbee78abcsdfsdf42891c062001611d9ea@server-name.com>
X-Sender: test@server-name.com
User-Agent: Roundcube Webmail/1.3.14
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit

das
[24-Nov-2020 12:36:35 +0100]: <8na52g0r> Send:
.
[24-Nov-2020 12:36:35 +0100]: <8na52g0r> Recv: 250 2.0.0 Ok: queued as 2A1A3453120F1F

==> sendmail <==
[24-Nov-2020 12:36:35 +0100]: <8na52g0r> User test@server-name.com [***.***.***.***]; Message for rcpt@server-name.com; 250: 2.0.0 Ok: queued as 2A1A3453120F1F

==> smtp <==
[24-Nov-2020 12:36:35 +0100]: <8na52g0r> Send: QUIT
[24-Nov-2020 12:36:35 +0100]: <8na52g0r> Recv: 221 2.0.0 Bye

Thank you!

Offline STUserRoundCube

  • Newbie
  • *
  • Posts: 1
Re: STARTTLS to Postfix Mailrelay wont work.
« Reply #1 on: August 22, 2022, 04:12:09 AM »
I have a similar issue even though I have added tls:// to config.inc.php