ansible-role-disposable-mail/templates/create-email-alias.j2

13 lines
304 B
Plaintext
Raw Normal View History

2023-07-22 22:53:56 +00:00
#!/bin/bash
if [ -z $1 ];then
echo "Usage: ${0} <alias_name>"
exit 1
fi
if grep "$1@{{ postfix_domain }}" /etc/postfix/virtual
then
echo "already exists"
exit 0
fi
echo "$1@{{ postfix_domain }} main@{{ postfix_domain }}" >> /etc/postfix/virtual
postmap /etc/postfix/virtual