diff --git a/src/freedombone-base-email b/src/freedombone-base-email index 5f8b620fbfe24d3d4021d93adbc8a7a5394954b9..fd48876bdb48f9f0f4b405a69d4127af4253e797 100755 --- a/src/freedombone-base-email +++ b/src/freedombone-base-email @@ -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