Skip to content
Snippets Groups Projects
Commit b34455da authored by Bob Mottram's avatar Bob Mottram
Browse files

Append alias domain

parent aedd4a56
No related branches found
No related tags found
No related merge requests found
......@@ -1043,6 +1043,8 @@ function email_smtp_proxy_through_isp {
return
fi
isp_smtp_domain_alias=
isp_smtp_domain_alias_line=
temp_proxy_file=/tmp/emailproxy.txt
host "$isp_smtp_domain" > $temp_proxy_file
if [ -f $temp_proxy_file ]; then
......@@ -1063,7 +1065,9 @@ function email_smtp_proxy_through_isp {
line_str="$line_str2"
fi
if [[ "$line_str" == *'.'* ]]; then
isp_smtp_domain="$line_str"
# line to be added to the exim password file
isp_smtp_domain_alias="${line_str}"
isp_smtp_domain_alias_line="${isp_smtp_domain_alias}:${isp_smtp_username}:${isp_smtp_password}"
fi
fi
fi
......@@ -1076,13 +1080,18 @@ function email_smtp_proxy_through_isp {
echo '#';
echo '# see exim4_passwd_client(5) for more documentation';
echo '#';
echo "${isp_smtp_domain}:${isp_smtp_username}:${isp_smtp_password}"; } > /etc/exim4/passwd.client
echo "${isp_smtp_domain}:${isp_smtp_username}:${isp_smtp_password}";
echo "${isp_smtp_domain_alias_line}"; } > /etc/exim4/passwd.client
if ! grep -q 'dc_eximconfig_configtype=' /etc/exim4/update-exim4.conf.conf; then
echo "dc_eximconfig_configtype='satellite'" >> /etc/exim4/update-exim4.conf.conf
else
sed -i "s|dc_eximconfig_configtype=.*|dc_eximconfig_configtype='satellite'|g" /etc/exim4/update-exim4.conf.conf
fi
sed -i "s|dc_smarthost=.*|dc_smarthost='${isp_smtp_domain}::${isp_smtp_port}'|g" /etc/exim4/update-exim4.conf.conf
if [ "${isp_smtp_domain_alias}" ]; then
sed -i "s|dc_smarthost=.*|dc_smarthost='${isp_smtp_domain_alias}::${isp_smtp_port}'|g" /etc/exim4/update-exim4.conf.conf
else
sed -i "s|dc_smarthost=.*|dc_smarthost='${isp_smtp_domain}::${isp_smtp_port}'|g" /etc/exim4/update-exim4.conf.conf
fi
if [[ "$(hostname)" != *'.local' ]]; then
sed -i "s|dc_readhost=.*|dc_readhost='$(hostname)'|g" /etc/exim4/update-exim4.conf.conf
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment