SMTP Setup


 

DLMiller

TVWBB Member
Well I have tried every setting offered according to the HM wiki, Google search and even my SendGring account and no email. I used the test button in the Alarm page, and set up aralrms in which the alarm lite and ringer sounded.

Google SMTP seems to have changed and the use of Less Secure setting is not recommend which I concur.

What is next, I am at a loss...
 
You have to enable the access for less secure apps in order for gmail to work. It doesn't make your gmail account less secure, unless someone hacks into your heatermeter and starts sending emails as you!

My suggestion is to create another gmail account ie: hm-dlmiller, and use that account as a dedicated account just for sending heatermeter emails.
 
I set the Less secure setting on and the setup the SMTP settings under Services as noted in the wiki;
account default
host smtp.gmail.com
port 465
auth on
tls on
tls_certcheck off
tls_starttls off
from yourname@gmail.com
user yourname@gmail.com
password password

I will setup a new gmail account as you suggested to atry that

Mahalo...
 
I just setup a hotmail account and it is working to send email/SMS Notifications, here are the settings I used.

Server: smtp-mail.outlook.com
Port: 587
Requires authentication: YES
From Email: Hotmail address
Account User Name: Hotmail address
password = password
Enable TLS: YES
Use STARTTLS: YES
Verify server certificate: NO

One thing that was odd, the email contained all the probe information but the SMS message was blank. My phone received the message but there was no info. it just said "MSG:". My SMS message config is set to the default: ALERT $pn is $al_prep $al_thresh \($pcurr\)

Has something changed in the SMS message config? Carrier is AT&T.

EDIT: I set the SMS message to just HEATERMETER and still get a blank text. I sent a test email SMS directly from my hotmail account and the subject and MSG both came through.
 
Last edited:
This is what my working gmail setup looks like.

QVjCtw4.png
 
maybe there is something else is wrong;

after a reboot I get the following errors in the system.log

Thu Sep 21 05:04:06 2017 daemon.err uhttpd[383]: wc: /proc/net/nf_conntrack: No such file or directory
Thu Sep 21 05:04:06 2017 daemon.err uhttpd[383]: sysctl: error: 'net.nf_conntrack_max' is an unknown key
Thu Sep 21 05:04:11 2017 daemon.err uhttpd[383]: wc: /proc/net/nf_conntrack: No such file or directory
Thu Sep 21 05:04:11 2017 daemon.err uhttpd[383]: sysctl: error: 'net.nf_conntrack_max' is an unknown key
Thu Sep 21 05:05:11 2017 daemon.err uhttpd[383]: wc: /proc/net/nf_conntrack: No such file or directory
Thu Sep 21 05:05:11 2017 daemon.err uhttpd[383]: sysctl: error: 'net.nf_conntrack_max' is an unknown key


And then after an attempt to send a test email I get the following in the system log.

Thu Sep 21 05:05:18 2017 user.warn : Alarm 0L started ringing
Thu Sep 21 05:05:18 2017 user.warn : Alarm stopped
Thu Sep 21 05:05:18 2017 user.notice lmalarm: Auto-silencing alarm... OK
Thu Sep 21 05:05:18 2017 user.notice lmalarm: /usr/share/linkmeter/alarm: eval: line 1: syntax error: unterminated quoted string
Thu Sep 21 05:05:18 2017 user.notice lmalarm: Sending email from HeaterMeter <########@gmail.com> to Dennis <########@gmail.com>
Thu Sep 21 05:05:23 2017 user.notice lmalarm: sendmail: cannot locate host smtp.gmail.com: Try again
Thu Sep 21 05:05:23 2017 user.notice lmalarm: sendmail: could not send mail (account default from /etc/msmtprc)
Thu Sep 21 05:05:24 2017 daemon.err uhttpd[383]: wc: /proc/net/nf_conntrack: No such file or directory
Thu Sep 21 05:05:24 2017 daemon.err uhttpd[383]: sysctl: error: 'net.nf_conntrack_max' is an unknown key
 
The nf_conntrack messages are normal.

The "/usr/share/linkmeter/alarm: eval: line 1: syntax error: unterminated quoted string" error should be looked into. Any chance you've got any special characters or something in your config?

Are you able to ssh into your heatermeter and paste the output of the /etc/msmtprc file ( feel free to obfuscate usernames and passwords )?
 
I am unaware of any special characters in the config but will investigate.

I have no problem connect to my HM via Putty SSH, my WEB GUI connect just fine as well.
 
here is my "/usr/share/linkmeter/alarm" contents

#!/bin/sh

al_set() {
local AL="LMST,al,"
local PREMAIN=$al_probe
local VAL=$1

while [ $PREMAIN -gt 0 ] ; do
AL="${AL},,"
PREMAIN=$((PREMAIN-1))
done

[ "$al_type" == "H" ] && AL="${AL},"
lmclient ${AL}${1}
}

# The entire script is a function, to allow redirection to logger
do_alarms() {
cd `dirname $0`
for SCR in "alarm-all" "alarm-${al_probe}${al_type}" ; do
if [ -x "$SCR" ] ; then
. ./$SCR 2>&1
[ $? -ne 0 ] && exit $?
- alarm 1/148 0%
 
sorry left some off... are the ticks (`) normal or should they be (') see bold
#!/bin/sh

al_set() {
local AL="LMST,al,"
local PREMAIN=$al_probe
local VAL=$1

while [ $PREMAIN -gt 0 ] ; do
AL="${AL},,"
PREMAIN=$((PREMAIN-1))
done

[ "$al_type" == "H" ] && AL="${AL},"
lmclient ${AL}${1}
}

# The entire script is a function, to allow redirection to logger
do_alarms() {
cd `dirname $0`
for SCR in "alarm-all" "alarm-${al_probe}${al_type}" ; do
if [ -x "$SCR" ] ; then
. ./$SCR 2>&1
[ $? -ne 0 ] && exit $?
fi
done

. /lib/functions.sh
config_load linkmeter

# Auto-silence/disable
config_get doit alarms ra${al_type}${al_probe} 0
if [ "$doit" -eq 1 ] ; then
echo -n "Auto-silencing alarm... "
al_set 0
fi
if [ "$doit" -eq 2 ] ; then
echo -n "Auto-disabling alarm... "
al_set -$al_thresh
fi

# Setpoint change
config_get doit alarms sp${al_type}${al_probe} 0
if [ "$doit" -gt 0 ] ; then
echo -n "Changing setpoint to $doit... "
lmclient LMST,sp,$doit
fi

# Send Email
config_get_bool doit alarms email${al_type}${al_probe} 0
config_get dest alarms_email toaddress
if [ "$doit" -gt 0 -a -n "$dest" ] ; then
config_get dname alarms_email toname
config_get subject alarms_email subject "HeaterMeter Alert"
config_get fname alarms_email fromname "HeaterMeter"
faddr=`grep -i "^from " /etc/msmtprc | cut -d" " -f2`
[ -z "$faddr" ] && faddr="heatermeter@$ip"

dname="${dname:+$dname <}$dest${dname:+>}"
subject=$(eval echo "$subject")
fname=$(eval echo "$fname \<$faddr\>")
echo "Sending email from $fname to $dname"

- /usr/share/linkmeter/alarm 2/148 1%
 
I have to say I really hate "VI" I am not a Unix kinda guy, I am a retired windows Developer.

Here is the /etc/msmtprc file

account default
tls on
user ########@gmail.com
host smtp.gmail.com
port 587
auth on
from ########@gmail.com
tls_certcheck off
password ########
tls_starttls on
 
If I could be so bold to ask how does the "/usr/share/linkmeter/alarm" get modified?

I didn't make any changes...
 
Is the closing brace "}" before the "done" or after

# The entire script is a function, to allow redirection to logger
do_alarms() {
cd `dirname $0`
for SCR in "alarm-all" "alarm-${al_probe}${al_type}" ; do
if [ -x "$SCR" ] ; then
. ./$SCR 2>&1
[ $? -ne 0 ] && exit $?
fi
}
done

or

# The entire script is a function, to allow redirection to logger
do_alarms() {
cd `dirname $0`
for SCR in "alarm-all" "alarm-${al_probe}${al_type}" ; do
if [ -x "$SCR" ] ; then
. ./$SCR 2>&1
[ $? -ne 0 ] && exit $?
fi
done
}
 
The line right above the line in question says:

config_get fname alarms_email fromname "HeaterMeter"

Isn't 'fromname' the email address used as the "from" in the email? Perhaps gmail is rejecting and invalid "from" address?
 
I have to say I really hate "VI" I am not a Unix kinda guy, I am a retired windows Developer.

That's okay.... that won't be held against you. :)

lmalarm: sendmail: cannot locate host smtp.gmail.com: Try again

Is what would concern me. It looks like DNS name lookups are failing in your HeaterMeter.
 
That's okay.... that won't be held against you. :)

lmalarm: sendmail: cannot locate host smtp.gmail.com: Try again

Is what would concern me. It looks like DNS name lookups are failing in your HeaterMeter.

Hmm, missed that... Maybe you have an issue with the internet connection rather than email setup? What happens if you put in 74.125.70.108 as the server host IP?
 

 

Back
Top