Alright, This maybe something really simple but I think I’m goofing up something somewhere.
I want to use the Netwatch that is built into the RouterOS and I cant seem to get it to work the way I want it. I have went to the wiki and tried applying those scripts and failed. What I want to do is when a “netwatched” hardware goes down I want to have it send me an email.
So what do I need to have to make this little beast do what I need it to do?
The MikroTik I am using has a public IP on port 1 and Private 10.x.x.x’s on Ports 2-5. The “netwatched” hardware is all 10.x.x.x’s. I have a godaddy account with webspace/website/email.
What I was doing was logging into my godaddy account and trying to find the email sever IP and port. I Put the information in (at least what I thought was correct) and it doesnt seem to work.
Here is what I was trying to get to work
(I was putting in my information and it didn’t work at all)
The information I was following can be found on this website
First attempt sending yourself email from the CLI, and not from within a script. Is that working? If not, add a system logging item for the ‘e-mails’ topic and check the logs after another attempt to send and see where it fails.
Then run the “/tool e-mail send” command directly from a terminal and see what happens. You can then look at the logs (click the Log button in Winbox, or run “/log print”) and it will give you debug output that will hopefully show where it failed.
Try placing " around your to address and from address. Sometimes the router doesn’t like like certain fields without them, especially if they have special characters in them.
I’m sure the '' marks are going to mess things up, remove them. When something is in quote marks, it’s taken as a literal string, so the \ marks are being interpenetrated as part of the e-mail address.
set from="example@example.com" password=password123 \
server=72.***.***.80:25 username=\
"example@example.com"
If you are ever in doubt about a command structure, try pasting it into the terminal or via SSH, the router will usually highlight syntax errors.
tried that still didn’t work. I am thinking the address I am using from godaddy’s email maybe wrong… Is there any way I could use a gmail account for this?
Yes, you can actually make up any e-mail address you want for the stuff to be sent from if you want. You just need a legitimate to address and a SMTP server that will let you bounce the e-mails off of.
You’ll have to read up on the g-mail documentation so you know what sever and ports to use since I don’t think they use the standard ones for SMTP. They may have restrictions on their servers for who/what domains are allowed to send e-mails.
Outgoing Mail (SMTP) Server - requires TLS or SSL: smtp.gmail.com (use authentication)
Use Authentication: Yes
Port for TLS/STARTTLS: 587
Port for SSL: 465
I have tried both ports and neither will allow me to send.
port 465 gives me the error; SMTP is not ready to send
port 587 gives me the error; Invalid FROM address.
At this point if you know a free email sever that will let me do what I need to do I’ll do that just for testing until I can figure this out =\
That’s a little weird. I know there have been some threads about using g-mails SMTP servers to send out emails, so maybe you can try and find those and see if there’s something that is missing.
There’s not going to be many open e-mail servers that you can use, if they are open chances are they are a relay for spam bots and will be black listed as such. We have our own SMTP servers that I use to bounce e-mails off of the routers from for updates and such. Sometimes your ISP will give you information on a relay server that they have, so maybe you could try one of those. It all depends on what rules they have set up on their servers for what IPs, Domains, and addresses they will relay for.
Feklar, Thank you so much for your help. I did figure something out here. My issue was the TLS and I can use a free email provider. I just used gmail to send me an email saying “whoaza”