Browse Source

Fix regression where `smtp_user` did not allow pre/post strings before/after `%u` placeholder (#9162)

pull/9518/head
Aleksander Machniak 2 years ago
parent
commit
6d7557799a
  1. 1
      CHANGELOG.md
  2. 8
      config/defaults.inc.php
  3. 7
      program/lib/Roundcube/rcube_smtp.php

1
CHANGELOG.md

@ -8,6 +8,7 @@
- Fix UI issue when dealing with an invalid managesieve_default_headers value (#9175)
- Fix bug where images attached to application/smil messages weren't displayed (#8870)
- Fix PHP string replacement error in utils/error.php (#9185)
- Fix regression where `smtp_user` did not allow pre/post strings before/after `%u` placeholder (#9162)
## Release 1.6.4

8
config/defaults.inc.php

@ -270,12 +270,12 @@ $config['messages_cache_threshold'] = 50;
// of IMAP host (no prefix or port) and SMTP server e.g. ['imap.example.com' => 'smtp.example.net']
$config['smtp_host'] = 'localhost:587';
// SMTP username (if required) if you use %u as the username Roundcube
// will use the current username for login
// SMTP username (if required)
// Note: %u variable will be replaced with current user's username
$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
// SMTP password (if required)
// Note: When set to '%p' current user's password will be used
$config['smtp_pass'] = '%p';
// SMTP AUTH type (DIGEST-MD5, CRAM-MD5, LOGIN, PLAIN or empty to use

7
program/lib/Roundcube/rcube_smtp.php

@ -170,18 +170,13 @@ class rcube_smtp
}
}
if ($CONFIG['smtp_user'] == '%u') {
$smtp_user = (string) $rcube->get_user_name();
} else {
$smtp_user = $CONFIG['smtp_user'];
}
if ($CONFIG['smtp_pass'] == '%p') {
$smtp_pass = (string) $rcube->get_user_password();
} else {
$smtp_pass = $CONFIG['smtp_pass'];
}
$smtp_user = str_replace('%u', (string) $rcube->get_user_name(), $CONFIG['smtp_user']);
$smtp_auth_type = $CONFIG['smtp_auth_type'] ?: null;
$smtp_authz = null;

Loading…
Cancel
Save