sed wrapper#2158
Conversation
|
@egavrilov Your addition from #554 broke some time ago. Do you know, if it's still needed nowadays? |
|
@casperklein hi there. It's not really a hard requirement to have idle time set from default to whatever value, but just a recomendation to have it higher than default because of battery drain on non-optimised client. I guess it is even possible to remove it because the problem is on the client actually. |
It is already removed (unintentionally) since ~1.5 years. My question just was, if it's worth to re-add it. Now, I don't think so. |
f6dae10
polarathene
left a comment
There was a problem hiding this comment.
LGTM.
Although the sed lines look a bit difficult to read some times, especially that dovecot one with all the path escaping \/ mixed in with the / sed delimiter. In other scripts we switched to a consistent | sed delimiter instead.
Not required for this PR but probably a worthwhile change :)
Description
This introduces
sedfile, a wrapper forsed -icommands.Problem: When
sed -iis used to manipulate files, sed exit with error code 0, even when the file was not altered:sedfilecompares the file hash before and after the sed operation and fails, if the file was not altered (hashes do match).This helps to prevent issues caused by failed file modifications, e.g. a package is upgraded and the config file structure changes.
Identified issues
imap_idle_notify_interval
Error: sed -i s/#imap_idle_notify_interval = 2 mins/imap_idle_notify_interval = 29 mins/ /etc/dovecot/conf.d/20-imap.confhttps://github.com/docker-mailserver/docker-mailserver/pull/2158/checks?check_run_id=3455478612#step:6:2236
Reason:
imap_idle_notify_intervalis not present in/etc/dovecot/conf.d/20-imap.conf.Action: Line deleted
Edit: #554
Edit2: Broken since commit: added dovecot quota feature
adapt mkcert for Dovecot community repo (old leftover)
Error: sed -i s/CERTDIR=.*/CERTDIR=\/etc\/dovecot\/ssl/g /usr/share/dovecot/mkcert.shError: sed -i s/KEYDIR=.*/KEYDIR=\/etc\/dovecot\/ssl/g /usr/share/dovecot/mkcert.shError: sed -i 's/KEYFILE=.*/KEYFILE=\$KEYDIR\/dovecot.key/g' /usr/share/dovecot/mkcert.shhttps://github.com/docker-mailserver/docker-mailserver/runs/3455521780?check_suite_focus=true#step:6:2225
Reason:
CERTDIR,KEYDIR,KEYFILEalready have the correct values in/usr/share/dovecot/mkcert.sh.Fix: Affected lines removed from Dockerfile
Future to-do
Replace existing
sed -iwithsedfile -iin scripts and tests.Type of change
Checklist:
docs/)