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 "$@"
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
#
|
||||
# Config file for sSMTP sendmail
|
||||
#
|
||||
# The person who gets all mail for userids < 1000
|
||||
# Make this empty to disable rewriting.
|
||||
root={{ mail['root'] }}
|
||||
|
||||
# The place where the mail goes. The actual machine name is required no
|
||||
# MX records are consulted. Commonly mailhosts are named mail.domain.com
|
||||
mailhub={{ mail['server'] }}
|
||||
|
||||
# Where will the mail seem to come from?
|
||||
rewriteDomain={{ mail['domain'] }}
|
||||
|
||||
# The full hostname
|
||||
hostname={{ inventory_hostname }}
|
||||
|
||||
# Are users allowed to set their own From: address?
|
||||
# YES - Allow the user to specify their own From: address
|
||||
# NO - Use the system generated From: address
|
||||
FromLineOverride=YES
|
||||
Loading…
Add table
Add a link
Reference in a new issue