Allow users to define SMTP HELO/EHLO
Some SMTP servers reject mails or mark them as spam if the HELO/EHLO doesn't match the hostname / dns PTR. Following change would enable users to define the domain
parameter for the msmtp to set that config option.
Another alternative would be to include the /etc/msmtprc
file for user defined defaults (which btw. is referenced on the wiki page to be used)
get_user_server_settings() {
local username=`uci -q get user_notify.smtp.username`
local password=`uci -q get user_notify.smtp.password`
local server=`uci -q get user_notify.smtp.server`
local port=`uci -q get user_notify.smtp.port`
local security=`uci -q get user_notify.smtp.security`
local domain=`uci -q get user_notify.smtp.domain`
echo "from $mail_from"
echo "host $server"
echo "port $port"
if [ "$security" = "ssl" ]; then
echo "tls on"
echo "tls_starttls off"
echo "tls_certcheck on"
echo "tls_trust_file /etc/ssl/certs/ca-certificates.crt"
elif [ "$security" = "starttls" ]; then
echo "tls on"
echo "tls_starttls on"
echo "tls_certcheck on"
echo "tls_trust_file /etc/ssl/certs/ca-certificates.crt"
else
echo "tls off"
fi
if [ -n "$username" -a -n "$password" ]; then
echo "auth on"
echo "user $username"
echo "password $password"
else
echo "auth off"
fi
if [ -n "$domain" ]; then
echo "domain $domain"
fi
}