can I set different smtp servers for different email addresses? mick
can I set different smtp servers for different email addresses?
./config/defaults.inc.php
// 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'] = 'localhost:587';
On 2024-07-08 19:34, list--- via Users wrote:
can I set different smtp servers for different email addresses?
./config/defaults.inc.php
// 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'] = 'localhost:587';
many thanks
mick
On 2024-07-08 19:34, list--- via Users wrote:
can I set different smtp servers for different email addresses?
./config/defaults.inc.php
// 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'] = 'localhost:587';
I'm not very good at php. It looks like I've put the smtp server, user, password in "/etc/roundcube/config.inc.php". I need separate user and password for about 4 different smtp servers. The way it is at the moment, with the one smtp server passing emails on, complicates the email headers. How would the array be structured for different smtp server, user, password for each external domain? mick
./config/defaults.inc.php
// 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'] = 'localhost:587';
I'm not very good at php. It looks like I've put the smtp server, user, password in "/etc/roundcube/config.inc.php". I need separate user and password for about 4 different smtp servers. The way it is at the moment, with the one smtp server passing emails on, complicates the email headers. How would the array be structured for different smtp server, user, password for each external domain? mick
I have done it like this:
$sn = array("xxx", "xxx",);
if (in_array($_POST['_user'], $sn)) { rcube::write_log('errors', '>>> yeah2'); $config['smtp_host'] = 'mail.xxxx.xxx'; $config['imap_host'] = 'mail.xxxx.xxx'; }
On 2024-07-20 15:55, Marc wrote:
./config/defaults.inc.php
// 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'] = 'localhost:587';
I'm not very good at php. It looks like I've put the smtp server, user, password in "/etc/roundcube/config.inc.php". I need separate user and password for about 4 different smtp servers. The way it is at the moment, with the one smtp server passing emails on, complicates the email headers. How would the array be structured for different smtp server, user, password for each external domain? mick
I have done it like this:
$sn = array("xxx", "xxx",);
if (in_array($_POST['_user'], $sn)) { rcube::write_log('errors', '>>> yeah2'); $config['smtp_host'] = 'mail.xxxx.xxx'; $config['imap_host'] = 'mail.xxxx.xxx'; }
thanks. I guess "array" is a PHP keyword and the "xxx", "xxx", are the 2 fields in the identities? Is that then $user1=array("xxx", "aaa",); $user2=array("yyy", "bbb",); $user3=array("zzz", "ccc",); ? Is '>>> yeah2' just an identifier which one went wrong?
cheers mick
Thanks
-----Original Message----- From: mick.crane mick.crane@gmail.com Sent: Saturday, July 20, 2024 11:58 AM To: users@lists.roundcube.net Subject: [RCU] Re: smtp servers
On 2024-07-08 19:34, list--- via Users wrote:
can I set different smtp servers for different email addresses?
./config/defaults.inc.php
// 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'] = 'localhost:587';
I'm not very good at php. It looks like I've put the smtp server, user, password in "/etc/roundcube/config.inc.php". I need separate user and password for about 4 different smtp servers. The way it is at the moment, with the one smtp server passing emails on, complicates the email headers. How would the array be structured for different smtp server, user, password for each external domain? mick _______________________________________________ Users mailing list -- users@lists.roundcube.net To unsubscribe send an email to users-leave@lists.roundcube.net
You can send an empty message to this addr: users-unsubscribe@lists.roundcube.net To leave the list.
mick.crane skrev den 2024-07-08 15:56:
can I set different smtp servers for different email addresses?
https://bitbucket.org/BoresExpress/ident_switch/src/master/
possible its stable or buggy, but its there