diff --git a/src/freedombone-base-email b/src/freedombone-base-email
index 68837a57f53cc5e17209adc0e799a99cf898c8cf..eb3227169538a14263899d3ac9bb3559b92f5838 100755
--- a/src/freedombone-base-email
+++ b/src/freedombone-base-email
@@ -1056,14 +1056,13 @@ function email_smtp_proxy_through_isp {
                     # shellcheck disable=SC2002
                     line_str=$(cat "$temp_proxy_file" | grep "$alias_str" | awk 'NF>1{print $NF}')
                     if [ ${#line_str} -gt 4 ]; then
-                        #shellcheck disable=SC2116
-                        last_char=$(echo "${line_str:$i:1}")
-                        if [[ "$last_char" == '.' ]]; then
+                        if [[ "$line_str" == *'.' ]]; then
                             # remove the last character
                             #shellcheck disable=SC2116
                             line_str2=$(echo ${line_str::-1})
                             line_str="$line_str2"
                         fi
+
                         if [[ "$line_str" == *'.'* ]]; then
                             # line to be added to the exim password file
                             isp_smtp_domain_alias="${line_str}"