Community discussions

MUM Europe 2020
 
slech
Long time Member
Long time Member
Topic Author
Posts: 533
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Dude - Email notification through Gmail on Windows - via blat.

Sun May 10, 2009 11:42 pm

Related solutions:
Send mail via server which require SMTP authentication
Dude - Email notification through Gmail on Windows - via mailsend.

Requirements:
1. Stunnel.
2. Blat.
3. Dude server on windows machine.
4. Gmail account.

Setup instruction:
1. Download and install stunnel

2. Create the following stunnel.conf (please backup original file and create this file from scratch)
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
;debug = 7
;output = stunnel.log

client = yes

[pop3s]
accept  = 995
connect = pop.gmail.com:995

[ssmtp]
accept  = 465
connect = smtp.gmail.com:465
And reload config in stunnel.

3. Install stunnel as service:
"C:\Program Files\stunnel\stunnel.exe" -install
or
Start-->All Programms --> stunnel --> stunnel Service Install
4. Download blat and unpack 2 files
blat.dll
blat.exe
in
C:\Program Files\Dude\blat
directory or other directory.

5. In directory from p.2 create emailblat.cmd file with the following content
:: 
:: Send email notifications from Dude via Gmail
:: 
set blatdir=C:\Program Files\Dude\blat
set smtpsender=username@gmail.com
set smtpserver=127.0.0.1
set smtpport=465
set smtpuser=username
set smtppwd=*********
set mailto=username@gmail.com
::
::
"%blatdir%\blat.exe" -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject %1 -body %2
::
:: Uncomment for debug only (Comment previous line. Do not forget to return back after debugging!!!)
::
::"%blatdir%\blat.exe" -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject "Test subject" -body "Test body" -debug -log emailbtal.log
::
::pause
::
change in it: smtpsender, smtpuser, smtppwd, mailto

For debugging uncomment appropriate line, and comment previous - then start emailblat.cmd without parameters. And do not forget to return back after debugging!!!

6. Create new Notification
Name: Email-blat
Type: execute on server
"C:\Program Files\Dude\blat\emailblat.cmd" "Service [Probe.Name] on [Device.Name] is now [Service.Status]" "Service [Probe.Name] on [Device.Name] is now [Service.Status] ([Service.ProblemDescription])"
And test it.

7. Now you can use it:
Dude-Email-notification-throughout-Gmail-on-Windows-machine-01.png
Hope this will help someone.
You do not have the required permissions to view the files attached to this post.
Last edited by slech on Sun Dec 24, 2017 6:44 pm, edited 18 times in total.
sorry for my english
 
User avatar
Ibersystems
Forum Guru
Forum Guru
Posts: 1684
Joined: Wed Apr 12, 2006 12:29 am
Location: Cabrils, Barcelona - Spain
Contact:

Re: Email notification throughout Gmail on Windows machine

Sun May 24, 2009 1:04 am

LOL. Put it in the wiki!

thanks! good job!!
Martín
martinruiz at ibersystems.es
Experto en redes WiFi y enlaces WiFi.

Facebook: @Ibersystems
Twitter: @Ibersystems

Certified in Traffic Shaping, Wireless, Internetworking, Routing and User Management.
MTCTCE - MTCWE - MTCINE - MTCUME - MTCRE
 
geoffreygg
just joined
Posts: 1
Joined: Wed Aug 26, 2009 6:11 pm

Re: Email notification throughout Gmail on Windows machine

Wed Aug 26, 2009 6:14 pm

I tried this approach with no such luck. Are all the strings to be altered listed in the emailblat.cmd? Should smtp server be the loop back address if the dude is not running smtp service?
 
slech
Long time Member
Long time Member
Topic Author
Posts: 533
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Email notification throughout Gmail on Windows machine

Sat Sep 05, 2009 10:12 pm

in my way i use stunnel that work as redirector - without any SMTP server on local machine.
you must use any address of you server if it listening port that indicated in stunnel.conf.

1. Verify if stunnel work - you must view the same results:
telnet localhost 995
or
telnet 192.168.1.1 995
+OK Gpop ready for requests from XX.XX.XX.XX 37pf6537165qyk.25
telnet localhost 465
or
telnet 192.168.1.1 465
220 mx.google.com ESMTP 9sm2309658agb.29
2. Then try to run emailblat.cmd from cmd - and see result

3. I have a problem to send mail with blat when gmail user password contained ? or ; symbols
sorry for my english
 
golontico
just joined
Posts: 5
Joined: Sat Jul 24, 2010 6:44 am

Re: Email notification throughout Gmail on Windows machine

Sat Jul 24, 2010 7:17 am

Where i need to put this? what file or where?

Requirements: blat + stunnel + dude server on windows machine + gmail account



3. In directory from p.2 create emailblat.cmd file with the following content
set dir=c:\Program Files\Dude\blat
set smtpsender=gmailaccount@gmail.com
set smtpserver=127.0.0.1
set smtpport=465
set smtpuser=gmailaccount
set smtppwd=*********
set mailto=gmailaccount@gmail.com

"%dir%\blat.exe" -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject %1 -body %2
change in it smtpsender, smtpuser, smtppwd

4. Create new Notification
Name:Email blat
Type:execute on server
"c:\Program Files\Dude\blat\emailblat.cmd" "Service [Probe.Name] on [Device.Name] is now [Service.Status]" "Service [Probe.Name] on [Device.Name] is now [Service.Status] ([Service.ProblemDescription])"
And test it.

5. You must use it.

It work for me !

Image

thks for your help i only need to put it to do tests
 
niemandsonst
just joined
Posts: 1
Joined: Fri Oct 22, 2010 10:41 am
Location: Thuringia, Germany

Re: Email notification throughout Gmail on Windows machine

Fri Oct 22, 2010 11:03 am

Hi.

I am new in this board, i am a new "The Dude" user.
The Dude is a nice app.
But email notification is very important for me.

I tested this workaround. Very fine using an gmail Account.

I don't want to use an email account from gmail.
But i have a problem with my preferred account. It doesn't use SSL.
I can only use unsecured SMTP and POP3. do you know an program, or possibility to use it in this way?

Authentication is necessary, because this feature is active to my preferred account.
When will The Dude use authentication to send mails?

I hope my english is good enough that you will understand what i want.

Waiting for answers......

thanks
 
jmay
Member
Member
Posts: 326
Joined: Tue Jun 23, 2009 8:26 pm

Re: Email notification throughout Gmail on Windows machine

Sat Oct 30, 2010 1:29 am

I did this and it works! Very cool. In case anyone has problems reboot after installation even thought it doesn't mention that you need to. In my case it wouldn't work until I did.

Maybe this could be a sticky or something? It's a very cool feature that I would have done long ago had I knew it existed.
 
slech
Long time Member
Long time Member
Topic Author
Posts: 533
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Email notification throughout Gmail on Windows machine

Fri Dec 10, 2010 4:40 pm

niemandsonst
Skip step1 with stunnel install, and user blat parameters to connect to you mail server
emailblat.cmd
set dir=c:\Program Files\Dude\blat
set smtpsender=dude@domain.com
set smtpserver=192.168.0.1(you server IP)
set smtpport=25
set smtpuser=username@domain.com
set smtppwd=*********
set mailto=admin@domain.com
::
"%dir%\blat.exe" -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject %1 -body %2
sorry for my english
 
normanwill
just joined
Posts: 1
Joined: Mon Nov 29, 2010 11:18 am

Re: Email notification throughout Gmail on Windows machine

Mon Dec 13, 2010 11:28 am

Yes Thanks Grate Job
 
krissanto
just joined
Posts: 2
Joined: Thu May 12, 2011 11:58 am

Re: Email notification throughout Gmail on Windows machine

Fri May 13, 2011 7:13 am

I'm trying to follow the instruction above without stunnel, but it didn't work.

i cannot receive email automatically, but if i run the .bat manually, it work, but i didn't receive any report, just a plain text that i input on "body" and "subject"

Please tell me, what i do wrong ? I'm trying to send email to my email server at the office

c:\Program Files\Dude\blat\emailblat.cmd "Service [Probe.Name] on [Device.Name] is now [Service.Status]" "Service [Probe.Name] on [Device.Name] is now [Service.Status] ([Service.ProblemDescription])"
 
slech
Long time Member
Long time Member
Topic Author
Posts: 533
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Email notification throughout Gmail on Windows machine

Sun May 15, 2011 8:20 pm

krissanto
In Dude, go to the Notification and open Email-blat instance - then pres test.
Verify if your path to emailblat.cmd is correct.
Now in my Windows 7 x64 path differ on that I was wrote in the first post:
"c:\Program Files (x86)\Dude\blat\emailblat.cmd"  "Service [Probe.Name] on [Device.Name] is now [Service.Status]" "Service [Probe.Name] on [Device.Name] is now [Service.Status] ([Service.ProblemDescription])"]
sorry for my english
 
krissanto
just joined
Posts: 2
Joined: Thu May 12, 2011 11:58 am

Re: Email notification throughout Gmail on Windows machine

Mon May 16, 2011 8:32 am

here is my configuration on .bat
set dir=c:\Program Files\Dude\blat
set smtpsender=test@test.com
set smtpserver=xxxxxx
set smtpport=25
set smtpuser=test@test.com
set smtppwd=xxxxxx
set mailto=test@test.com
::
"%dir%\blat.exe" -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject " tes " %1 -body " tes "%2
Like i said before, when i double click the file, it runs normally. Do i need to change setting on server configuration from setting menu, for example like General or Server ?

Image
Image
Image
 
slech
Long time Member
Long time Member
Topic Author
Posts: 533
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Email notification throughout Gmail on Windows machine

Wed May 18, 2011 3:59 pm

krissanto
This is my settings:
ImageImageImage
sorry for my english
 
shadowfax
just joined
Posts: 1
Joined: Thu May 19, 2011 12:49 am

Re: Email notification throughout Gmail on Windows machine

Thu May 19, 2011 1:58 am

I am using windows 7 x64 - this worked perfectly for me - the only caveat was that i had to use the stunnel config file exactly as specified - i.e. i had to wipe out all of the other defaults that came with the stock stunnel.config.
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification throughout Gmail on Windows machine

Sat Aug 13, 2011 6:03 pm

here is my configuration on .bat
set dir=c:\Program Files\Dude\blat
set smtpsender=test@test.com
set smtpserver=xxxxxx
set smtpport=25
set smtpuser=test@test.com
set smtppwd=xxxxxx
set mailto=test@test.com
::
"%dir%\blat.exe" -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject " tes " %1 -body " tes "%2
Like i said before, when i double click the file, it runs normally. Do i need to change setting on server configuration from setting menu, for example like General or Server ?
Do you use Windows 2008 R2 perhaps? Same problem here, I think the security is tighter. I changed the account for the service even to administrator, and used cmd.exe /C to run it, without any luck..
 
ukitservice
just joined
Posts: 10
Joined: Tue Sep 13, 2011 1:37 pm

Re: Email notification throughout Gmail on Windows machine

Tue Sep 13, 2011 2:00 pm

Hi,

I'm using SBS2003 server to act is our Dude server (using STUNNEL & BLAT).
When running the emailblat.cmd file from cmd, we get the test email sent successfully.

However, we dont get the prob notification from the dude.

We use this as a notification (on the dude):
"c:\Program Files\Dude\blat\emailblat.cmd" "Service [Probe.Name] on [Device.Name] is now [Service.Status]" "Service [Probe.Name] on [Device.Name] is now [Service.Status] ([Service.ProblemDescription])"

I can see that the CMD black screen opens and closes very quickly as soon as a notification should be actioned, but no email is being send.

If I run the "c:\Program Files\Dude\blat\emailblat.cmd" "Service [Probe.Name]..." command from cmd I get this: "Do not understand argument Service [Probe.Name]..."

So the stunnel & blat are working ok, but seems that the dude wont understand the notification variables.

Any Ideas?
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification throughout Gmail on Windows machine

Tue Sep 13, 2011 2:40 pm

Hello,

I use
C:\blat\emailblat.cmd "Monitor: [Device.NetMaps] map - [Device.Name] probe [Probe.Name] is now [Service.Status]" "Hi there!||This is TheDude from the monitoring server reporting:||at: [TimeAndDate]|on map: [Device.NetMaps]|Device: [Device.Name]|Probe: [Probe.Name]|Status: [Service.Status]|Problem Description: [Service.ProblemDescription]|Changed since: [Service.TimeSinceChanged]|Last time up: [Service.TimeLastUp]"
I set it to execute on the server, and changed the service account of the Dude service to the local administrator.
FYI the || in the code above inserts a newline/enter in the email message.

My emailblat.cmd is:
rem @echo off

set dir=c:\blat
set logname=%dir%\blat-%date%.log
set smtpsender=senderadress@gmail.com
set smtpserver=127.0.0.1
set smtpport=465
set smtpuser=senderadress@gmail.com
set smtppwd=MyGmailPassword
set mailto=receiveradress@domain.com
set subject=%1
set body=%2

IF NOT EXIST %logname% echo ====================== Start of file ====================== > %logname%
echo. >> %logname%
echo ====================== %time% ====================== >> %logname%

C:
CD %dir%
echo CMD: blat.exe -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject %subject% -body %body% >> %logname%
blat.exe -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject %subject% -body %body% >> %logname%
Of course you have to change the sender and receiver address and the password. This version of emailblat.cmd also creates a log per day for all actions so you can better troubleshoot in the case of problems. Hope this helps you!

Regards, Roland
 
ukitservice
just joined
Posts: 10
Joined: Tue Sep 13, 2011 1:37 pm

Re: Email notification throughout Gmail on Windows machine

Tue Sep 13, 2011 3:23 pm

Hi Roland, thanks for your very quick reply!

I've made the changes to emailblat.cmd and the dude prob notification variables, nit sure about the dude service, where do you change it to use the administrator account (it's not in services)?

In any case, it did not work, I can see the cmd black screen pops up and closes very quickly, which means its acknowledging the action, but no email is sent ..

What am I missing?
 
ukitservice
just joined
Posts: 10
Joined: Tue Sep 13, 2011 1:37 pm

Re: Email notification throughout Gmail on Windows machine

Tue Sep 13, 2011 3:45 pm

Hi again, I added the command 'pause' at the end of the emailblat.cmd so I can see if there are any errors while actioning that batch file - see attached.

I also noticed it's not creating the log file like you set it up to do.

Help?
You do not have the required permissions to view the files attached to this post.
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification throughout Gmail on Windows machine

Tue Sep 13, 2011 3:56 pm

the problem is with the long path name. if you want to use it in the program files folder you have to use the short version (e.g. c:\progra~1\dude\blat) or move the blat directory. I have it in the root of C: (c:\blat). This should fix the problem..

Roland
 
ukitservice
just joined
Posts: 10
Joined: Tue Sep 13, 2011 1:37 pm

Re: Email notification throughout Gmail on Windows machine

Tue Sep 13, 2011 4:17 pm

Hi, made the change as you suggested, but still no joy.. see attached.
Maybe it's the dude service that needs to run as administrator? where do you change that?
You do not have the required permissions to view the files attached to this post.
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification throughout Gmail on Windows machine

Tue Sep 13, 2011 4:46 pm

I also see a problem with the log name. This is because of regional settings. for a quick fix replace
set logname=%dir%\blat-%date%.log
with
set logname=%dir%\blat.log
Let me know if this helps...
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification throughout Gmail on Windows machine

Tue Sep 13, 2011 4:58 pm

Tip for running The Dude as administrator:

On the server (applies only to Windows 2003!)
Click on the 'Local Server' button on the top left
Make sure Enable on localhost is tick't and the run mode is 'as service' and click 'Apply'

You'll get disconnected but the client should reconnect in a few seconds.
Now when you go to the services (start -> administrative tools -> services) you should see a new service named 'The Dude Server'. Double click that, go to the 'log on' tab and change the log on info to the administrator with the correct password. Since you are on a SBS2003 server you have to use the domain admin account (domainname\administrator) because there are no local accounts. after changing the info restart the service.

You are now running the Dude as a service under the admin account.

Remark!: When using Windows 2008+ there are security restrictions preventing you from creating a service from the Dude client and connecting to the correct instance of that service. This can be solved by right clicking the Dude icon, go to the compatibility tab and selecting 'Run this program as an administrator' and only use this from now on.
 
ukitservice
just joined
Posts: 10
Joined: Tue Sep 13, 2011 1:37 pm

Re: Email notification throughout Gmail on Windows machine

Tue Sep 13, 2011 5:06 pm

SPOT ON!
You got it right - it works!!
The email notification just came through and it looks really nice and easy to understand - well done for writing this little script.

One last question - we would like to monitor our clients servers but to do it all from main server at our office (so we got SBS2003 at our office and need to add about 7 other remote servers that sit at our clients different offices), can you please direct me to a link which has a step by step instruction of how to monitor remote servers (for CPU, Disc Space, service Outage etc')?

Thanks again for your help !!
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification throughout Gmail on Windows machine

Tue Sep 13, 2011 5:32 pm

I was expecting that question since your username is suggesting that your company is doing IT services support for other companies :)

You have to use Agent configuration. I also use this at our company. I used the manual at this page to figure it out: http://wiki.mikrotik.com/wiki/Manual:The_Dude/Agents
Some remarks from my side learned through deploying this:

You can only use 1 version (3.6 for example) for the main server and all the client servers

on the agent (server of your client running The Dude)
- rename the admin account and use a long pasword (16 chars)
- open the Dude secure port in the firewall (2211/TCP) and make sure your main server is the only ip that is allowed to connect
- remove any devices from the local server installation, because you will not see those in the main server

Above settings make the remote monitoring more secure and tiny.

On the server on your premises configure the agent through the settings -> agents tab and
- use the correct info from the agent (ip, renamed admin, long password) and connect through port 2211
- create a new map per client and add the devices there, set the agent to the appropriate server

Some other tips I have for remote supporting clients is to use Syslog Agent (http://syslogserver.com/syslogagent.html) to send event logs to your main server (you have to open the correct port in the firewall for that at your main server) and use syslog rules (settings -> syslog) to have alerting. Also a good idea is to utilize the maximum potential of the SNMP for alerting and monitoring and also set up SNMP-Trap services. SNMP-Trap services is a bit more complex because it requires an external tool that translates the traps to the eventlog.
 
ukitservice
just joined
Posts: 10
Joined: Tue Sep 13, 2011 1:37 pm

Re: Email notification throughout Gmail on Windows machine

Tue Sep 13, 2011 5:59 pm

:) Yes, you got it right again.. we are a IT support company.. :)

I did see the link you provided already, I guess I'm not that good as you are because I didn't manage to get it to work on our server.

This is what I did so far:
1. Install the dude on our client's server (changed default use/pass)
2. Changed router/firewall to redirect to the dude server via port 2211
3. on our dude server -> added an agent (see attached) with the WAN IP of the remote server

It seems that the remote agent is not connecting..
You do not have the required permissions to view the files attached to this post.
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification throughout Gmail on Windows machine

Tue Sep 13, 2011 6:27 pm

Usually this either the firewall on the client side or the way that your main server is connected to the internet.
Since you have SBS2003 on both sides, I have 2 questions for you:

Do you have ISA server on the client's SBS server, or is it the standard edition?
Do you have ISA server on your local main server?
 
ukitservice
just joined
Posts: 10
Joined: Tue Sep 13, 2011 1:37 pm

Re: Email notification throughout Gmail on Windows machine

Tue Sep 13, 2011 6:33 pm

I found the problem, the user/pass I changed were the wrong one.
It's all working now.
I will now follow your other suggestion to allow access only from the main dude server.

You have been a GREAT HELP!!

Thanks again for your amazing support.. :-)

Would it be ok to contact you again in the future (via this thread) if I have any issues?

Maytal
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification throughout Gmail on Windows machine

Tue Sep 13, 2011 6:37 pm

Your welcome! 8)
I'm happy that I can share my knowledge with other IT supporters...

Feel free to contact me! I'm sure we'll also be helping other with this thread.

Roland.
 
ukitservice
just joined
Posts: 10
Joined: Tue Sep 13, 2011 1:37 pm

Re: Email notification throughout Gmail on Windows machine

Tue Sep 13, 2011 8:10 pm

Hi Roland,

I am going over your list and have some issues with two of the changes you suggested we should do:

- open the Dude secure port in the firewall (2211/TCP) and make sure your main server is the only ip that is allowed to connect --> how do I setup a single IP to be allowed?
- remove any devices from the local server installation, because you will not see those in the main server --> Not sure what you mean here..?

Thanks
Maytal
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification throughout Gmail on Windows machine

Tue Sep 13, 2011 10:18 pm

Hi Roland,

I am going over your list and have some issues with two of the changes you suggested we should do:

- open the Dude secure port in the firewall (2211/TCP) and make sure your main server is the only ip that is allowed to connect --> how do I setup a single IP to be allowed?
- remove any devices from the local server installation, because you will not see those in the main server --> Not sure what you mean here..?

Thanks
Maytal
Allowing a single IP to connect to an open port, depends on the type of firewall you are using. In for example a Cisco ASA you can set the allowed remote address to a specific adress/24 in stead of allowing 0.0.0.0/0 to connect. In ISA server a similar action is possible. Maybe if you can give me a direction on what firewall, I can give you a hint.

Most firewall's work in a 2 step mode. First step is the Firewall, setting the open ports and allowed remote addresses. Theb the firewall passes the allowed traffic trough to the NAT module. The NAT module leads the traffic to the appropriate internal IP address and port

example:

external source -> external IP:incomming port -> firewall -> NAT -> internal IP:destination port
ok:
82.58.120.1 -> 62.128.25.1:2211 -> Allowed? Yes! -> NAT translate -> 192.168.1.100:2211
not ok:
82.58.120.2 -> 62.128.25.1:2211 -> Allowed? No! -> Block

The agent (Dude installation running on the client's machine) will not actively monitor or alert on any machines or devices. You will have to configure all machines/probes on the main server and select the appropriate agent that will do the monitoring for the main.

for example, I have a router with ip 192.168.1.1 that I wish to monitor at my client. I also have a server with IP 192.168.1.100 that has The Dude installed. From my main server I configured this Dude installation of my client as an agent. On my client's server I do NOT monitor the router 192.168.1.1, but instead I add it to a separate map in my main server at my company, but select the agent at the client to do the monitoring as a delegate. So no devices are configured at the client's server acting as agent, but only on the main server at my company.

Hope that this sheds some light on what I mean, if not, no problem, just ask what's unclear, I'm happy to help.
 
ukitservice
just joined
Posts: 10
Joined: Tue Sep 13, 2011 1:37 pm

Re: Email notification throughout Gmail on Windows machine

Wed Sep 14, 2011 12:22 pm

Hi, yes, all is clear.
I understand about the firewall, but I though you can also limit access (to allow only single IP remote access) from the dude itself.

On the remote server, I have allowed 0.0.0.0/0 - which enabled the main server to connect.
But, when I change the 0.0.0.0/0 to 10.0.0.0/24 (which is my main server local IP range) - the remote server connection drops.

I have also tested it locally, allowing and denying access to the web-interface of the dude, and it works fine, but it wont work if I do it from the 'allowed networks' (in the 'server' tab under 'server configuration' window).
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification throughout Gmail on Windows machine

Wed Sep 14, 2011 12:32 pm

You have to fill in the external IP address of the main server if you want to do it that way, since that's the source address (through NAT). You can check that when the main sever is connected by viewing the tab 'Active' under 'Admins' on the client's Dude installation.

But the more secure way is to configure it in the firewall, because when you configure it at the client's Dude installation, a potential hacker is already past the first security step.
 
ukitservice
just joined
Posts: 10
Joined: Tue Sep 13, 2011 1:37 pm

Re: Email notification throughout Gmail on Windows machine

Thu Sep 22, 2011 3:35 pm

Ok we've installed and configured the Dude on our server and also on our client’s server.
The dude can connect to our client’s server and see all the equipment on their network but the only problem we have right now is getting the probes (cpu, disk & memory) to work on any of the servers or desktops. They are currently showing as being down.

We've enabled SNMP on all servers and also on the firewall using the guide below.
http://www.poorperformance.com/wiki/ind ... t_Settings

Are there any additional settings in the Dude that we need change or set?

Any help is appreciated!

Many thanks
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification throughout Gmail on Windows machine

Thu Sep 22, 2011 3:44 pm

Hi!

When I look at the manual for configuring SNMP on a Windows machine, I see that they want you to configure that only the local machine can connect. This setup isn't going to work because external SNMP requests are ignored. In the properties of the SNMP service go to the tab Security and add the hostname or IP address of the Dude server at the client at the Accept SNMP packets from these hosts part. Restart the SNMP service after aplying the changes.

Also I would like to recommend NOT to use the Public community string as it is the first string a hacker would try on a machine. It is only a read-only string but giving away valuable system information for free to a hacker is not ok, in my opinion. So generate a random 8 or more character community name and use that for this client. Don't forget to create the correct listener at The Dude's side that has a corresponding read string (under Settings -> SNMP -> profiles)

Roland.
 
CypherBit
just joined
Posts: 18
Joined: Tue Mar 06, 2012 10:06 am

Re: Email notification throughout Gmail on Windows machine

Wed Apr 25, 2012 12:34 pm

Excellent post!

I currently use our Exchange server for notifications (push mail, better accesss...) and I've now added Gmail as well. Is it possible to somehow configure notifications that Gmail will only be used if our Exchange is down?
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification throughout Gmail on Windows machine

Mon May 14, 2012 5:53 pm

Excellent post!

I currently use our Exchange server for notifications (push mail, better accesss...) and I've now added Gmail as well. Is it possible to somehow configure notifications that Gmail will only be used if our Exchange is down?
Not that I know. But what you can do, is that you create a probe that checks the Exchange server and when it's down the alert is send trough the Gmail account...
 
CypherBit
just joined
Posts: 18
Joined: Tue Mar 06, 2012 10:06 am

Re: Email notification throughout Gmail on Windows machine

Mon May 14, 2012 6:12 pm

Not that I know. But what you can do, is that you create a probe that checks the Exchange server and when it's down the alert is send trough the Gmail account...
I did just that :D
 
David1234
Forum Guru
Forum Guru
Posts: 1266
Joined: Sun Sep 18, 2011 7:00 pm

Re: Email notification throughout Gmail on Windows machine

Mon Jun 25, 2012 4:49 pm

sorry for jumping it
but - its not working for me
I did like you said but I get no mail
when I press test on the Dude , i can see O.K at the line
this is a capture of the CMD

maybe need to change the SMTPServer?

hipe you can help me
Thanks ,
Capture.PNG
You do not have the required permissions to view the files attached to this post.
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification throughout Gmail on Windows machine

Mon Jun 25, 2012 5:01 pm

sorry for jumping it
but - its not working for me
I did like you said but I get no mail
when I press test on the Dude , i can see O.K at the line
this is a capture of the CMD

maybe need to change the SMTPServer?

hipe you can help me
Thanks ,
Capture.PNG
Nope, the smtp server is correct (localhost), the error is in the subject line as suggested by Blat. Did you check that you added enough quotes in the command part in the notification?:
C:\blat\emailblat.cmd "Monitor: [Device.NetMaps] map - [Device.Name] probe [Probe.Name] is now [Service.Status]" "Hi there!||This is TheDude from the monitoring server reporting:||at: [TimeAndDate]|on map: [Device.NetMaps]|Device: [Device.Name]|Probe: [Probe.Name]|Status: [Service.Status]|Problem Description: [Service.ProblemDescription]|Changed since: [Service.TimeSinceChanged]|Last time up: [Service.TimeLastUp]"
 
David1234
Forum Guru
Forum Guru
Posts: 1266
Joined: Sun Sep 18, 2011 7:00 pm

Re: Email notification throughout Gmail on Windows machine

Mon Jun 25, 2012 5:07 pm

what do you mean?
all I did is add new notification in the Dude
like so:
"c:\Program Files\Dude\blat\emailblat.cmd" "Service [Probe.Name] on [Device.Name] is now [Service.Status]" "Service [Probe.Name] on [Device.Name] is now [Service.Status] ([Service.ProblemDescription])"

when I run the command you wrote
I get SNMP error

thanks,
Capture.PNG
You do not have the required permissions to view the files attached to this post.
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification throughout Gmail on Windows machine

Mon Jun 25, 2012 5:19 pm

what do you mean?
all I did is add new notification in the Dude
like so:
"c:\Program Files\Dude\blat\emailblat.cmd" "Service [Probe.Name] on [Device.Name] is now [Service.Status]" "Service [Probe.Name] on [Device.Name] is now [Service.Status] ([Service.ProblemDescription])"

when I run the command you wrote
I get SNMP error

thanks,
Capture.PNG
The command is for the notification command field in the Dude. The one you provide is correct. So the problem is not in The Dude, but in a part of the script. Did you use my version that is in this post?: http://forum.mikrotik.com/viewtopic.php ... 68#p280481

With the suggested version of the cmd script you can test it by starting a command prompt, going to the dir where you installed the script and running
emailblad.cmd "This is my subject" "This is my mail body."
Please post the output of the above action for further troubleshooting...
 
David1234
Forum Guru
Forum Guru
Posts: 1266
Joined: Sun Sep 18, 2011 7:00 pm

Re: Email notification throughout Gmail on Windows machine

Mon Jun 25, 2012 5:32 pm

change the file like you told me
but still didn't get an E-mail

this is the output:
You do not have the required permissions to view the files attached to this post.
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification throughout Gmail on Windows machine

Mon Jun 25, 2012 6:18 pm

change the file like you told me
but still didn't get an E-mail

this is the output:
We'll take it step by step. First off I see that you have a different datetime format and use long paths. Lets first adjust the logging of the output to that. Change this line in the script:
set logname=%dir%\blat-%date%.log
To this:
set logname=%dir%\blat.log
Next up create a dir in the root named blat. Then change
set dir=C:\Program Files\Dude\blat
to
set dir=C:\blat
The logname that was generated automatically is killing the blat command line in the script. Please let me know the outcome after the adjustments...
 
David1234
Forum Guru
Forum Guru
Posts: 1266
Joined: Sun Sep 18, 2011 7:00 pm

Re: Email notification throughout Gmail on Windows machine

Tue Jun 26, 2012 9:28 am

did it.
now I get no error in the CMD ,
but this is the LOG that created :
======================  9:22:09.90 ====================== 
CMD: blat.exe -to korentesting@gmail.com -f korentesting@gmail.com -server 127.0.0.1 -port 465 -u korentesting -pw ****** -subject "This is my subject" -body "This is my mail body." 
Blat v3.0.5 (build : Jun 15 2012 22:49:20)
32-bit Windows, Full, Unicode

Error: Wait a bit (possible timeout).
*** Error ***  SMTP server error
Error: Not a socket.
Error: Not a socket.
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification throughout Gmail on Windows machine

Tue Jun 26, 2012 10:34 am

did it.
now I get no error in the CMD ,
but this is the LOG that created :
======================  9:22:09.90 ====================== 
CMD: blat.exe -to korentesting@gmail.com -f korentesting@gmail.com -server 127.0.0.1 -port 465 -u korentesting -pw ****** -subject "This is my subject" -body "This is my mail body." 
Blat v3.0.5 (build : Jun 15 2012 22:49:20)
32-bit Windows, Full, Unicode

Error: Wait a bit (possible timeout).
*** Error ***  SMTP server error
Error: Not a socket.
Error: Not a socket.
Nice! The script is no longer the problem. Now we have to fix the Stunnel. That is the remaining problem. Did you install the Stunnel service as described in these steps?: http://forum.mikrotik.com/viewtopic.php ... 68#p155084
 
David1234
Forum Guru
Forum Guru
Posts: 1266
Joined: Sun Sep 18, 2011 7:00 pm

Re: Email notification throughout Gmail on Windows machine

Tue Jun 26, 2012 10:45 am

yes
this is the file:
; Sample stunnel configuration file for Win32 by Michal Trojnara 2002-2012
; Some options used here may be inadequate for your particular configuration
; This sample file does *not* represent stunnel.conf defaults
; Please consult the manual for detailed description of available options

; **************************************************************************
; * Global options *
; **************************************************************************

; Debugging stuff (may useful for troubleshooting)
;debug = 7
;output = stunnel.log

; Disable FIPS mode to allow non-approved protocols and algorithms
;fips = no

; **************************************************************************
; * Service defaults may also be specified in individual service sections *
; **************************************************************************

; Certificate/key is needed in server mode and optional in client mode
cert = stunnel.pem
;key = stunnel.pem

; Authentication stuff needs to be configured to prevent MITM attacks
; It is not enabled by default!
;verify = 2
; Don't forget to c_rehash CApath
;CApath = certs
; It's often easier to use CAfile
;CAfile = certs.pem
; Don't forget to c_rehash CRLpath
;CRLpath = crls
; Alternatively CRLfile can be used
;CRLfile = crls.pem

; Disable support for insecure SSLv2 protocol
options = NO_SSLv2
; Workaround for Eudora bug
;options = DONT_INSERT_EMPTY_FRAGMENTS

; These options provide additional security at some performance degradation
;options = SINGLE_ECDH_USE
;options = SINGLE_DH_USE

; **************************************************************************
; * Service definitions (at least one service has to be defined) *
; **************************************************************************

; Example SSL server mode services

[pop3s]
accept = 995
connect = pop.gmail.com:995

[imaps]
accept = 993
connect = 143

[ssmtp]
accept = 465
connect = smtp.gmail.com:465

; Example SSL client mode services

;[gmail-pop3]
;client = yes
;accept = 127.0.0.1:110
;connect = pop.gmail.com:995

;[gmail-imap]
;client = yes
;accept = 127.0.0.1:143
;connect = imap.gmail.com:993

;[gmail-smtp]
;client = yes
;accept = 127.0.0.1:25
;connect = smtp.gmail.com:465

; Example SSL front-end to a web server

;[https]
;accept = 443
;connect = 80
; "TIMEOUTclose = 0" is a workaround for a design flaw in Microsoft SSL
; Microsoft implementations do not use SSL close-notify alert and thus
; they are vulnerable to truncation attacks
;TIMEOUTclose = 0

; vim:ft=dosini
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification throughout Gmail on Windows machine

Tue Jun 26, 2012 10:49 am

yes
this is the file:
; Sample stunnel configuration file for Win32 by Michal Trojnara 2002-2012
; Some options used here may be inadequate for your particular configuration
; This sample file does *not* represent stunnel.conf defaults
; Please consult the manual for detailed description of available options

; **************************************************************************
; * Global options *
; **************************************************************************

; Debugging stuff (may useful for troubleshooting)
;debug = 7
;output = stunnel.log

; Disable FIPS mode to allow non-approved protocols and algorithms
;fips = no

; **************************************************************************
; * Service defaults may also be specified in individual service sections *
; **************************************************************************

; Certificate/key is needed in server mode and optional in client mode
cert = stunnel.pem
;key = stunnel.pem

; Authentication stuff needs to be configured to prevent MITM attacks
; It is not enabled by default!
;verify = 2
; Don't forget to c_rehash CApath
;CApath = certs
; It's often easier to use CAfile
;CAfile = certs.pem
; Don't forget to c_rehash CRLpath
;CRLpath = crls
; Alternatively CRLfile can be used
;CRLfile = crls.pem

; Disable support for insecure SSLv2 protocol
options = NO_SSLv2
; Workaround for Eudora bug
;options = DONT_INSERT_EMPTY_FRAGMENTS

; These options provide additional security at some performance degradation
;options = SINGLE_ECDH_USE
;options = SINGLE_DH_USE

; **************************************************************************
; * Service definitions (at least one service has to be defined) *
; **************************************************************************

; Example SSL server mode services

[pop3s]
accept = 995
connect = pop.gmail.com:995

[imaps]
accept = 993
connect = 143

[ssmtp]
accept = 465
connect = smtp.gmail.com:465

; Example SSL client mode services

;[gmail-pop3]
;client = yes
;accept = 127.0.0.1:110
;connect = pop.gmail.com:995

;[gmail-imap]
;client = yes
;accept = 127.0.0.1:143
;connect = imap.gmail.com:993

;[gmail-smtp]
;client = yes
;accept = 127.0.0.1:25
;connect = smtp.gmail.com:465

; Example SSL front-end to a web server

;[https]
;accept = 443
;connect = 80
; "TIMEOUTclose = 0" is a workaround for a design flaw in Microsoft SSL
; Microsoft implementations do not use SSL close-notify alert and thus
; they are vulnerable to truncation attacks
;TIMEOUTclose = 0

; vim:ft=dosini

When you try this in a dos box, do you get a reply?:
telnet localhost 465
 
David1234
Forum Guru
Forum Guru
Posts: 1266
Joined: Sun Sep 18, 2011 7:00 pm

Re: Email notification throughout Gmail on Windows machine

Tue Jun 26, 2012 10:58 am

yes
"connecting to localhost"....
and then _____
so it's working.

maybe this will help you help me:
the ip is 10.0.0.222
gateway 10.0.0.2 (this is a RB411 that connect to the Internet using SIM )
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification throughout Gmail on Windows machine

Tue Jun 26, 2012 11:17 am

yes
"connecting to localhost"....
and then _____
so it's working.

maybe this will help you help me:
the ip is 10.0.0.222
gateway 10.0.0.2 (this is a RB411 that connect to the Internet using SIM )
Type of connection should not matter. Reply after connecting should be something like this:
220 mx.google.com ESMTP o16sm146312251eeb.13
Where did you install the stunnel service? The reference in this thread is for Windows only, not an RB.
 
David1234
Forum Guru
Forum Guru
Posts: 1266
Joined: Sun Sep 18, 2011 7:00 pm

Re: Email notification throughout Gmail on Windows machine

Tue Jun 26, 2012 11:34 am

I have install the stunnel service on the computer with the Dude (WIN7)

and where do I need to get this line?
220 mx.google.com ESMTP o16sm146312251eeb.13
after I write this command:
telnet localhost 465

?
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification throughout Gmail on Windows machine

Tue Jun 26, 2012 12:09 pm

I have install the stunnel service on the computer with the Dude (WIN7)

and where do I need to get this line?
220 mx.google.com ESMTP o16sm146312251eeb.13
after I write this command:
telnet localhost 465

?
That is correct, after the telnet command you should get the reply.

To make life a little more easier in this troubleshoot, please install Grep for Windows from this link:
http://downloads.sourceforge.net/gnuwin ... -setup.exe

Next off, lets check if the stunnel service listens on the 465 port. I'm assuming that you have a 64 bits installation of Windows 7. (if not, replace %ProgramFiles(x86)% with %ProgramFiles%)
In a command prompt execute this command:
cd %ProgramFiles(x86)%\GnuWin32\bin
netstat -ano -b|grep 465
Results should look like this (last number can be different):
  TCP    0.0.0.0:465            0.0.0.0:0              LISTENING       1568
The last number refers to the PID of the program listening on this port. Start the task manager. Make sure the PID column is visible, if not enable it through the view menu. Sort on the PID column and look up the PID we found in the command prompt. In my case it looks like this:
ScreenShot382.jpg
If you see another image name in that place, then that service or program is blocking stunnel. Please let me know if yours looks the same..
You do not have the required permissions to view the files attached to this post.
 
David1234
Forum Guru
Forum Guru
Posts: 1266
Joined: Sun Sep 18, 2011 7:00 pm

Re: Email notification throughout Gmail on Windows machine

Tue Jun 26, 2012 3:21 pm

I don't have it on the service , so I don't see any PIM
(I have 32bit)
this is what I get:
You do not have the required permissions to view the files attached to this post.
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification throughout Gmail on Windows machine

Tue Jun 26, 2012 3:27 pm

I don't have it on the service , so I don't see any PIM
(I have 32bit)
this is what I get:
In the task manager, please go to the view menu and click Select Columns. There check the box before PID (Process Identifier) and click ok. Now you can see the PID and compare it to the PID found in the netstat command. In your screenshot it's not visible so we cannot determine if the correct application is listening on 465..
 
David1234
Forum Guru
Forum Guru
Posts: 1266
Joined: Sun Sep 18, 2011 7:00 pm

Re: Email notification throughout Gmail on Windows machine

Tue Jun 26, 2012 3:35 pm

o.k.
didnt know that .
its getting 5844
You do not have the required permissions to view the files attached to this post.
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification throughout Gmail on Windows machine

Tue Jun 26, 2012 3:49 pm

o.k.
didnt know that .
its getting 5844
Ok, we can now say that the service is running as it should and we can move up a step further on the ladder.

Can you please try this in a dos box?:
telnet smtp.gmail.com 465
you should get something like this:
220 mx.google.com ESMTP o16sm146312251eeb.13
If you do get the above reply on the telnet, then I think your firewall application on the machine is blocking the stunnel service. If you not get the above (or equal) reply then your internet connection blocks connecting to the Google mail server.
 
David1234
Forum Guru
Forum Guru
Posts: 1266
Joined: Sun Sep 18, 2011 7:00 pm

Re: Email notification throughout Gmail on Windows machine

Tue Jun 26, 2012 3:55 pm

no.
all I get is a blinking _

and after a while it's return to c:>
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification throughout Gmail on Windows machine

Tue Jun 26, 2012 4:00 pm

no.
all I get is a blinking _

and after a while it's return to c:>
I believe you are using internet on a SIM card? My conclusion would be that your internet provider is blocking this port. Any way to test it on another internet connection?
 
David1234
Forum Guru
Forum Guru
Posts: 1266
Joined: Sun Sep 18, 2011 7:00 pm

Re: Email notification throughout Gmail on Windows machine

Tue Jun 26, 2012 4:19 pm

I try it now - still no good
I get the same blinking _
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification throughout Gmail on Windows machine

Tue Jun 26, 2012 4:58 pm

I try it now - still no good
I get the same blinking _
Hmmm, I'm out of ideas right now. When I think of something, I'll post it here. Sorry!
 
iberfi
just joined
Posts: 8
Joined: Tue Jul 17, 2012 9:20 pm

Re: Email notification throughout Gmail on Windows machine

Wed Jul 18, 2012 1:38 pm

Hi there,

Have followed all instructions and stunnel / blat are working - I can send a command line email, BUT from the test button in Dude, I do not get any information just your titles of the fields. Can you please tell me how to get dude to send the information.

Thanks - really great post
Hello,

I use
C:\blat\emailblat.cmd "Monitor: [Device.NetMaps] map - [Device.Name] probe [Probe.Name] is now [Service.Status]" "Hi there!||This is TheDude from the monitoring server reporting:||at: [TimeAndDate]|on map: [Device.NetMaps]|Device: [Device.Name]|Probe: [Probe.Name]|Status: [Service.Status]|Problem Description: [Service.ProblemDescription]|Changed since: [Service.TimeSinceChanged]|Last time up: [Service.TimeLastUp]"
I set it to execute on the server, and changed the service account of the Dude service to the local administrator.
FYI the || in the code above inserts a newline/enter in the email message.

My emailblat.cmd is:
rem @echo off

set dir=c:\blat
set logname=%dir%\blat-%date%.log
set smtpsender=senderadress@gmail.com
set smtpserver=127.0.0.1
set smtpport=465
set smtpuser=senderadress@gmail.com
set smtppwd=MyGmailPassword
set mailto=receiveradress@domain.com
set subject=%1
set body=%2

IF NOT EXIST %logname% echo ====================== Start of file ====================== > %logname%
echo. >> %logname%
echo ====================== %time% ====================== >> %logname%

C:
CD %dir%
echo CMD: blat.exe -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject %subject% -body %body% >> %logname%
blat.exe -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject %subject% -body %body% >> %logname%
Of course you have to change the sender and receiver address and the password. This version of emailblat.cmd also creates a log per day for all actions so you can better troubleshoot in the case of problems. Hope this helps you!

Regards, Roland
 
iberfi
just joined
Posts: 8
Joined: Tue Jul 17, 2012 9:20 pm

Re: Email notification throughout Gmail on Windows machine

Fri Jul 20, 2012 12:50 pm

Roland,

Many thanks - I have used your exact notification and blat file setups and all now works really well.

My problem was a misconfiguration in the stunnel config file.

Thanks
 
iberfi
just joined
Posts: 8
Joined: Tue Jul 17, 2012 9:20 pm

Re: Email notification throughout Gmail on Windows machine

Fri Jul 20, 2012 4:07 pm

Sorry another quick question.

Is there an additional command line I can add to the emailblat.cmd file so that it runs withour popping up the dos command window.

Thanks
 
slech
Long time Member
Long time Member
Topic Author
Posts: 533
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Email notification throughout Gmail on Windows machine

Fri Jul 20, 2012 8:25 pm

Dude start-up mode is "Start as service" or "All Time" ?
As service it will be started from another user(system) and you shouldn't see any cmd windows.
Sorry another quick question.

Is there an additional command line I can add to the emailblat.cmd file so that it runs withour popping up the dos command window.

Thanks
sorry for my english
 
TheAngryPenguin
just joined
Posts: 1
Joined: Fri Jan 18, 2013 9:47 am

Re: Email notification throughout Gmail on Windows machine

Fri Jan 18, 2013 10:23 am

Just in case anyone else is still interested in using Gmail for notifications and doesn't want to install/use stunnel, here's a quick hotwo...
  1. Grab MailWrench from here (it's free).
  2. Extract mailwrench.exe to your Dude installation directory.
  3. Create mailwrench.cfg in your Dude installation directory:
    -from "From Display Name <your.account@yourdomain.com>"
    -id your.account@yourdomain.com
    -password yourpassword
  4. Create mailwrench.cmd in you Dude installation directory:
    set dir=C:\TheDude
    set smtpserver=smtp.gmail.com
    set smtpport=587
    set mailto="To Display Name <someone@somewhere.com>"
    ::
    %dir%\mailwrench.exe -to %mailto% @%dir%\mailwrench.cfg -s %1 -msg %2 -ssl -smtp %smtpserver% -port %smtpport%
    
  5. Create a new notification in TheDude:
    Type: execute on server
    Command: C:\TheDude\mailwrench.cmd "[Device.Name] probe [Probe.Name] is now [Service.Status]" "Service [Probe.Name] on [Device.Name] is now [Service.Status] ([Service.ProblemDescription])"
Hope this helps!
 
staticjess
newbie
Posts: 39
Joined: Tue Sep 27, 2011 9:21 pm

Re: Email notification throughout Gmail on Windows machine

Thu May 02, 2013 12:45 pm

I don't know if its just me but I have tried slech and roland's examples but they only work by clicking the "Test" button in the notifications. Is there a way to make this work in real time? I already have an existing network and even if I disconnect one connection deliberately no email is sent to the supposed recipient.

Any ideas?
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification throughout Gmail on Windows machine

Thu May 02, 2013 12:50 pm

I don't know if its just me but I have tried slech and roland's examples but they only work by clicking the "Test" button in the notifications. Is there a way to make this work in real time? I already have an existing network and even if I disconnect one connection deliberately no email is sent to the supposed recipient.

Any ideas?
Hi! Is The Dude running as a service? And is it running on a local admin account?
 
staticjess
newbie
Posts: 39
Joined: Tue Sep 27, 2011 9:21 pm

Re: Email notification throughout Gmail on Windows machine

Thu May 02, 2013 1:00 pm

Hi Roland,
Thanks for the reply. I actually played around a little bit and I forgot to enable the notification in the Network Map area. Your example actually suits best in our current set-up. Thanks for sharing it with us.

Regards,
StaticJess
 
vladimirpetrov
just joined
Posts: 8
Joined: Mon Jan 06, 2014 8:21 pm

Re: Email notification throughout Gmail on Windows machine

Mon Jan 06, 2014 8:38 pm

Hi, i'm new to the dude, i checked out some topics about how to setup dude notification +gmail account. Also followed the manual in this topic but no result.
1. checked out every installation path and gmail details in the conf files of stunnel and emailblat.cmd
2. double check dude notification settings
3. make tests from cmd telnet smtp.gmail.com 465
4. ports from my ISP are not closed
5. some tests with stopped AV and firewall but no result

Can anyone help a bit, please. A heve no more suggestions

that's part of my log from stunel
2014.01.06 19:20:37 LOG7[2560:2804]: Service [ssmtp] accepted (FD=240) from 127.0.0.1:49994
2014.01.06 19:20:37 LOG7[2560:2804]: Creating a new thread
2014.01.06 19:20:37 LOG7[2560:2804]: New thread created
2014.01.06 19:20:37 LOG7[2560:4980]: Service [ssmtp] started
2014.01.06 19:20:37 LOG5[2560:4980]: Service [ssmtp] accepted connection from 127.0.0.1:49994
2014.01.06 19:20:37 LOG6[2560:4980]: connect_blocking: connecting 173.194.70.109:465
2014.01.06 19:20:37 LOG7[2560:4980]: connect_blocking: s_poll_wait 173.194.70.109:465: waiting 10 seconds
2014.01.06 19:20:37 LOG5[2560:4980]: connect_blocking: connected 173.194.70.109:465
2014.01.06 19:20:37 LOG5[2560:4980]: Service [ssmtp] connected remote server from 192.168.1.104:49995
2014.01.06 19:20:37 LOG7[2560:4980]: Remote socket (FD=432) initialized
2014.01.06 19:20:37 LOG7[2560:4980]: SNI: sending servername: smtp.gmail.com
2014.01.06 19:20:37 LOG7[2560:4980]: SSL state (connect): before/connect initialization
2014.01.06 19:20:37 LOG7[2560:4980]: SSL state (connect): SSLv3 write client hello A
2014.01.06 19:20:37 LOG7[2560:4980]: SSL state (connect): SSLv3 read server hello A
2014.01.06 19:20:37 LOG7[2560:4980]: SSL state (connect): SSLv3 read finished A
2014.01.06 19:20:37 LOG7[2560:4980]: SSL state (connect): SSLv3 write change cipher spec A
2014.01.06 19:20:37 LOG7[2560:4980]: SSL state (connect): SSLv3 write finished A
2014.01.06 19:20:37 LOG7[2560:4980]: SSL state (connect): SSLv3 flush data
2014.01.06 19:20:37 LOG7[2560:4980]:    1 items in the session cache
2014.01.06 19:20:37 LOG7[2560:4980]:   17 client connects (SSL_connect())
2014.01.06 19:20:37 LOG7[2560:4980]:   17 client connects that finished
2014.01.06 19:20:37 LOG7[2560:4980]:    0 client renegotiations requested
2014.01.06 19:20:37 LOG7[2560:4980]:    0 server connects (SSL_accept())
2014.01.06 19:20:37 LOG7[2560:4980]:    0 server connects that finished
2014.01.06 19:20:37 LOG7[2560:4980]:    0 server renegotiations requested
2014.01.06 19:20:37 LOG7[2560:4980]:   16 session cache hits
2014.01.06 19:20:37 LOG7[2560:4980]:    0 external session cache hits
2014.01.06 19:20:37 LOG7[2560:4980]:    0 session cache misses
2014.01.06 19:20:37 LOG7[2560:4980]:    0 session cache timeouts
2014.01.06 19:20:37 LOG6[2560:4980]: SSL connected: previous session reused
2014.01.06 19:20:37 LOG6[2560:4980]: SSL socket closed (SSL_read)
2014.01.06 19:20:37 LOG7[2560:4980]: Sent socket write shutdown
2014.01.06 19:20:37 LOG5[2560:4980]: Connection closed: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
2014.01.06 19:20:37 LOG7[2560:4980]: Remote socket (FD=432) closed
2014.01.06 19:20:37 LOG7[2560:4980]: Local socket (FD=240) closed
2014.01.06 19:20:37 LOG7[2560:4980]: Service [ssmtp] finished (0 left)
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification throughout Gmail on Windows machine

Wed Jan 08, 2014 2:46 pm

Hi, i'm new to the dude, i checked out some topics about how to setup dude notification +gmail account. Also followed the manual in this topic but no result.
1. checked out every installation path and gmail details in the conf files of stunnel and emailblat.cmd
2. double check dude notification settings
3. make tests from cmd telnet smtp.gmail.com 465
4. ports from my ISP are not closed
5. some tests with stopped AV and firewall but no result

Can anyone help a bit, please. A heve no more suggestions

that's part of my log from stunel
2014.01.06 19:20:37 LOG7[2560:2804]: Service [ssmtp] accepted (FD=240) from 127.0.0.1:49994
2014.01.06 19:20:37 LOG7[2560:2804]: Creating a new thread
2014.01.06 19:20:37 LOG7[2560:2804]: New thread created
2014.01.06 19:20:37 LOG7[2560:4980]: Service [ssmtp] started
2014.01.06 19:20:37 LOG5[2560:4980]: Service [ssmtp] accepted connection from 127.0.0.1:49994
2014.01.06 19:20:37 LOG6[2560:4980]: connect_blocking: connecting 173.194.70.109:465
2014.01.06 19:20:37 LOG7[2560:4980]: connect_blocking: s_poll_wait 173.194.70.109:465: waiting 10 seconds
2014.01.06 19:20:37 LOG5[2560:4980]: connect_blocking: connected 173.194.70.109:465
2014.01.06 19:20:37 LOG5[2560:4980]: Service [ssmtp] connected remote server from 192.168.1.104:49995
2014.01.06 19:20:37 LOG7[2560:4980]: Remote socket (FD=432) initialized
2014.01.06 19:20:37 LOG7[2560:4980]: SNI: sending servername: smtp.gmail.com
2014.01.06 19:20:37 LOG7[2560:4980]: SSL state (connect): before/connect initialization
2014.01.06 19:20:37 LOG7[2560:4980]: SSL state (connect): SSLv3 write client hello A
2014.01.06 19:20:37 LOG7[2560:4980]: SSL state (connect): SSLv3 read server hello A
2014.01.06 19:20:37 LOG7[2560:4980]: SSL state (connect): SSLv3 read finished A
2014.01.06 19:20:37 LOG7[2560:4980]: SSL state (connect): SSLv3 write change cipher spec A
2014.01.06 19:20:37 LOG7[2560:4980]: SSL state (connect): SSLv3 write finished A
2014.01.06 19:20:37 LOG7[2560:4980]: SSL state (connect): SSLv3 flush data
2014.01.06 19:20:37 LOG7[2560:4980]:    1 items in the session cache
2014.01.06 19:20:37 LOG7[2560:4980]:   17 client connects (SSL_connect())
2014.01.06 19:20:37 LOG7[2560:4980]:   17 client connects that finished
2014.01.06 19:20:37 LOG7[2560:4980]:    0 client renegotiations requested
2014.01.06 19:20:37 LOG7[2560:4980]:    0 server connects (SSL_accept())
2014.01.06 19:20:37 LOG7[2560:4980]:    0 server connects that finished
2014.01.06 19:20:37 LOG7[2560:4980]:    0 server renegotiations requested
2014.01.06 19:20:37 LOG7[2560:4980]:   16 session cache hits
2014.01.06 19:20:37 LOG7[2560:4980]:    0 external session cache hits
2014.01.06 19:20:37 LOG7[2560:4980]:    0 session cache misses
2014.01.06 19:20:37 LOG7[2560:4980]:    0 session cache timeouts
2014.01.06 19:20:37 LOG6[2560:4980]: SSL connected: previous session reused
2014.01.06 19:20:37 LOG6[2560:4980]: SSL socket closed (SSL_read)
2014.01.06 19:20:37 LOG7[2560:4980]: Sent socket write shutdown
2014.01.06 19:20:37 LOG5[2560:4980]: Connection closed: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
2014.01.06 19:20:37 LOG7[2560:4980]: Remote socket (FD=432) closed
2014.01.06 19:20:37 LOG7[2560:4980]: Local socket (FD=240) closed
2014.01.06 19:20:37 LOG7[2560:4980]: Service [ssmtp] finished (0 left)
can you post your blat cmd/bat file? If you used the one I suggested, this also generates a log file. Please post that too...

Regards, Roland
 
vladimirpetrov
just joined
Posts: 8
Joined: Mon Jan 06, 2014 8:21 pm

Re: Email notification throughout Gmail on Windows machine

Wed Jan 08, 2014 8:35 pm

that is my emailblat.cmd i don`t have a log file in my blat dir
set dir=c:\Dude\blat
set smtpsender=systemnotification@gmail.com
set smtpserver=127.0.0.1
set smtpport=465
set smtpuser=systemnotification
set smtppwd=/mypassword/
set mailto=thenightraven@gmail.com

"%dir%\blat.exe" -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject %1 -body %2
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification throughout Gmail on Windows machine

Thu Jan 09, 2014 12:49 pm

that is my emailblat.cmd i don`t have a log file in my blat dir
set dir=c:\Dude\blat
set smtpsender=systemnotification@gmail.com
set smtpserver=127.0.0.1
set smtpport=465
set smtpuser=systemnotification
set smtppwd=/mypassword/
set mailto=thenightraven@gmail.com

"%dir%\blat.exe" -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject %1 -body %2
The smtpuser should be the full email address from the gmail account (and the smtppwd the corresponding password).

if you add
 >> blat.log
to the last line it will generate a log file from the command.
 
vladimirpetrov
just joined
Posts: 8
Joined: Mon Jan 06, 2014 8:21 pm

Re: Email notification throughout Gmail on Windows machine

Fri Jan 10, 2014 9:06 pm

I corrected the smtpuser to the full mail address as you advice and i where is /mypassword/ i typed my real password for the account, but no result. When i hit TEST button on my notification it says OK, but i'm not receiving anything in gmail account inbox
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification throughout Gmail on Windows machine

Sat Jan 11, 2014 10:51 am

I corrected the smtpuser to the full mail address as you advice and i where is /mypassword/ i typed my real password for the account, but no result. When i hit TEST button on my notification it says OK, but i'm not receiving anything in gmail account inbox
Can you please replace this line
"%dir%\blat.exe" -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject %1 -body %2
with this?
"%dir%\blat.exe" -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject %1 -body %2 >> blat.log
I would love to see the resulting blat.log file, because I think it will contain crucual info on the problem...
 
vladimirpetrov
just joined
Posts: 8
Joined: Mon Jan 06, 2014 8:21 pm

Re: Email notification throughout Gmail on Windows machine

Sat Jan 11, 2014 2:28 pm

I did it exactly as you tell me but the blat.log file is not generated after i made tests with the notification, even tried with the new beta of dude v.4.0 same result
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification throughout Gmail on Windows machine

Sat Jan 11, 2014 9:15 pm

I did it exactly as you tell me but the blat.log file is not generated after i made tests with the notification, even tried with the new beta of dude v.4.0 same result
Sorry, my bad, the file is probally in The Dude's installation directory, because that is used as the start directory when the notification is triggered.

You can either do a search of the disk for the file or change the line to:
"%dir%\blat.exe" -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject %1 -body %2 >> "%dir%\blat.log"
 
vladimirpetrov
just joined
Posts: 8
Joined: Mon Jan 06, 2014 8:21 pm

Re: Email notification throughout Gmail on Windows machine

Sun Jan 12, 2014 2:41 pm

I did not find bloat.log file anywhere so i replaced the last line with yours, so the file is generated now
Sending stdin.txt to thenightraven@gmail.com
Subject: Service [Probe.Name] on [Device.Name] is now [Service.Status]
Login name is systemnotification@gmail.com
The SMTP server did not accept Auth PLAIN value.
Are your login userid and password correct?
The SMTP server did not accept Auth LOGIN PASSWD value.
I tried with changing my password 2 times with different symbols, 1 time even only numeric but same result.
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification throughout Gmail on Windows machine

Mon Jan 13, 2014 10:35 am

I did not find bloat.log file anywhere so i replaced the last line with yours, so the file is generated now
Sending stdin.txt to thenightraven@gmail.com
Subject: Service [Probe.Name] on [Device.Name] is now [Service.Status]
Login name is systemnotification@gmail.com
The SMTP server did not accept Auth PLAIN value.
Are your login userid and password correct?
The SMTP server did not accept Auth LOGIN PASSWD value.
I tried with changing my password 2 times with different symbols, 1 time even only numeric but same result.
I think there is another problem than the password. The log gives: The SMTP server did not accept Auth PLAIN value. This means that the server (Google) is not accepting the way that the authentication is done. Is the emailadress systemnotification@gmail.com a real emailadress that you hold?
 
vladimirpetrov
just joined
Posts: 8
Joined: Mon Jan 06, 2014 8:21 pm

Re: Email notification throughout Gmail on Windows machine

Mon Jan 13, 2014 11:14 am

Yes, systemnotification@gmail.com is a real account i created last week, i tested it and it sends/receives from/to other mails normally no problem
 
vladimirpetrov
just joined
Posts: 8
Joined: Mon Jan 06, 2014 8:21 pm

Re: Email notification throughout Gmail on Windows machine

Mon Jan 20, 2014 2:38 pm

i think the problem is somewhere else not in mail because i tried with different email, but still not working
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification throughout Gmail on Windows machine

Tue Jan 21, 2014 3:35 pm

i think the problem is somewhere else not in mail because i tried with different email, but still not working
I found someone with a similar problem:

https://groups.google.com/forum/#!topic ... E_ogHMP72k

When you enter a wrong password a few times, the account is sort of locked out and will ask you to fill in a capatcha code at the next login by web. Please try to login through web and see if you have the same problem, then try again using the correct credentials. Hope this helps!
 
vladimirpetrov
just joined
Posts: 8
Joined: Mon Jan 06, 2014 8:21 pm

Re: Email notification throughout Gmail on Windows machine

Fri Jan 24, 2014 9:15 am

I tried this yesterday and logged in normally - no capatcha codes required, just the username(which is mail address ) and password. I'm going to test with another mail today - maybe hotmail and see the result. Thanks very much for the help
 
mikmik
just joined
Posts: 1
Joined: Mon Nov 18, 2013 10:43 am

Re: Email notification throughout Gmail on Windows machine

Thu Jan 30, 2014 3:24 pm

Thanx, it is working :).
 
letthiswork1
just joined
Posts: 14
Joined: Tue Feb 11, 2014 5:47 am

Re: Email notification throughout Gmail on Windows machine

Tue Feb 11, 2014 5:52 am

Hi Guys,

New here aswell.

I have followed all the steps but for some reason my telnet session doesn't open.

When i telnet to localhost 465 or 995 cmd closes and opens another window with no ack.
When i check the logs of stunnel it accepts the connection but nothing seems to happen.

cmd telnet localhost 465

The stunnel log can see i am connecting
2014.02.11 14:50:41 LOG5[3900:2236]: Service [pop3s] accepted connection from 127.0.0.1:52362

I have made sure stunnel is open in the firewall.

sTUNNEL CONF
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
debug = 7
output = stunnel.log

client = yes

[pop3s]
accept = 995
connect = pop.gmail.com:995

[ssmtp]
accept = 465
connect = smtp.gmail.com:465

Thanks!
 
letthiswork1
just joined
Posts: 14
Joined: Tue Feb 11, 2014 5:47 am

Re: Email notification throughout Gmail on Windows machine

Tue Feb 11, 2014 9:08 am

Hi Guys,

New here aswell.

I have followed all the steps but for some reason my telnet session doesn't open.

When i telnet to localhost 465 or 995 cmd closes and opens another window with no ack.
When i check the logs of stunnel it accepts the connection but nothing seems to happen.

cmd telnet localhost 465

The stunnel log can see i am connecting
2014.02.11 14:50:41 LOG5[3900:2236]: Service [pop3s] accepted connection from 127.0.0.1:52362

I have made sure stunnel is open in the firewall.

sTUNNEL CONF
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
debug = 7
output = stunnel.log

client = yes

[pop3s]
accept = 995
connect = pop.gmail.com:995

[ssmtp]
accept = 465
connect = smtp.gmail.com:465

Thanks!
All good sorted it out :) stunnel conf was named. "stunnel":conf.conf." thanks!
 
David1234
Forum Guru
Forum Guru
Posts: 1266
Joined: Sun Sep 18, 2011 7:00 pm

Re: Email notification throughout Gmail on Windows machine

Tue Feb 18, 2014 2:11 pm

Hello (again0
this is all the configuration I have - but still doesn't work for me

this is the stunnel.conf
; Sample stunnel configuration file for Win32 by Michal Trojnara 2002-2012
; Some options used here may be inadequate for your particular configuration
; This sample file does *not* represent stunnel.conf defaults
; Please consult the manual for detailed description of available options

; **************************************************************************
; * Global options *
; **************************************************************************

; Debugging stuff (may useful for troubleshooting)
;debug = 7
;output = stunnel.log

; Disable FIPS mode to allow non-approved protocols and algorithms
;fips = no

; **************************************************************************
; * Service defaults may also be specified in individual service sections *
; **************************************************************************

; Certificate/key is needed in server mode and optional in client mode
cert = stunnel.pem
;key = stunnel.pem

; Authentication stuff needs to be configured to prevent MITM attacks
; It is not enabled by default!
;verify = 2
; Don't forget to c_rehash CApath
;CApath = certs
; It's often easier to use CAfile
;CAfile = certs.pem
; Don't forget to c_rehash CRLpath
;CRLpath = crls
; Alternatively CRLfile can be used
;CRLfile = crls.pem

; Disable support for insecure SSLv2 protocol
options = NO_SSLv2
; Workaround for Eudora bug
;options = DONT_INSERT_EMPTY_FRAGMENTS

; These options provide additional security at some performance degradation
;options = SINGLE_ECDH_USE
;options = SINGLE_DH_USE

; **************************************************************************
; * Service definitions (at least one service has to be defined) *
; **************************************************************************

; Example SSL server mode services
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
debug = 7
output = stunnel.log

client = yes

[pop3s]
accept = 995
connect = pop.gmail.com:995

[ssmtp]
accept = 465
connect = smtp.gmail.com:465
this is the emailblat.cmd
set dir=C:\Program Files\Dude\blat
set smtpsender=testing@gmail.com
set smtpserver=127.0.0.1
set smtpport=465
set smtpuser=testing
set smtppwd=1234567
set mailto=testing@gmail.com

"%dir%\blat.exe" -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject %1 -body %2

IF NOT EXIST %logname% echo ====================== Start of file ====================== > %logname%
echo. >> %logname%
echo ====================== %time% ====================== >> %logname%

C:
CD %dir%
echo CMD: blat.exe -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject %subject% -body %body% >> %logname%
blat.exe -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject %subject% -body %body% >> %logname%

my computer IP is - 10.0.0.167/24
the DG is - 10.0.0.1 (IP of the router )

what am I missing? doing wrong?

Thanks ,
 
Maxoni
just joined
Posts: 11
Joined: Thu Jan 30, 2014 3:03 pm

Re: Email notification throughout Gmail on Windows machine

Wed Feb 19, 2014 11:25 am

Did you have an smtp server on your computer ?

If you don't have put the IP adress of your IAP in "set smtpserver"

Personnaly i did it and it's work well. And i doesn't use stunnel
Sorry for my english.
 
David1234
Forum Guru
Forum Guru
Posts: 1266
Joined: Sun Sep 18, 2011 7:00 pm

Re: Email notification throughout Gmail on Windows machine

Thu Feb 20, 2014 9:25 am

What is IAP ?
 
Maxoni
just joined
Posts: 11
Joined: Thu Jan 30, 2014 3:03 pm

Re: Email notification throughout Gmail on Windows machine

Thu Feb 20, 2014 10:08 am

You'r internet acess provider.
For example my IAP is Orange ( in france).
So i put the IP adress of the Orange smtp server.
Sorry for my english.
 
David1234
Forum Guru
Forum Guru
Posts: 1266
Joined: Sun Sep 18, 2011 7:00 pm

Re: Email notification throughout Gmail on Windows machine

Thu Feb 20, 2014 10:17 am

O.K

how can I know this ?
is there any command that tell me?
 
Maxoni
just joined
Posts: 11
Joined: Thu Jan 30, 2014 3:03 pm

Re: Email notification throughout Gmail on Windows machine

Thu Feb 20, 2014 10:22 am

Maybe you could find it on google or on invoice.
Sorry for my english.
 
David1234
Forum Guru
Forum Guru
Posts: 1266
Joined: Sun Sep 18, 2011 7:00 pm

Re: Email notification throughout Gmail on Windows machine

Thu Feb 20, 2014 10:26 am

I also using Orange - where did you find the ip?

I have search google for orange smtp server?
 
Maxoni
just joined
Posts: 11
Joined: Thu Jan 30, 2014 3:03 pm

Re: Email notification throughout Gmail on Windows machine

Thu Feb 20, 2014 10:32 am

I'm not on orange, took it for example. But by pinging in cmd : ping smtp.orange.fr i found 193.252.22.86
Maybe could be that one.
I just try by putting smtp.MYIAP.fr instead of IP and it's work well too.
Sorry for my english.
 
David1234
Forum Guru
Forum Guru
Posts: 1266
Joined: Sun Sep 18, 2011 7:00 pm

Re: Email notification throughout Gmail on Windows machine

Thu Feb 20, 2014 10:46 am

maybe you can show me what you have done
this is what I have - and when I try to send the mail I get an error
You do not have the required permissions to view the files attached to this post.
 
Maxoni
just joined
Posts: 11
Joined: Thu Jan 30, 2014 3:03 pm

Re: Email notification throughout Gmail on Windows machine

Thu Feb 20, 2014 10:56 am

Oh thinking you use Blat.
I don't put anything in the server configuration.

So First download Blat as slech said in the first post.
Create emailblat.cmd file with :
rem @echo off

set dir=C:\blat\blat
set logname=%dir%\blat.log
set smtpsender=mymail@gmail.com
set smtpserver=MYIAP
set smtpport=25
set smtpuser=mymail@gmail.com
set smtppwd=PASSWORD of mail
set mailto=mymail@gmail.com

set subject=%1
set body=%2

IF NOT EXIST %logname% echo ====================== Start of file ====================== > %logname%
echo. >> %logname%
echo ====================== %time% ====================== >> %logname%

C:
CD %dir%
echo CMD: blat.exe -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject %subject% -body %body% >> %logname%
blat.exe -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject %subject% -body %body% >> %logname%


After create a notification :

Name : email
type : execute on server
Code : C:\blat\blat\emailblat.cmd "Dude: [Device.NetMaps] map - [Device.Name] sonde [Probe.Name] est [Service.Status]" "Le serveur Dude a repérer une anomalie : ||à: [TimeAndDate]|sur la map: [Device.NetMaps]|Nom du device: [Device.Name]|Sonde: [Probe.Name]|Status: [Service.Status]|Description du problème: [Service.ProblemDescription]|Changé depuis: [Service.TimeSinceChanged]|Dernière fois qu’il a fonctionné: [Service.TimeLastUp]"


Don't forget to change the direction of the folder
After that must be good, it's work for me
Sorry for my english.
 
David1234
Forum Guru
Forum Guru
Posts: 1266
Joined: Sun Sep 18, 2011 7:00 pm

Re: Email notification through Gmail on Windows machine.

Thu Feb 20, 2014 11:53 am

I have done as you told me - still not working

this is what in the file
rem @echo off
set dir=C:\Program Files\Dude\blat
set logname=%dir%\blat.log
set smtpsender=mygmail@gmail.com
set smtpserver=173.194.77.108(gmail smtp) --- have try also ip 193.252.22.86(orange smtp)
set smtpport=587 --- have try also port 25
set smtpuser=mygmail@gmail.com
set smtppwd=mygmailpass
set mailto=mygmail@gmail.com

set subject=%1
set body=%2

IF NOT EXIST %logname% echo ====================== Start of file ====================== > %logname%
echo. >> %logname%
echo ====================== %time% ====================== >> %logname%

C:
CD %dir%
echo CMD: blat.exe -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject %subject% -body %body% >> %logname%
blat.exe -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject %subject% -body %body% >> %logname%
also he doesn't create a log file, so I can see what is wrong
 
slech
Long time Member
Long time Member
Topic Author
Posts: 533
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Email notification through Gmail on Windows machine.

Thu Feb 20, 2014 12:03 pm

Hello to everyone!

I tried to setup test mail notifications, by my instruction, posted in first post and it worked from first attempt!
Windows 7 x64.
stunnel-4.56-installer
blat312_64

Also I made some cosmical changes in instruction.

David1234, please revise instruction on first post and use new script posted. There a new option available for debugging purpose.
Post debug here, please.

Thank you!
sorry for my english
 
Maxoni
just joined
Posts: 11
Joined: Thu Jan 30, 2014 3:03 pm

Re: Email notification through Gmail on Windows machine.

Thu Feb 20, 2014 12:12 pm

Check if you'r port were opened in you'r firewall configuration.

Windows panel => system and sécurity => windows firewall => advenced parameter
If not create a new rule for the port and configure it.
Sorry for my english.
 
David1234
Forum Guru
Forum Guru
Posts: 1266
Joined: Sun Sep 18, 2011 7:00 pm

Re: Email notification through Gmail on Windows machine.

Thu Feb 20, 2014 12:34 pm

I have done everything you told me
still not working

this is the log file (only when I run is from the directory - not from the dude "test" command")
2014.02.20 12:26:21 (Thu)------------Start of Session-----------------
Blat v3.2.0 (build : Dec 27 2013 14:37:23)
32-bit Windows, Full, Unicode
Error: Server refused connection.
2014.02.20 12:26:22 (Thu)-------------End of Session------------------
this is the emailblat.cmd
::
:: Send email notifications from Dude via Gmail
::
set blatdir=C:\Program Files\Dude\blat
set smtpsender=testing@gmail.com
set smtpserver=127.0.0.1
set smtpport=465
set smtpuser=testing
set smtppwd=mypass123
set mailto=testing@gmail.com
::
::
"%blatdir%\blat.exe" -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject %1 -body %2
::
Uncomment for debug only (Comment previous line. Do not forget to return back after debugging!!!)

"%blatdir%\blat.exe" -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject "Test subject" -body "Test body" -debug -log emailbtal.log

pause
::
I have disable the firewall just to be sure

what am I missing ?
I have Windows 7 professional 32bit
 
slech
Long time Member
Long time Member
Topic Author
Posts: 533
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Email notification through Gmail on Windows machine.

Thu Feb 20, 2014 1:08 pm

David1234

Should be commented
"%blatdir%\blat.exe" -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject %1 -body %2
This is a comment and it should be commented
Uncomment for debug only (Comment previous line. Do not forget to return back after debugging!!!)
Then double click on emailblat.cmd. As a result it will create emailblat.log.
Post it here please.
sorry for my english
 
David1234
Forum Guru
Forum Guru
Posts: 1266
Joined: Sun Sep 18, 2011 7:00 pm

Re: Email notification through Gmail on Windows machine.

Thu Feb 20, 2014 1:31 pm

I have fix as you told me
::
:: Send email notifications from Dude via Gmail
::
set blatdir=C:\Program Files\Dude\blat
set smtpsender=testing@gmail.com
set smtpserver=127.0.0.1
set smtpport=465
set smtpuser=testing
set smtppwd=pass
set mailto=testing@gmail.com
::
::
::"%blatdir%\blat.exe" -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject %1 -body %2
::
:: Uncomment for debug only (Comment previous line. Do not forget to return back after debugging!!!)

"%blatdir%\blat.exe" -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject "Test subject" -body "Test body" -debug -log emailbtal.log

pause
and this is what I get in the log file
2014.02.20 13:28:58 (Thu)------------Start of Session-----------------
Blat v3.2.0 (build : Dec 27 2013 14:37:23)
32-bit Windows, Full, Unicode
Error: Server refused connection.
2014.02.20 13:28:59 (Thu)-------------End of Session------------------
i have try with several gmail account - the same result
 
David1234
Forum Guru
Forum Guru
Posts: 1266
Joined: Sun Sep 18, 2011 7:00 pm

Re: Email notification through Gmail on Windows machine.

Thu Feb 20, 2014 2:14 pm

i just want to say a big thank you to slech

thank you for the help and time !
 
slech
Long time Member
Long time Member
Topic Author
Posts: 533
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Email notification through Gmail on Windows machine.

Thu Feb 20, 2014 2:18 pm

Glad to help you, David1234!

It seems that the issue was in stunnel.conf.
Now I mentioned in instruction that is preferred to create this file from scratch.
sorry for my english
 
David1234
Forum Guru
Forum Guru
Posts: 1266
Joined: Sun Sep 18, 2011 7:00 pm

Re: Email notification through Gmail on Windows machine.

Thu Feb 20, 2014 5:08 pm

yes I think it's better that way

Good job!
 
David1234
Forum Guru
Forum Guru
Posts: 1266
Joined: Sun Sep 18, 2011 7:00 pm

Re: Email notification through Gmail on Windows machine.

Tue Feb 25, 2014 3:14 pm

1 more question -
if I want to send to 2 email address , can I do this?

never mind - manage to do this
all that was need to do is add a " , " between mails
1@gmail.com,2@gmail.com

but now another question -
if I want to make 1 mail as a CC or a even BCC , can it be done?


thanks ,
Last edited by David1234 on Tue Feb 25, 2014 3:32 pm, edited 1 time in total.
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification through Gmail on Windows machine.

Tue Feb 25, 2014 3:30 pm

1 more question -
if I want to send to 2 email address , can I do this?

or do I need to create a new notification called "Email blat" with another file call emailblat1.cmd?


thanks ,
You can have multiple receipients in one command.
for example blat.exe -to tst@domain.com,tst2@domain.com
Seperate the email addresses with comma but do NOT add a space after the comma..
 
David1234
Forum Guru
Forum Guru
Posts: 1266
Joined: Sun Sep 18, 2011 7:00 pm

Re: Email notification through Gmail on Windows machine.

Tue Feb 25, 2014 4:51 pm

yes I have understood it ,

now what about the other question -

if I want to make 1 mail as a CC or a even BCC , can it be done?

Thanks ,
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification through Gmail on Windows machine.

Wed Feb 26, 2014 10:33 am

yes I have understood it ,

now what about the other question -

if I want to make 1 mail as a CC or a even BCC , can it be done?

Thanks ,
Yes, no probemen!
blat -to me@test.com -cc myemail1@test.com -bcc invisible@test.com
 
David1234
Forum Guru
Forum Guru
Posts: 1266
Joined: Sun Sep 18, 2011 7:00 pm

Re: Email notification through Gmail on Windows machine.

Wed Feb 26, 2014 2:33 pm

O.K
but how do I change it in the file?
::
:: Send email notifications from Dude via Gmail
::
set blatdir=C:\Program Files\Dude\blat
set smtpsender=testing@gmail.com
set smtpserver=127.0.0.1
set smtpport=465
set smtpuser=testing
set smtppwd=pass
set mailto=testing@gmail.com
::
::
::"%blatdir%\blat.exe" -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject %1 -body %2
::
:: Uncomment for debug only (Comment previous line. Do not forget to return back after debugging!!!)
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification through Gmail on Windows machine.

Wed Feb 26, 2014 3:12 pm

O.K
but how do I change it in the file?
Ok, lets assume you want to add a cc receipient, then the file will be:
::
:: Send email notifications from Dude via Gmail
::
set blatdir=C:\Program Files\Dude\blat
set smtpsender=testing@gmail.com
set smtpserver=127.0.0.1
set smtpport=465
set smtpuser=testing
set smtppwd=pass
set mailto=testing@gmail.com
set mailcc=testing2@gmail.com
::
::
"%blatdir%\blat.exe" -to %mailto% -cc %mailcc% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject %1 -body %2
 
David1234
Forum Guru
Forum Guru
Posts: 1266
Joined: Sun Sep 18, 2011 7:00 pm

Re: Email notification through Gmail on Windows machine.

Wed Feb 26, 2014 5:29 pm

Thanks !
 
User avatar
midolinho
just joined
Posts: 4
Joined: Wed Dec 11, 2013 11:09 am

Re: Email notification through Gmail on Windows machine.

Tue May 13, 2014 3:41 pm

Greetings to all,

I have problem with this setup, stunnel is instaled as service and working, but i have problem with blat. seems its some auth problem and i can getmy finger on it. please help, this is debug file.Why is AUTH PLAIN and why ''The SMTP server did not accept Auth PLAIN value'' how to change that

2014.05.13 14:12:26 (Tue)------------Start of Session-----------------
Blat v3.1.2 (build : Dec 27 2013 14:33:12)
32-bit Windows, Full, Unicode
<<<getline<<< 220 mx.google.com ESMTP m44sm39823168eeh.14 - gsmtp
>>>putline>>> EHLO bork.gmail.com
<<<getline<<< 250-mx.google.com at your service, [188.40.84.130]
<<<getline<<< 250-SIZE 35882577
<<<getline<<< 250-8BITMIME
<<<getline<<< 250-AUTH LOGIN PLAIN XOAUTH XOAUTH2 PLAIN-CLIENTTOKEN
<<<getline<<< 250-ENHANCEDSTATUSCODES
<<<getline<<< 250 CHUNKING
Sending stdin.txt to mygmailreciver@gmail.com
Subject: Test subject
Login name is mygmailsender@gmail.com
>>>putline>>> AUTH PLAIN *****
<<<getline<<< 535-5.7.8 Username and Password not accepted. Learn more at
<<<getline<<< 535 5.7.8 http://support.google.com/mail/bin/answ ... swer=14257 m44sm39823168eeh.14 - gsmtp
*** Warning *** The SMTP server did not accept Auth PLAIN value.
*** Warning *** Are your login userid and password correct?
>>>putline>>> AUTH LOGIN
<<<getline<<< 334 VXNlcm5hbWU6
>>>putline>>> ZW9mZmljZW10cmVwb3J0c0BnbWFpbC5jb20=
<<<getline<<< 334 UGFzc3dvcmQ6
>>>putline>>> ZW9mZmljZTI5
<<<getline<<< 535-5.7.8 Username and Password not accepted. Learn more at
<<<getline<<< 535 5.7.8 http://support.google.com/mail/bin/answ ... swer=14257 m44sm39823168eeh.14 - gsmtp
*** Warning *** The SMTP server did not accept Auth LOGIN PASSWD value.
>>>putline>>> QUIT
<<<getline<<< 221 2.0.0 closing connection m44sm39823168eeh.14 - gsmtp
2014.05.13 14:12:27 (Tue)-------------End of Session------------------
 
RolandKlO
newbie
Posts: 44
Joined: Fri Jun 10, 2011 1:20 pm
Location: The Neterlands
Contact:

Re: Email notification through Gmail on Windows machine.

Wed May 14, 2014 4:46 pm

Greetings to all,

I have problem with this setup, stunnel is instaled as service and working, but i have problem with blat. seems its some auth problem and i can getmy finger on it. please help, this is debug file.Why is AUTH PLAIN and why ''The SMTP server did not accept Auth PLAIN value'' how to change that
I would like to suggest to do an out-of-the-box solution for this problem. Don't use Stunnel, use your local SMTP server (that can be installed as a Feature, don't forget to include the IIS 6 management console to configure it). This local SMTP server can be configured in The Dude (127.0.0.1 as server) and can then directly remail it trough the Gmail server. The setup is as follows:

1. In The Dude -> settings, tab General, set Primary SMTP server to 127.0.0.1
2. Create a new notification, type email, server 127.0.0.1, to: your desired receipient
3. Install the SMTP Server and SMTP Server Tools features
4. configure the Simple Mail Transfer Protocol(SMTP) to start automatically and start that service
5. Go to Start -> administrative tools -> Internet Information Services (IIS) 6.0 Manger
6. Open the properties of the SMTP Virtual Server #1
7. Tab Access, button Relay, set Only the list below and add the localhost ip (127.0.0.1) to the granted list
8. Tab Delivery, klik outbound security, choose Basic authentication and fill in your COMPLETE email as user and the apropriate password (use app specific password if you use 2 step authentication)
9. Mark the TLS encryption box! and click ok, now still in the Delivery tab, click on outbound connections and set the TCP port to 587
10. Klik ok, and still in the Delivery tab, click Advanced. Set the smart host to smtp.gmail.com, do NOT mark the boxes below that.
11. Click ok twice, now where back in the IIS manager. Close that, do a restart of the SMTP service and test the notification

This should work, it does for me...

Regards,
Roland
 
slech
Long time Member
Long time Member
Topic Author
Posts: 533
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Email notification through Gmail on Windows machine.

Thu May 15, 2014 10:58 am

midolinho
Please post here your stunnel.conf file content.
sorry for my english
 
User avatar
midolinho
just joined
Posts: 4
Joined: Wed Dec 11, 2013 11:09 am

Re: Email notification through Gmail on Windows machine.

Mon May 19, 2014 11:22 am

Thx Roland, ill try this steps and post the results asap.

slech this is my stunnel.conf

socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1

debug = 7

output = stunnel.log

client = yes

[pop3s]
accept = 995
connect = pop.gmail.com:995

[ssmtp]
accept = 587
connect = smtp.gmail.com:587

i changed ssmtp from 465 to 587 (tried both).

Thx guys for posting
 
slech
Long time Member
Long time Member
Topic Author
Posts: 533
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Email notification through Gmail on Windows - via blat.

Tue May 20, 2014 12:46 pm

midolinho
Can you try new guide using mailsend ?
Email notification through Gmail on Windows - via mailsend.
sorry for my english
 
User avatar
midolinho
just joined
Posts: 4
Joined: Wed Dec 11, 2013 11:09 am

Re: Email notification through Gmail on Windows - via blat.

Tue May 20, 2014 3:06 pm

Slech, new mailsend setup work like charm.
Thanks m8

@Roland:
Ty for reply, SMTP service somehow losses .dll files needed to run explorer.exe (WinXP SP3), so i didnt try further, i install mailsend. Thank you for sugestions

:D I'm Happy now :D
 
carlossu
just joined
Posts: 15
Joined: Tue Jul 29, 2014 5:32 am

Re: Email notification through Gmail on Windows - via blat.

Wed Jul 30, 2014 6:35 am

Hi..
I have been trying to set an email notification on Dude following all the steps that I saw above and I think that I did everything correctly but it is not working, I would like some help.. when I create the notification and press the button "Test".. a cmd window that appears but just for second and then it disappears (I can´t even read what it says), is that correct or it has to appear and stay longer??
Just to let you know I am running the Dude on Windows server 2008 R2 and It is installed in a Virtual Machine..
I will appreciate some help, thanks..!!
 
slech
Long time Member
Long time Member
Topic Author
Posts: 533
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Email notification through Gmail on Windows - via blat.

Wed Jul 30, 2014 9:55 am

carlossu,
to debug blat you should change your emailblat.cmd as mentioned in it(in this example debugging section already uncommented):
::
::"%blatdir%\blat.exe" -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject %1 -body %2
::
:: Uncomment for debug only (Comment previous line. Do not forget to return back after debugging!!!)
::
"%blatdir%\blat.exe" -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject "Test subject" -body "Test body" -debug -log emailbtal.log
::
pause
::
Then try one more time to pres Test button. As a result emailbtal.log will be created.
Post it here, please.

Also verify your stunnel.conf. It should contain only lines mentioned in first post of this topic.

As alternative to blat + stunnel you can setup mailsend: Email notification through Gmail on Windows - via mailsend.
sorry for my english
 
carlossu
just joined
Posts: 15
Joined: Tue Jul 29, 2014 5:32 am

Re: Email notification through Gmail on Windows - via blat.

Thu Jul 31, 2014 12:07 am

Then try one more time to pres Test button. As a result emailbtal.log will be created.
Post it here, please.

Also verify your stunnel.conf. It should contain only lines mentioned in first post of this topic.
Hi slech;

Thaks for the reply.. I attached the images with the currently stunnel and blat configuration.. could you watch them and verify if everything is correct? thanks..
You do not have the required permissions to view the files attached to this post.
 
slech
Long time Member
Long time Member
Topic Author
Posts: 533
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Email notification through Gmail on Windows - via blat.

Thu Jul 31, 2014 12:49 am

carlossu, please fix this line in your stunnel.conf
connect = smtp.gmail.com:465
Also provide please content of emailblat.log.
sorry for my english
 
carlossu
just joined
Posts: 15
Joined: Tue Jul 29, 2014 5:32 am

Re: Email notification through Gmail on Windows - via blat.

Thu Jul 31, 2014 1:02 am

Slech, thanks for your help.. I did it with the other option that you said before Mailsend.exe, and now it is working perfectly..

Now, here is another question.. I am using The Dude to monitore Mikrotik Routers that are running BGP and OSPF.. do you know if I can use those Email Notifications to let me know if the BGP or OSPF goes down??
 
slech
Long time Member
Long time Member
Topic Author
Posts: 533
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Email notification through Gmail on Windows - via blat.

Thu Jul 31, 2014 7:31 am

carlossu, you are welcome!
You can start with probes on this topic: Probe Thread

Also found on the forum:
MIkrotik BGP Monitoring
Email me if BGP session status in NOT established
Monitoring OSPF path status, is it possible?
sorry for my english
 
raindropz
just joined
Posts: 1
Joined: Tue Sep 30, 2014 2:46 pm

Re: Email notification through Gmail on Windows - via blat.

Tue Sep 30, 2014 2:49 pm

Really helpful article. I am new with Windows 8 and your article helped me to understand how the e-mail works with the Windows. I was confused how to send to two e-mail address and your thread helped me to fix these issues and clarify many doubts. Great job. You can submit this to twc internet to help all Windows users.
Last edited by raindropz on Wed Jul 27, 2016 9:31 am, edited 1 time in total.
 
Kurt
just joined
Posts: 1
Joined: Thu Oct 09, 2014 5:37 am

Re: Email notification through Gmail on Windows - via blat.

Thu Oct 09, 2014 6:13 am

Hi!
My local network behind a proxy server. And for the correct operation of the notification dude, you must specify the proxy settings in the configuration -serverv stunnel.
This my working config given a proxy server:
(I used SMTP server Yandex. Why it is only through it the connection was successfully.)

Stunnel:
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
#debug = 7
#output = stunnel.log

[ssmtp]
accept = 465
client = yes
connect = 192.168.XXX.XXX:8080
protocol = connect
protocolAuthentication = basic
protocolUsername =your_proxy_login
protocolPassword =your_proxy_password
protocolHost = smtp.yandex.ru:465
#debug = 7
#output = stunnel.log - disabled after debugging

192.168.XXX.XXX:8080 - proxy server

Blat:
rem @echo off
 
set dir=C:\blat
set logname=%dir%\blat.log
set smtpsender=dude-XXXXXX@yandex.ru
set smtpserver=127.0.0.1
set smtpport=465
set smtpuser=dude-XXXXXX@yandex.ru
set smtppwd=XXXXXXXXXX
set mailto=XXXXXXXXXXXXX@gmail.com
set subject=%1
set body=%2


IF NOT EXIST %logname% echo ====================== Start of file ====================== > %logname%
echo. >> %logname%
echo ====================== %time% ====================== >> %logname%


C:
CD %dir%
echo CMD: blat.exe -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject %subject% -body %body% >> %logname%
blat.exe -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject %subject% -body %body% >> %logname%
set smtpsender=set smtpuser=your accaunt yandex
set smtppwd=your password yandex
set mailto=but you can specify any address - what you need. I have tried the service Beeline 7909XXXXXXX@sms.beemail.ru. It works, but SMS comes with a delay, and it is unacceptable. So I made ​​a notification to gmail and alert comes time for my smartphone.
 
AlAraf
just joined
Posts: 10
Joined: Sun Dec 01, 2013 8:13 pm

Re: Dude - Email notification through Gmail on Windows - via blat.

Tue Mar 29, 2016 8:53 pm

Just use Mail Alert Simple Mailer:
https://sourceforge.net/projects/mail-alert/

You don't need any makeshifts like Blat and Stunnel. Mail Alert supports SSL/TLS natively.
 
edgars04
just joined
Posts: 2
Joined: Tue Oct 11, 2016 8:37 pm
Location: Venezuela

Re: Dude - Email notification through Gmail on Windows - via blat.

Tue Oct 11, 2016 9:30 pm

Hello Guys,

I tryed configuration of email notifications through gmail on windows, but not sends the nonifications. I have installed The Dude v3.6 on Windows Server 2012RH, I follow the steps but it does not work!!!

I need your help, this configuration is very importat in my company for monitoring the network.

I installed stunnel4.56 and blat3216_full, I edit stunnel.conf for these
stunnel.conf
Sample stunnel configuration file for Win32 by Michal Trojnara 2002-2012
; Some options used here may be inadequate for your particular configuration
; This sample file does *not* represent stunnel.conf defaults
; Please consult the manual for detailed description of available options

; **************************************************************************
; * Global options                                                         *
; **************************************************************************

; Debugging stuff (may useful for troubleshooting)
;debug = 7
;output = stunnel.log

; Disable FIPS mode to allow non-approved protocols and algorithms
;fips = no

; **************************************************************************
; * Service defaults may also be specified in individual service sections  *
; **************************************************************************

; Certificate/key is needed in server mode and optional in client mode
cert = stunnel.pem
;key = stunnel.pem

; Authentication stuff needs to be configured to prevent MITM attacks
; It is not enabled by default!
;verify = 2
; Don't forget to c_rehash CApath
;CApath = certs
; It's often easier to use CAfile
;CAfile = certs.pem
; Don't forget to c_rehash CRLpath
;CRLpath = crls
; Alternatively CRLfile can be used
;CRLfile = crls.pem

; Disable support for insecure SSLv2 protocol
options = NO_SSLv2
; Workaround for Eudora bug
;options = DONT_INSERT_EMPTY_FRAGMENTS

; These options provide additional security at some performance degradation
;options = SINGLE_ECDH_USE
;options = SINGLE_DH_USE

; **************************************************************************
; * Service definitions (at least one service has to be defined)           *
; **************************************************************************

; Example SSL server mode services

socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
;debug = 7
;output = stunnel.log

client = yes

[pop3s]
accept  = 995
connect = pop.gmail.com:995

[ssmtp]
accept  = 465
connect = smtp.gmail.com:465
[/color]
; Example SSL client mode services

;[gmail-pop3]
;client = yes
;accept = 127.0.0.1:110
;connect = pop.gmail.com:995

;[gmail-imap]
;client = yes
;accept = 127.0.0.1:143
;connect = imap.gmail.com:993

;[gmail-smtp]
;client = yes
;accept = 127.0.0.1:25
;connect = smtp.gmail.com:465

; Example SSL front-end to a web server

;[https]
;accept  = 443
;connect = 80
; "TIMEOUTclose = 0" is a workaround for a design flaw in Microsoft SSL
; Microsoft implementations do not use SSL close-notify alert and thus
; they are vulnerable to truncation attacks
;TIMEOUTclose = 0

; vim:ft=dosini
mailblat.cmd create the file
set blatdir=C:\Program Files\Dude\blat\mailblat.cmd
set smtpsender=XXXXXXXX@gmail.com
set smtpserver=127.0.0.1
set smtpport=465
set smtpuser=XXXXXXXXXX@gmail.com
set smtppwd=MYPASSWORD
set mailto=XXXXXXXXXXX@gmail.com
"%blatdir%\blat.exe" -to %XXXXXXXXX@gmail.com% -f %XXXXXXXXXX@gmail.com% -server %127.0.0.1% -port %465% -u %XXXXXXXXXX@gmail.com% -pw %MYPASSWORD% -subject %1 -body %2
The Dude v3.6 add the new notifications
Name: Email Externo
Type: Execute on server
(Insertar Variale)
Command: "C:\Program Files (x86)\Dude\blat\mailblat.cmd" "Service [Probe.Name] on [Device.Name] is now [Service.Status]" "Service [Probe.Name] on [Device.Name] is now [Service.Status] ([Service.ProblemDescription])"
The server have Private IP, the setting General on The Dude is:

Primary DNS: 4.2.2.1
Secondary DNS: 8.8.8.8

Primary SMTP: 74.125.141.108 (this IP I found when I do Ping smtp.gmail.com)
Secondary SMTP: 0.0.0.0
From: XXXXXXXX@gmail.com

Please could you help me!!!
 
slech
Long time Member
Long time Member
Topic Author
Posts: 533
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Dude - Email notification through Gmail on Windows - via blat.

Wed Oct 12, 2016 8:48 pm

Hello, edgars04!

Can you try the following solution: Dude - Email notification through Gmail on Windows - via mailsend.
If not, we can continue to solve your issue with blat.

Thank you!
sorry for my english
 
edgars04
just joined
Posts: 2
Joined: Tue Oct 11, 2016 8:37 pm
Location: Venezuela

Re: Dude - Email notification through Gmail on Windows - via blat.

Thu Oct 13, 2016 1:13 am

Thanks for you help Slech!!!!

I will try the configuration with mailsend.
 
David1234
Forum Guru
Forum Guru
Posts: 1266
Joined: Sun Sep 18, 2011 7:00 pm

Re: Dude - Email notification through Gmail on Windows - via blat.

Thu Nov 10, 2016 1:29 pm

Hello slech , can you help me
for some reason it stop sending me
didn't change any setting of my files in the last 2 years
I get :
2016.11.10 13:21:14 (Thu)------------Start of Session-----------------
Blat v3.2.0 (build : Dec 27 2013 14:37:23)
32-bit Windows, Full, Unicode
Error: Server refused connection.
2016.11.10 13:21:15 (Thu)-------------End of Session------------------
this is the stunnel.conf
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
debug = 7
output = stunnel.log
client = yes
[pop3s]
accept = 995
connect = pop.gmail.com:995
[ssmtp]
accept = 465
connect = smtp.gmail.com:465
and this is the cmd file
::
:: Send email notifications from Dude via Gmail
::
set blatdir=C:\Program Files\Dude\blat
set smtpsender=MyEmail@gmail.com
set smtpserver=127.0.0.1
set smtpport=465
set smtpuser=MyEmail
set smtppwd=MyPassword
set mailto=david@gmail
set mailcc=david1@korenron.co.il
::
::
::"%blatdir%\blat.exe" -to %mailto% -cc %mailcc% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject %1 -body %2
::
:: Uncomment for debug only (Comment previous line. Do not forget to return back after debugging!!!)
::
"%blatdir%\blat.exe" -to %mailto% -f %smtpsender% -server %smtpserver% -port %smtpport% -u %smtpuser% -pw %smtppwd% -subject "Test subject" -body "Test body" -debug -log emailbtal.log
::
::pause
::
what could it be?
I have try to enter to account with the user\pass - and it's working , so this is not the issue

Thanks,
 
slech
Long time Member
Long time Member
Topic Author
Posts: 533
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Dude - Email notification through Gmail on Windows - via blat.

Thu Nov 10, 2016 8:00 pm

Hello, David1234!

As I see in your stunnel.conf, your log is enabled. Please verify that stunnel working and if yes, can you look in its log file.

This solution working using stunnel for secure connection and it receiving connection from the blat and then connect to the gmail.

Thank you!
sorry for my english
 
David1234
Forum Guru
Forum Guru
Posts: 1266
Joined: Sun Sep 18, 2011 7:00 pm

Re: Dude - Email notification through Gmail on Windows - via blat.

Sun Nov 13, 2016 10:57 am

I'm sorry - but i didnlt understand what you want me to do

how can I know if my stunnel is working? I don;t see any log file in it's folder.
?

Thanks ,
 
slech
Long time Member
Long time Member
Topic Author
Posts: 533
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Dude - Email notification through Gmail on Windows - via blat.

Sun Nov 13, 2016 11:24 am

David1234,

1. Stunnel should work as a Windows service. To verify if it is running:
Win+R --> Services.msc --> Enter --> Find Stunnel and verify its state. If it is not running - "Start" it.
2. As your stunnel debug is turned on, in stunnel.logu you should see something if it working. I think this file should be in the stunnel installation folder.
3. Try a connection to the Gmail directly and using stunnel:
a)telnet smtp.gmail.com 465
b)telnet localhost 465
And notice if connection is established.

Also you can try to move on another solution which not require a stunnnel: Dude - Email notification through Gmail on Windows - via mailsend.

Thank you!
sorry for my english
 
David1234
Forum Guru
Forum Guru
Posts: 1266
Joined: Sun Sep 18, 2011 7:00 pm

Re: Dude - Email notification through Gmail on Windows - via blat.

Sun Nov 13, 2016 11:37 am

I think the problem was that the servids wasn't running.....

strange but at least we found it

Thanks !
 
AlAraf
just joined
Posts: 10
Joined: Sun Dec 01, 2013 8:13 pm

Re: Dude - Email notification through Gmail on Windows - via blat.

Thu Mar 02, 2017 1:34 pm

I think the problem was that the servids wasn't running.....

strange but at least we found it

Thanks !
Why you are still using Blat with stunnel? There is a better solution like Mail Alert Simple Mailer (https://sourceforge.net/projects/mail-alert/) which natively supports SSL/STARTTLS and stores encrypted SMTP password in configuration file.

Who is online

Users browsing this forum: No registered users and 14 guests