You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Conflicting config.inc.php files due to installer autocopy #4
Yeah definetly, testing is always useful. The received header above definetly looks like it should work, but maybe some other headers get in the way?
Edit: Oh, also the support for ignoring headers isn't currently in 1.1, only if you pull dev-master via composer. Probably going to make a new release soon.
Thank you for the release !
French translations work as expected, the hops do not help and internal or external emails are not handled correctly
So I will make other PRs to improve and test all that ;)
Hi @GermanCoding
I did figure out what was wrong, it comes from this plugin:
if you look at other plugins
Most of them use config.inc.php.dist files
Have commented out the config lines in config.inc.php` files
So I commented out the line in /usr/src/roundcubemail/plugins/tls_icon/config.inc.php and restarted the docker container
And now my config /var/roundcube/config/tls_icon.php is taken in account. And the TLS header that I reported works fine !
I don't see a common behavior where roundcube plugins comment out their defaults. You sometimes see commented out config lines where it does not make sense to set an explicit default, but that isn't the case here - it should be a sensible default value (and it also happens to be the same value as if unset). What plugins specifically do you see that have their entire configs commented out?
It's unfortunate that other definitions of the same config key can get ignored, but I don't see any good option to fix this. What I would suggest is to make any modification to the plugin config in the plugin's config file directly and not try to do this anywhere else. The Roundcube plugin installer is what copies config.inc.php.dist to config.inc.php, but it should not touch existing configs. Hence you should be able to reliably modify config.inc.php directly and have that persisted across instance rebuilds. That's what I do for most of my plugins.
This may require persisting plugin folders within docker, which is not great, but it wasn't me who decided to have plugin configs live in the plugin folder.
So I would conclude that there is something did on purpose so that config.inc.php files do not exist
@thomascube@alecpl Could you comment about config loading for plugins ?
On this plugin my config created and mounted by Docker is not taken in account until I comment out the config line at config.inc.php of this plugin or remove the file. As I said in #4 (comment)
.dist files are samples and usually (I can't talk about the 3rd party plugins) they contain all plugin options and their defaults. User has to copy config.inc.php.dist to config.inc.php because .dist files are not being used. Some plugins will work without config.inc.php file just fine, some might not.
.dist files are samples and usually (I can't talk about the 3rd party plugins) they contain all plugin options and their defaults. User has to copy config.inc.php.dist to config.inc.php because .dist files are not being used. Some plugins will work without config.inc.php file just fine, some might not.
I think this was added in roundcube/plugin-installer v0.3.0
The question is now, what if the user doesn't actually want that, because the config is managed externally/somewhere else? In this case it appears that the automatically generated config.inc.php takes precedence, which is not desired in this case.
It appears that, for some plugins, config.inc.php is not created automatically. I guess that is because either
the plugin's composer.json requires an old version of the plugin installer that doesn't have this feature
for plugins included in the dist, the installer is probably not run in the first place
A suggested workaround seems to be to have everything commented out by default (so that when config.inc.php is created automatically it doesn't contain anything useful), which doesn't sound appealing to me. What's the supposed flow here?
Here come headers inserted by sendmail. I show the two uppermost received headers, only the second one is relative:
Received: from mail.aegee.org ([unix socket]) by mail.aegee.org (Cyrus 3.4.4) with LMTPA; Sun, 18 Dec 2022 07:03:24 +0000
Received: from 69-171-232-143.mail-mail.facebook.com (69-171-232-143.mail-mail.facebook.com [69.171.232.143]) by mail.aegee.org (8.17.1/8.17.1) with ESMTPS id 2BI73F8b1489360 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for <my@address>; Sun, 18 Dec 2022 07:03:16 GMT
verify=NO means that the sending server has not volunarily presented a certificate. Another example with verify=OK
Received: from mail.aegee.org ([unix socket]) by mail.aegee.org (Cyrus 3.4.4) with LMTPA; Fri, 16 Dec 2022 22:41:09 +0000
Received: from smtp.github.com (out-18.smtp.github.com [192.30.252.201]) by mail.aegee.org (8.17.1/8.17.1) with ESMTPS id 2BGMf4uY685293 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <my@address>; Fri, 16 Dec 2022 22:41:05 GMT
Please add parsing for sendmail-generated Received: headers and possibly add an option whether only postfix or only sendmail generated headers shall be handled (if this option would make things faster).
This issue has went a bit sideways, we're currently tracking an issue related to config.inc.php here. I have moved @dilyanpalauzov's comment to a new issue #11
When I comment out the config option in config.inc.php I get error messages from PHP
PHP Error: Failed to load config from /var/www/html/plugins/tls_icon/config.inc.php in /var/www/html/program/lib/Roundcube/rcube_plugin.php on line 166
The problem appears to be that if all config options are commented out, no $config is defined for the plugin, leading to a configuration error. I can fix that by adding a dummy $config[] = 0;, but is that going to conflict with $config definitions elsewhere?
So even if we were to comment-out everything by default, that's still going to cause problems in setups where the default config.inc.php is not overriden. So I'm really out of ideas as to how to solve this, except downgrading to an old version of the plugin installer that did not yet have the config autocopy.
Activity
GermanCoding commentedon Jul 6, 2022
This looks like the usual Postfix TLS received header, so this should work already?
But yeah generally I'm not opposed to supporting other header formats.
williamdes commentedon Jul 6, 2022
It seems like it does not work, I have set for two ignored hops but it does not help
I think it would be helpful to build a unit test suite
GermanCoding commentedon Jul 8, 2022
Yeah definetly, testing is always useful. The received header above definetly looks like it should work, but maybe some other headers get in the way?
Edit: Oh, also the support for ignoring headers isn't currently in 1.1, only if you pull dev-master via composer. Probably going to make a new release soon.
williamdes commentedon Jul 8, 2022
Thank you for the release !
French translations work as expected, the hops do not help and internal or external emails are not handled correctly
So I will make other PRs to improve and test all that ;)
williamdes commentedon Jul 8, 2022
By the way my mails use the docker mailserver project
williamdes commentedon Jul 9, 2022
Just added a test for this in #8
williamdes commentedon Jul 9, 2022
After some debug I found out that the config is set to
0for some reason (probably the default config is loaded, why ? how ?)williamdes commentedon Jul 10, 2022
Hi @GermanCoding
I did figure out what was wrong, it comes from this plugin:
config.inc.php.distfilesSo I commented out the line in
/usr/src/roundcubemail/plugins/tls_icon/config.inc.phpand restarted the docker containerAnd now my config
/var/roundcube/config/tls_icon.phpis taken in account. And the TLS header that I reported works fine !What do you think about what I reported ?
docker-compose.ymlGermanCoding commentedon Jul 11, 2022
I don't see a common behavior where roundcube plugins comment out their defaults. You sometimes see commented out config lines where it does not make sense to set an explicit default, but that isn't the case here - it should be a sensible default value (and it also happens to be the same value as if unset). What plugins specifically do you see that have their entire configs commented out?
It's unfortunate that other definitions of the same config key can get ignored, but I don't see any good option to fix this. What I would suggest is to make any modification to the plugin config in the plugin's config file directly and not try to do this anywhere else. The Roundcube plugin installer is what copies config.inc.php.dist to config.inc.php, but it should not touch existing configs. Hence you should be able to reliably modify config.inc.php directly and have that persisted across instance rebuilds. That's what I do for most of my plugins.
This may require persisting plugin folders within docker, which is not great, but it wasn't me who decided to have plugin configs live in the plugin folder.
williamdes commentedon Jul 12, 2022
All the plugins of this list (they are not commented but in dist mode):
archivevcard_attachmentsshow_additional_headers-~~ userinfo~~
contextmenuSo I would conclude that there is something did on purpose so that
config.inc.phpfiles do not exist@thomascube @alecpl Could you comment about config loading for plugins ?
On this plugin my config created and mounted by Docker is not taken in account until I comment out the config line at
config.inc.phpof this plugin or remove the file. As I said in #4 (comment)alecpl commentedon Jul 13, 2022
.dist files are samples and usually (I can't talk about the 3rd party plugins) they contain all plugin options and their defaults. User has to copy config.inc.php.dist to config.inc.php because .dist files are not being used. Some plugins will work without config.inc.php file just fine, some might not.
GermanCoding commentedon Jul 13, 2022
Yes, though nowadays the Roundcube plugin installer copies
config.inc.php.disttoconfig.inc.phpautomatically: https://github.com/roundcube/plugin-installer/blob/c4335e20b86cfe3a184ccf24d675c6a0338a372a/src/Roundcube/Composer/ExtensionInstaller.php#L64I think this was added in roundcube/plugin-installer v0.3.0
The question is now, what if the user doesn't actually want that, because the config is managed externally/somewhere else? In this case it appears that the automatically generated
config.inc.phptakes precedence, which is not desired in this case.It appears that, for some plugins,
config.inc.phpis not created automatically. I guess that is because eitherA suggested workaround seems to be to have everything commented out by default (so that when
config.inc.phpis created automatically it doesn't contain anything useful), which doesn't sound appealing to me. What's the supposed flow here?dilyanpalauzov commentedon Dec 18, 2022
Here come headers inserted by sendmail. I show the two uppermost received headers, only the second one is relative:
verify=NO means that the sending server has not volunarily presented a certificate. Another example with verify=OK
Please add parsing for sendmail-generated Received: headers and possibly add an option whether only postfix or only sendmail generated headers shall be handled (if this option would make things faster).
[-]Handle other format for TLS[/-][+]Conflicting config.inc.php files due to installer autocopy[/+]GermanCoding commentedon Dec 23, 2022
This issue has went a bit sideways, we're currently tracking an issue related to
config.inc.phphere. I have moved @dilyanpalauzov's comment to a new issue #11GermanCoding commentedon Dec 27, 2022
Regarding this issue:
I tried some things and I noticed an issue:
When I comment out the config option in
config.inc.phpI get error messages from PHPPHP Error: Failed to load config from /var/www/html/plugins/tls_icon/config.inc.php in /var/www/html/program/lib/Roundcube/rcube_plugin.php on line 166The problem appears to be that if all config options are commented out, no
$configis defined for the plugin, leading to a configuration error. I can fix that by adding a dummy$config[] = 0;, but is that going to conflict with$configdefinitions elsewhere?So even if we were to comment-out everything by default, that's still going to cause problems in setups where the default config.inc.php is not overriden. So I'm really out of ideas as to how to solve this, except downgrading to an old version of the plugin installer that did not yet have the config autocopy.
williamdes commentedon Dec 28, 2022
Maybe you should ping upstream to know what is best?