Daily email with the previous day's bandwidth usage?

Post new topic   This topic is locked: you cannot edit posts or make replies.    DD-WRT Forum Index -> General Questions
Goto page Previous  1, 2, 3, ... 10, 11, 12  Next
Author Message
Dark_Shadow
DD-WRT Guru


Joined: 31 Aug 2009
Posts: 2448
Location: Third Rock from the Sun

PostPosted: Tue Aug 24, 2010 22:43    Post subject: Reply with quote
I just tried the straight forward approach and used my ISP SMTP server. Nothing received in ether the sender box as in an error or the receivers box. Nothing in the log.

PS i am running the file from the telnet console.

EDIT:

Just showed up on the bwmail.log

Code:
220 isp.att.net - Maillennium ESMTP/MULTIBOX frfwmhc05 #16
250 ok
250 XMVP 2
504 disabled authentication mechanism
250 ok
550 [PERMFAIL] darkhaven.org requires valid sender domain

_________________
Peacock Thread-FAQ -- dd-wrt Wiki

Testing Multiple Routers -- Bootloader Collection Project -- My Wiki
Sponsor
rseiler
DD-WRT Guru


Joined: 01 Oct 2007
Posts: 622

PostPosted: Tue Aug 24, 2010 22:51    Post subject: Reply with quote
Dark Shadow, when you try just this (adapt it for yourself), do you get any response at all? When it's working, you should see several lines of SMTP conversation. At one location where it's working, that's what I see. In the one where it's not, I get no response at all. Yet, the procedure at the KB article below works fine.

Code:
sendmail -S"smtp.comcast.net" -f"sender@comcast.net" -F"DD-WRT" -d"comcast.net" -s"Bandwidth Report" -m"test" me@gmail.com


http://support.microsoft.com/kb/153119
Dark_Shadow
DD-WRT Guru


Joined: 31 Aug 2009
Posts: 2448
Location: Third Rock from the Sun

PostPosted: Tue Aug 24, 2010 22:56    Post subject: Reply with quote
rseiler wrote:
Dark Shadow, when you try just this (adapt it for yourself), do you get any response at all? When it's working, you should see several lines of SMTP conversation. At one location where it's working, that's what I see. In the one where it's not, I get no response at all. Yet, the procedure at the KB article below works fine.

Code:
sendmail -S"smtp.comcast.net" -f"sender@comcast.net" -F"DD-WRT" -d"comcast.net" -s"Bandwidth Report" -m"test" me@gmail.com


http://support.microsoft.com/kb/153119
I am not running a smtp server my isp is, therefor the KB article is of no consequence.

However it looks like it's working on the router side, there's just a setting in the code, I need to get right.

EDIT: Explanation of flags

-S = smtp server address
-f = from email address
-u = username for the smtp account
-p = password for smtp account
-s = email subject
-d = senders domain
-F = "From" name (as opposed to address)

And I figure that the email at the end of the script is the destination email addy but has no flags.

_________________
Peacock Thread-FAQ -- dd-wrt Wiki

Testing Multiple Routers -- Bootloader Collection Project -- My Wiki


Last edited by Dark_Shadow on Wed Aug 25, 2010 5:13; edited 1 time in total
rseiler
DD-WRT Guru


Joined: 01 Oct 2007
Posts: 622

PostPosted: Tue Aug 24, 2010 23:17    Post subject: Reply with quote
That KB article doesn't require your own SMTP server. For example, I did this:

telnet smtp.comcast.net 25

I can't find -d either, but to be safe, make it the domain of your ISP.

-F is the "From" name (as opposed to address)

The TO address is just floating there with no flags.


Last edited by rseiler on Tue Aug 24, 2010 23:34; edited 1 time in total
Dark_Shadow
DD-WRT Guru


Joined: 31 Aug 2009
Posts: 2448
Location: Third Rock from the Sun

PostPosted: Tue Aug 24, 2010 23:22    Post subject: Reply with quote
rseiler wrote:
That KB article doesn't require your own SMTP server. For example, I did this:

telnet smtp.comcast.net 25

I can't find -d either, but to be safe, make it the domain of your ISP.

The TO address is just floating there with no flags.
Yea I did that and tried the domain of the recipient. Both provide the same error mentioned above.
_________________
Peacock Thread-FAQ -- dd-wrt Wiki

Testing Multiple Routers -- Bootloader Collection Project -- My Wiki
Dark_Shadow
DD-WRT Guru


Joined: 31 Aug 2009
Posts: 2448
Location: Third Rock from the Sun

PostPosted: Tue Aug 24, 2010 23:38    Post subject: Reply with quote
It works!!!! had a typo in my domain names

Now to wait and see if it runs via cron.

_________________
Peacock Thread-FAQ -- dd-wrt Wiki

Testing Multiple Routers -- Bootloader Collection Project -- My Wiki
rseiler
DD-WRT Guru


Joined: 01 Oct 2007
Posts: 622

PostPosted: Wed Aug 25, 2010 0:46    Post subject: Reply with quote
Summarizing what I think I know about sendmail:

1) -d seems undocumented and unnecessary [Update: it may be undocumented, but it is necessary]. The only place I've seen it meaning 'domain' is in the link in the top post.
2) sendmail either always works or always doesn't for no apparent reason. It likes Comcast in some places but not others. It also isn't on speaking terms with Exchange 2003's virtual SMTP server, which internally anyway, is ready and waiting for all comers on port 25--except for sendmail. When it doesn't work, there's no output from sendmail whatsoever. When it does work, it's chatty.
3) There doesn't seem to be a way to send on alternate ports, at least via a switch.
4) If you want to send to multiple recipients, separate them by spaces.


Last edited by rseiler on Wed Aug 25, 2010 4:33; edited 1 time in total
tc23emp
DD-WRT Novice


Joined: 23 Aug 2010
Posts: 33

PostPosted: Wed Aug 25, 2010 1:44    Post subject: Reply with quote
For authenticated SMTP, try:

Code:

sendmail -S"smtp.comcast.net:587" -u"sender" -p"password" -f"sender@comcast.net" -F"DD-WRT" -d"comcast.net" -s"Bandwidth Report" -m"test" me@gmail.com


Leaving out -d for domain fails for me, so I would try leaving it in for now.
Dark_Shadow
DD-WRT Guru


Joined: 31 Aug 2009
Posts: 2448
Location: Third Rock from the Sun

PostPosted: Wed Aug 25, 2010 2:06    Post subject: Reply with quote
tc23emp wrote:
For authenticated SMTP, try:

Code:

sendmail -S"smtp.comcast.net:587" -u"sender" -p"password" -f"sender@comcast.net" -F"DD-WRT" -d"comcast.net" -s"Bandwidth Report" -m"test" me@gmail.com


Leaving out -d for domain fails for me, so I would try leaving it in for now.
Couldn't get the port working for gmail, however I use

Code:

sendmail -S"smtp.comcast.net" -u"sender" -p"password" -f"sender@comcast.net" -F"DD-WRT" -d"comcast.net" -s"Bandwidth Report" -m"test" me@gmail.com


and it works fine

_________________
Peacock Thread-FAQ -- dd-wrt Wiki

Testing Multiple Routers -- Bootloader Collection Project -- My Wiki
barryware
DD-WRT Guru


Joined: 26 Jan 2008
Posts: 13049
Location: Behind The Reset Button

PostPosted: Wed Aug 25, 2010 2:20    Post subject: Reply with quote
what do you need to do to specify ssl & a diff port? I have the same problem with dd-wrt e-mailing me about max connections..

My outgoing server requires authentication (as all do.. user & password). It also requires an encrypted connection (ssl) and a diff port (465).

Never was able to get dd-wrt e-mail to work. Maybe time to revisit.

_________________
[Moderator Deleted] Shocked
tc23emp
DD-WRT Novice


Joined: 23 Aug 2010
Posts: 33

PostPosted: Wed Aug 25, 2010 2:37    Post subject: Reply with quote
I meant the previous example (only changing the port) as exclusive to comcast.net as it does not require SSL encryption. It might help rseiler.

With busybox sendmail, the SSL method is discussed here. However, that requires openssl. You might be better off with ssmtp or another MTA if you go as far as installing additional software.

EDIT: I am starting to think this would be possible if you have a mail server on another machine (that forwards mail to gmail via SMTP) with which you can create a SSH tunnel to from DD-WRT.
rseiler
DD-WRT Guru


Joined: 01 Oct 2007
Posts: 622

PostPosted: Wed Aug 25, 2010 4:46    Post subject: Reply with quote
You're right, of course, if you leave out the -d you get "invalid domain name." This has been a long day, and when I was testing before I had thought I excluded it. Apparently not. Puzzling that something important seems not to exist though.

At the location I really wanted to get reporting working, I did, by using the DSL provider's SMTP instead of the one in the office (which is Exchange's SMTP, which sendmail dislikes as much as Comcast). It works great.

The port and credentials didn't help with Comcast, and that stands to reason since I'm not getting anything back from sendmail at any time with Comcast. Even if 25 was blocked, which I've proved it isn't, you'd still get back some indication that something at all has happened. So it's some larger puzzle, perhaps something with this version of DD-WRT, though sendmail is part of Busybox, and I don't think that's been updated in ages (on DD-WRT, at least).
rseiler
DD-WRT Guru


Joined: 01 Oct 2007
Posts: 622

PostPosted: Wed Aug 25, 2010 5:34    Post subject: Reply with quote
Comcast (both on ports 25 and 587) works if you use 76.96.30.117 instead of smtp.comcast.net. Exchange's SMTP works if you use the server's LAN IP. Some sort of selective DNS issue on the router, apparently.
tc23emp
DD-WRT Novice


Joined: 23 Aug 2010
Posts: 33

PostPosted: Wed Aug 25, 2010 12:52    Post subject: Reply with quote
For anyone else still having problems (no options besides SSL-required SMTP), I would recommend setting up a local-only mail server (if you have linux server box available).

Instructions are here and here.

Just make sure to either not expose any ports outside your LAN or keep the restrictions on relaying to only allowed hosts so that you don't inadvertently become a SPAM relay.
dellsweig
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 1476
Location: New York, USA

PostPosted: Wed Aug 25, 2010 14:04    Post subject: Reply with quote
tc23emp wrote:
For anyone else still having problems (no options besides SSL-required SMTP), I would recommend setting up a local-only mail server (if you have linux server box available).

Instructions are here and here.

Just make sure to either not expose any ports outside your LAN or keep the restrictions on relaying to only allowed hosts so that you don't inadvertently become a SPAM relay.


Seems like a much simpler method for this type of report - and much more detailed reports (by IP, protocol, etc) would be to use a Netflow tool such as ManageEngine and simply schedule reports....
Goto page Previous  1, 2, 3, ... 10, 11, 12  Next Display posts from previous:    Page 2 of 12
Post new topic   This topic is locked: you cannot edit posts or make replies.    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum