mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 10:37:42 -07:00
Update v-make-separated-ip-for-email
This commit is contained in:
parent
8c477c39bf
commit
15b5996e4f
1 changed files with 11 additions and 7 deletions
|
@ -1,4 +1,4 @@
|
|||
#!/bin/bash
|
||||
#!/bin/bash
|
||||
|
||||
# info: add new ip and makes email to be sent via that IP only for SMTP authenticated users
|
||||
# options: MAIL_HOSTNAME MAIL_IP
|
||||
|
@ -45,7 +45,7 @@ is_domain_format_valid "$MAIL_HOSTNAME"
|
|||
is_ip_format_valid "$MAIL_IP"
|
||||
|
||||
HOST_USER=$($VESTA/bin/v-search-domain-owner "$HOSTNAME")
|
||||
if [ -z "$HOST_USER" ]; then
|
||||
if [ -z "$HOST_USER" ]; then
|
||||
echo "Error: hostname $HOSTNAME is not created as web domain"
|
||||
exit 4
|
||||
fi
|
||||
|
@ -140,14 +140,18 @@ if [ "$check_grep" -eq 0 ]; then
|
|||
mv /etc/exim4/exim4.conf.template /etc/exim4/exim4.conf.template-backup
|
||||
cp /usr/local/vesta/install/debian/12/exim/exim4.conf.template /etc/exim4/exim4.conf.template
|
||||
|
||||
release=$(cat /etc/debian_version | tr "." "\n" | head -n1)
|
||||
if [ "$release" -lt 11 ]; then
|
||||
sed -i "s|smtputf8_advertise_hosts|#smtputf8_advertise_hosts|g" /etc/exim4/exim4.conf.template
|
||||
fi
|
||||
if [ "$release" -lt 12 ]; then
|
||||
eximversion=$(exim4 --version | grep '^Exim version ' | awk '{print $3}')
|
||||
eximversioni="${eximversion%%[^0-9]+([0-9])}"
|
||||
eximversionf="${eximversion##+([0-9])[^0-9]}"
|
||||
if [ "$eximversioni" -eq 4 ] && [ "$eximversionf" -lt 96 ]; then
|
||||
cp /usr/local/vesta/install/debian/12/exim/exim4.conf.template.without-srs /etc/exim4/exim4.conf.template
|
||||
sed -i "s|message_linelength_limit|#message_linelength_limit|g" /etc/exim4/exim4.conf.template
|
||||
fi
|
||||
|
||||
if [ "$eximversioni" -eq 4 ] && [ "$eximversionf" -lt 94 ]; then
|
||||
sed -i "s|smtputf8_advertise_hosts|#smtputf8_advertise_hosts|g" /etc/exim4/exim4.conf.template
|
||||
fi
|
||||
|
||||
sed -i "s|FIRSTIP|$HOST_IP|g" /etc/exim4/exim4.conf.template
|
||||
sed -i "s|SECONDIP|$MAIL_IP|g" /etc/exim4/exim4.conf.template
|
||||
sed -i "s|FIRSTHOST|$HOSTNAME|g" /etc/exim4/exim4.conf.template
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue