Amavis ip

This commit is contained in:
Val 2015-07-25 04:06:58 +01:00
parent 9931234b2a
commit 45d6d16172
2 changed files with 10 additions and 1 deletions

View File

@ -1,4 +1,10 @@
#!/bin/bash
# Update hostname if given
if [ -f /mail_settings/myhostname ]; then
echo $(sed 's:/:\\/:g' /mail_settings/myhostname) > /etc/mailname
fi
readarray -t domains < /mail_settings/domains
first_fqdn="\$myhostname = \"${domains[0]}\";"
domain_string=$(printf "'%s' " "${domains[@]}") | tr ' ' ,

View File

@ -49,7 +49,10 @@ function add_amavis () {
echo " -o smtpd_recipient_restrictions=permit_mynetworks,reject" >> $POSTFIX_MASTER_CF
echo " -o smtpd_data_restrictions=reject_unauth_pipelining" >> $POSTFIX_MASTER_CF
echo " -o smtpd_end_of_data_restrictions=" >> $POSTFIX_MASTER_CF
echo " -o mynetworks=127.0.0.0/8 amavis" >> $POSTFIX_MASTER_CF
# Painfull way to get amavis IP
amavis_ip=$(getent hosts amavis | awk '{print $1}')
echo " -o mynetworks=127.0.0.0/8 $amavis_ip" >> $POSTFIX_MASTER_CF
echo " -o smtpd_error_sleep_time=0" >> $POSTFIX_MASTER_CF
echo " -o smtpd_soft_error_limit=1001" >> $POSTFIX_MASTER_CF
echo " -o smtpd_hard_error_limit=1000" >> $POSTFIX_MASTER_CF