mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[enh] Add amavis conf regen script
This commit is contained in:
parent
67b19bf431
commit
93052906dc
3 changed files with 41 additions and 4 deletions
37
data/hooks/conf_regen/31-amavis
Normal file
37
data/hooks/conf_regen/31-amavis
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
force=$1
|
||||||
|
|
||||||
|
function safe_copy () {
|
||||||
|
if [[ "$force" == "True" ]]; then
|
||||||
|
sudo yunohost service safecopy \
|
||||||
|
-s amavis $1 $2 --force
|
||||||
|
else
|
||||||
|
sudo yunohost service safecopy \
|
||||||
|
-s amavis $1 $2
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
cd /usr/share/yunohost/templates/amavis
|
||||||
|
|
||||||
|
sudo mkdir -p /etc/amavis/conf.d/
|
||||||
|
|
||||||
|
# Copy plain single configuration files
|
||||||
|
files="05-domain_id
|
||||||
|
05-node_id
|
||||||
|
15-content_filter_mode
|
||||||
|
20-debian_defaults"
|
||||||
|
|
||||||
|
for file in $files; do
|
||||||
|
safe_copy $file /etc/amavis/conf.d/$file
|
||||||
|
done
|
||||||
|
|
||||||
|
main_domain=$(cat /etc/yunohost/current_host)
|
||||||
|
cat 50-user.sed \
|
||||||
|
| sed "s/{{ main_domain }}/$main_domain/g" \
|
||||||
|
| sudo tee 50-user
|
||||||
|
safe_copy 50-user /etc/amavis/conf.d/50-user
|
||||||
|
|
||||||
|
|
||||||
|
sudo service amavis restart
|
|
@ -119,8 +119,8 @@ $banned_filename_re = new_RE(
|
||||||
qr'^application/x-msdos-program$'i,
|
qr'^application/x-msdos-program$'i,
|
||||||
qr'^application/hta$'i,
|
qr'^application/hta$'i,
|
||||||
|
|
||||||
# qr'^application/x-msmetafile$'i, # Windows Metafile MIME type
|
# qr'^application/x-msmetafile$'i, # Windows Metafile MIME type
|
||||||
# qr'^\.wmf$', # Windows Metafile file(1) type
|
# qr'^\.wmf$', # Windows Metafile file(1) type
|
||||||
|
|
||||||
# qr'^message/partial$'i, qr'^message/external-body$'i, # rfc2046 MIME types
|
# qr'^message/partial$'i, qr'^message/external-body$'i, # rfc2046 MIME types
|
||||||
|
|
||||||
|
|
|
@ -8,9 +8,9 @@ use strict;
|
||||||
# the directives you can use in this file
|
# the directives you can use in this file
|
||||||
#
|
#
|
||||||
|
|
||||||
$myhostname = "{{ domain }}";
|
$myhostname = "{{ main_domain }}";
|
||||||
|
|
||||||
$mydomain = "{{ domain }}";
|
$mydomain = "{{ main_domain }}";
|
||||||
|
|
||||||
# Enable LDAP support
|
# Enable LDAP support
|
||||||
$enable_ldap = 1;
|
$enable_ldap = 1;
|
Loading…
Add table
Reference in a new issue