sfx2000
Part of the Furniture
What can we do about this, ask the busybox maintainer to fix it ?
I know I could probably dig around RMerlin's github, but probably faster/easier to ask what version of BusyBox is included here?
What can we do about this, ask the busybox maintainer to fix it ?
Are you sure? On my fork....1.20.1.
admin@AC68P-XXXXX:/tmp/home/root# busybox
BusyBox v1.20.2 (2016-06-21 07:24:57 MST) multi-call binary.
Copyright (C) 1998-2011 Erik Andersen, Rob Landley, Denys Vlasenko
and others. Licensed under GPLv2.
See source distribution for full notice.
Are you sure? On my fork....
Code:admin@AC68P-XXXXX:/tmp/home/root# busybox BusyBox v1.20.2 (2016-06-21 07:24:57 MST) multi-call binary. Copyright (C) 1998-2011 Erik Andersen, Rob Landley, Denys Vlasenko and others. Licensed under GPLv2. See source distribution for full notice.
I'm using v1.22.1I know I could probably dig around RMerlin's github, but probably faster/easier to ask what version of BusyBox is included here?
on my ASUSWRT-Merlin RT-AC66U_3.0.0.4, busybox is v1.20.2Could be .2, I was going from memory.
...
// The problem here is some servers delay initial 220 message,
// and consider client to be a spammer if it starts sending cmds
// before 220 reached it. The code below is unsafe in this regard:
// in non-STARTTLSed case, we potentially send NOOP before 220
// is sent by server.
// Ideas? (--delay SECS opt? --assume-starttls-helper opt?)
code = smtp_check("NOOP", -1);
if (code == 220)
// we got 220 - this is not STARTTLSed connection,
// eat 250 response to our NOOP
smtp_check(NULL, 250);
else
if (code != 250)[/code]
What can we do about this, ask the busybox maintainer to fix it ?
:-(
firewall# cat mailIP
#!/bin/sh
#
# transmet l'adresse ip quand il change...
#
#
IPNOW=$(ip addr | grep 255.255. | sed -n 's/^ *inet *\([.0-9]*\).*/\1/p')
if grep -q $IPNOW /tmp/MyIP.log
then
echo "No change"
else
echo $IPNOW > /tmp/MyIP.log
echo "Subject: l'adresse IP aujourd'hui: $IPNOW !!! " > /tmp/MyIP1.log
echo "From: root@firewall" >> /tmp/MyIP1.log
echo "Date: `date -R`" >> /tmp/MyIP1.log
echo "" >> /tmp/MyIP1.log
echo "Salut mon petit JR..." >> /tmp/MyIP1.log
echo "" >> /tmp/MyIP1.log
echo "nouvel IP: $IPNOW" >> /tmp/MyIP1.log
echo "Uptime est: `uptime | cut -d ',' -f1 | sed 's/^.\{12\}//g'`" >> /tmp/MyIP1.log
echo "" >> /tmp/MyIP1.log
echo "---- " >> /tmp/MyIP1.log
echo "de la part de ton gentil Routeur !!!" >> /tmp/MyIP1.log
echo "" >> /tmp/MyIP1.log
echo "" >> /tmp/MyIP1.log
sendmail -S relais.videotron.ca:587 </tmp/MyIP1.log -froot@firewall -auxxxxxxxx -apyyyyyyyy blablabla@gmail.com
fi
firewall#
....Correction I have an answer now (july 16 2016), which is to try
adding sleep(3) before code = smtp_check("NOOP", -1) line, in sendmail source code.
...
wget -c -O /jffs/configs/Equifax_Secure_Certificate_Authority.pem http://www.geotrust.com/resources/root_certificates/certificates/Equifax_Secure_Certificate_Authority.pem --no-check-certificate
#!/bin/sh
# The following cmd must be run one time in SSH prior to running this script:
# wget -c -O /jffs/configs/Equifax_Secure_Certificate_Authority.pem http://www.geotrust.com/resources/root_certificates/certificates/Equifax_Secure_Certificate_Authority.pem --no-check-certificate
# For this example to work, the following variables must be modified:
# FROM, AUTH, PASS, FROMNAME, TO
# Additionally, you MAY need to "Turn on" the sender Gmail account's
# "Access for less secure apps" setting. I turned it on and have not tried
# turning it back off (does not matter to me since I am using a throwaway
# Gmail account used only for this purpose). After logging into your Gmail
# account, this setting can be found at the following URL:
# https://www.google.com/settings/security/lesssecureapps
# To execute this script, make sure you have given it executable permissions,
# and then either execute it directly from SSH:
# cd /path/you/saved/script/to
# ./nameOfScript.sh
# Or, save the script as one of your jffs startup scripts, such as:
# /jffs/scripts/wan-start
# If you run the script from SSH, your output should look something like
# the following (if the email was sent successfully):
# username@routername:/tmp/mnt/USB01/scripts# ./SendEmailTest.sh
# depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority
# verify return:1
# depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA
# verify return:1
# depth=1 C = US, O = Google Inc, CN = Google Internet Authority G2
# verify return:1
# depth=0 C = US, ST = California, L = Mountain View, O = Google Inc, CN = smtp.gmail.com
# verify return:1
# 250 SMTPUTF8
FROM="YourEmail@gmail.com"
AUTH="YourEmail@gmail.com"
PASS="YourPassword"
FROMNAME="John Doe"
TO="recipient@example.com"
ntpclient -h pool.ntp.org -s &> /dev/null
sleep 5
echo "Subject: WAN Connection" >/tmp/mail.txt
echo "From: \\"$FROMNAME\\"<$FROM>" >>/tmp/mail.txt
echo "Date: `date -R`" >>/tmp/mail.txt
echo "" >>/tmp/mail.txt
echo "My WAN IP is: `nvram get wan0_ipaddr`" >>/tmp/mail.txt
echo "Uptime is: `uptime | cut -d ',' -f1 | sed 's/^.\{12\}//g'`" >>/tmp/mail.txt
echo "" >>/tmp/mail.txt
cat /tmp/mail.txt | sendmail -H"exec openssl s_client -quiet \
-CAfile /jffs/configs/Equifax_Secure_Certificate_Authority.pem \
-tls1 -starttls smtp -connect smtp.gmail.com:587" \
-f"$FROM" \
-au"$AUTH" -ap"$PASS" $TO \
rm /tmp/mail.txt
I'm not sure it's the certificate. In my part of the script I explicitly include the cert. But maybe some caching miracle helps it. Anyway, good to hear AB does some good.Thanks. I hadn't test it as it is currently working for me.
I don't know why but i had the script before i installed ab solution. When on AB i enable mail it makes my WAN notification script works again.. maybe the certificate..
13. Transfer this .pem file to /jffs/configs folder and make sure you reference this file in your mail script.
cat /tmp/mail.txt | sendmail -H"exec openssl s_client -quiet -CAfile GMail_Root_CA.pem -connect smtp.gmail.com:587 -tls1 -starttls smtp" -f"$FROM" -au"$AUTH" -ap"$PASS" $TO
Hello, would it be a good choise for an embedded system though ?Ran into this the other day - debian has a little sendmail agent - perfect for something like this, and it supports secure SMTP...
sSMTP
It's not a full blown MTA like Sendmail/Postfix/QMail, but might be perfect here...
https://packages.debian.org/sid/ssmtp
Might take a bit of work to integrate - but it looks perfect for burping off notifications and logs, etc...
Hello, would it be a good choise for an embedded system though ?
curl --url smtps://$SMTP:$PORT \
--mail-from "$FROM_ADDRESS" --mail-rcpt "$TO_ADDRESS" \
--upload-file /tmp/mail.txt \
--ssl-reqd \
--user "$USERNAME:$PASSWORD" --insecure \
-v
Thread starter | Title | Forum | Replies | Date |
---|---|---|---|---|
L | Feature suggest: web notifications | Asuswrt-Merlin | 1 | |
Notifications when device goes online/offline | Asuswrt-Merlin | 0 | ||
H | Do AiProtectipn Email Notifications Actually Work? | Asuswrt-Merlin | 10 | |
Google mail vpn blocking | Asuswrt-Merlin | 7 |
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!