What's new

Notifications (E-Mail)

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Minglarn

Occasional Visitor
Hi! This is my first post and sorry if this has been discussed before (did a search in the forum but it returned 0 results)

I've upgraded my poor/old D-Link 655 to this eminent router and really like the touch and speed, but I'm missing one part.... And that is to be notified when something is wrong. My 655 did e-mail me when it restarted (after a power loss or similar) or when something went wrong.

Is this possible to implement to the Asus RT-66U?
 
Last edited:
Hi,
Would to a great feature.
Could use it to tell me the current WAN IP for remote access.
Don't like a DDNS name.

Cheers
 
The router comes with the sendmail command. In theory you could create a services-start script that would automatically send an Email when services are restarted (such as at boot time), or on wan-start (when the WAN interface comes up). However I have never managed to get that Sendmail command to work properly here. My ISP's SMTP returns nothing, and my hosting's SMTP gives me a bad recipient despite the fact the recipient address is perfectly fine. It's possible that Busybox's sendmail applet is quirky, if not broken.
 
Intresting! As My Linux knowlege is nearly zero i've to ask for help.
Or if there are any good wiki for this I've appreciate it.
 
I found some time to actually work out the syntax and a simple example for a script that will send Email notifications from your router. See this Wiki page I just added.
 
I am trying to set sendmail with my gmail account:
echo "This is a test email." | /usr/sbin/sendmail -S smtp.gmail.com:587 -f myname@gmail.com myname@gmail.com -au myname@gmail.com -ap mypassword
But I get every time:
sendmail: AUTH LOGIN failed
From pc I am abble to send emails with port 25 or 587

Don't put any space between the switch and the values. Also try putting those values within "". Using quotes in my test script worked for me when I used my hoster's SMTP with authentication. And put the TO address at the end (after the auth arguments).

That's what I meant in my earlier reply about busybox's applet being quirky. Took a fair amount of trial and errors for me to get it working properly :)
 
Didn't worked
echo "This is a test email." | /usr/sbin/sendmail -S"smtp.gmail.com:25" -f"myemail@gmail.com" -au"myemail@gmail.com" -ap"password" "myemail@gmail.com"
or
echo "This is a test email." | /usr/sbin/sendmail -Ssmtp.gmail.com:25 -fmyemail@gmail.com -aumyemail@gmail.com -appassword myemail@gmail.com

than I tryed with another account, not gmail, and I didn't get any error in terminal but I received mail failure notice in the inbox:

I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.
Unable to run qmail-remote.
Received: (qmail 15621 invoked by uid 108); 11 Oct 2012 11:17:48 -0400
Received: from unknown (HELO none)
 
GMail does not support PLAIN AUTH, only through TLS:

admin@RT-AC66U:/tmp/home/root# telnet smtp.gmail.com 25
220 mx.google.com ESMTP hg2sm209871igc.3
ehlo test.com
250-mx.google.com at your service, [xxx.xxx.xxx.xx]
250-SIZE 35882577
250-8BITMIME
250-STARTTLS
250 ENHANCEDSTATUSCODES
quit
221 2.0.0 closing connection hg2sm209871igc.3
Connection closed by foreign host
 
So, nothing to do...

Sent from my HTC One V using Tapatalk 2

You could use your ISP's SMTP, provided it works either without authentication or with plain text authentication.
 
I finally did it, this is my configuration in wan-start script:

#!/bin/sh
SMTP="my_isp_smtp:25"
FROM="my_isp_email_adress"
FROMNAME="RT-N66U"
TO="my_gmail_adress"

echo "Subject: WAN state notification" >/tmp/mail.txt
echo "From: \"$FROMNAME\"<$FROM>" >>/tmp/mail.txt
echo "Date: `date -R`" >>/tmp/mail.txt
echo "I just got connected to the RDS." >>/tmp/mail.txt
echo "My new IP is: `nvram get wan0_ipaddr`" >>/tmp/mail.txt
echo "" >>/tmp/mail.txt
echo "--- " >>/tmp/mail.txt
echo "Your friendly router." >>/tmp/mail.txt

cat /tmp/mail.txt | /usr/sbin/sendmail -S"$SMTP" -f"$FROM" $TO
-au"my_isp_username" -ap"my_isp_password"

rm /tmp/mail.txt

THX Merlin
 
Last edited:
Sounds wonderfully! However, is this possible for Melin to implement in a future FW?
 
Sounds wonderfully! However, is this possible for Melin to implement in a future FW?

To implement what? Everything described here is for Asuswrt-Merlin :)
 
:D is it possible for you to make an extra settings-menu in your "official" FW?

This would be great for us who don't know how to use telnet and Linux :)
 
Last edited by a moderator:
:D is it possible for you to make an extra settings-menu in your "official" FW?

This would be great for us who don't know how to use telnet and Linux :)

An extra setting to do what exactly?

(PS: don't mind the edit notice on your post, the Edit button was too close to the Quote button here :) )
 
An extra setting to do what exactly?

(PS: don't mind the edit notice on your post, the Edit button was too close to the Quote button here :) )

An extra setting to make the router send mail when it restarts ect. :)

Ps: sorry for my bad English. :)
 
An extra setting to make the router send mail when it restarts ect. :)

Ps: sorry for my bad English. :)

It's just a few lines of script, and it can't be built-in anyway because you have to configure a lot of parameters to match your specific setup (SMTP, authentication, etc...). It's way faster and simpler to implement as a user script than a built-in function. No point in replacing 10 lines of script with 40 lines of HTML and 50 lines of C code.
 
I love scripts. :D
Would it be possible to alter it a bit and send an e-mail when this line is seen?

Jan 1 01:00:15 WAN Connection: WAN was restored.

This way I know the WAN has been down for whatever reason. :mad:
 
I love scripts. :D
Would it be possible to alter it a bit and send an e-mail when this line is seen?

Jan 1 01:00:15 WAN Connection: WAN was restored.

This way I know the WAN has been down for whatever reason. :mad:

Why parse syslog? wan-start gets run whenever the WAN interface comes up, that would be far more efficient.
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top