Remove ssmtp support and add From overwrite option
This commit is contained in:
parent
d56e3b037d
commit
f7d8523942
6 changed files with 64 additions and 64 deletions
23
templates/nullmailer-inject.j2
Normal file
23
templates/nullmailer-inject.j2
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/sh
|
||||
|
||||
{% if mail.overwrite_from_header %}
|
||||
username="$(id -un 2> /dev/null || echo nobody)"
|
||||
|
||||
excepted=0
|
||||
|
||||
for excepted_user in {% for item in mail.overwrite_from_header_except_users %} {{ item|quote }} {% endfor %}; do
|
||||
if [ "$username" = "$excepted_user" ]; then
|
||||
excepted=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$excepted" = "0" ]; then
|
||||
export NULLMAILER_NAME="${username} on $(hostname -f)"
|
||||
export NULLMAILER_USER={{ mail.from.split('@')[0]|quote }}
|
||||
export NULLMAILER_HOST={{ mail.from.split('@', 1)[1]|quote }}
|
||||
export NULLMAILER_FLAGS=f
|
||||
fi
|
||||
{% endif %}
|
||||
|
||||
exec /usr/bin/nullmailer-inject-bin "$@"
|
||||
Loading…
Add table
Add a link
Reference in a new issue