Remove ssmtp support and add From overwrite option

This commit is contained in:
Julian Rother 2022-03-31 02:28:26 +02:00
parent d56e3b037d
commit f7d8523942
No known key found for this signature in database
GPG key ID: 2F811E2338EE029B
6 changed files with 64 additions and 64 deletions

View 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 "$@"