Roundcube Community Forum

 

Multi-domain

Started by alain25, April 26, 2024, 01:09:18 PM

Previous topic - Next topic

alec

On a first glance it looks like your connection might not be secure. Try to set smtp_host to use tls://

alain25

Good evening,

As I explained at the beginning,

$config['include_host_config'] = array(
    'mail.domain1.tld' => 'domain1.tld_config.inc.php',
    'mail.domain2.tld' => 'domain2.tld_config.inc.php',
);

In each file, for example 'domain1.tld_config.inc.php', I put

<?php

// ---------------------------------------------------------------------
// configuration to domain1.tld_config.inc.php.
// ---------------------------------------------------------------------

// ----------------------------------
// IMAP
// ----------------------------------

// The IMAP host (and optionally port number) 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.
// If port number is omitted it will be set to 993 (for ssl://) or 143 otherwise.
// 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['imap_host' 'ssl://mail.domain1.tld';
$config['default_port'] = 993;

// ----------------------------------
// SMTP
// ----------------------------------

// SMTP server host (and optional port number) for sending mails.
// Enter hostname with prefix ssl:// to use Implicit TLS, or use
// prefix tls:// to use STARTTLS.
// If port number is omitted it will be set to 465 (for ssl://) or 587 otherwise.
// 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
// To specify different SMTP servers for different IMAP hosts provide an array
// of IMAP host (no prefix or port) and SMTP server e.g. ['imap.example.com' => 'smtp.example.net']
//$config['smtp_host'] = 'ssl://mail.domain1.tld:465';


$config['smtp_host' 'ssl://mail.domain1.tld.uk';
$config['default_port'] = 465;

So I did use SSL or TLS.

What are your thoughts on this?

Thanks

JohnDoh

it looks like your SMTP server does not support authentication, is that the case? in which case replace:
// SMTP username (if required)
// Note: %u variable will be replaced with current user's username
$config['smtp_user'] = '%u';

// SMTP password (if required)
// Note: When set to '%p' current user's password will be used
$config['smtp_pass'] = '%p'
with
// SMTP username (if required)
// Note: %u variable will be replaced with current user's username
$config['smtp_user'] = '';

// SMTP password (if required)
// Note: When set to '%p' current user's password will be used
$config['smtp_pass'] = ''

BTW I noticed you have $config['default_port'] set twice to different values. That config option was deprecated in 1.6 and since you are using default ports you don't need it any way. I suggest you remove those lines. IF you do want/need to set the port then set it has part of the imap_host/smtp_host value e.g. ssl://mail.domain1.tld:993
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

alain25

Hello,

Quoteit looks like your SMTP server does not support authentication, is that the case?
Yes
So I replaced config.inc.php file :

//$config['smtp_pass'] = '%p'; and $config['smtp_user'] ='%u';
by

$config['smtp_user'] ='';

$config['smtp_pass'] = '';

Then in my domain1_config.inc.php file, I put :

imap_host/smtp_host value e.g. ssl://mail.domain1.tld:993


<?php

/ ----------------------------------
// IMAP
// ----------------------------------
$config['imap_host'] = 'ssl://mail.domain1.tld:993';


// ----------------------------------
// SMTP
// ----------------------------------
$config['smtp_host'] = 'ssl://mail.domain1.tld:465';

On the other hand, I don't know if you should put in the domain1 file

$config['smtp_user'] ='';

$config['smtp_pass'] = '';

For your information, since I made these changes I've been getting an error message:

SMTP error (530): unable to define sender« [email protected] » (5.7.0 Must issue a STARTTLS command first)



Here is the image of the error message:

Picture

Do you have any ideas?

Thanks