I’ve glanced through the forums and found a few posts about emails but nothing about getting mails when there are failed login attempts on your mikrotik router. I was wondering how people do it. So far, I have done this:
Replace X with the line number of the topic you want emailed.
I set “topics=critical” as email and then tried to login with a bad password. The email was sent.
That’s why having the “tls=yes” parameter in the server declaration section would have been so usefull. Actually, it’s only available on the “send” command line, so it wouldn’t work in my case (gmail).
I’m still on V4.16, but I hear rumors that the “/tool e-mail” settings in V5.x has a tls setting.
ADD: You don’t need tls to send email to a gmail account.
You need tls to relay email to a non-gmail account using your gmail account.
You must use port 25 instead of 583 tho. My nslookup shows I can use server = 74.125.157.27 port 25 to send to gmail accounts. EDIT: This ip works for me. I just checked it.
With gmail, your email may end up in your “spam” folder. Mine did. Check there too.
Some email servers are starting to use a spam filter that blocks email from source ip/subnets that are considered “residential”. If you obtain your ip by DHCP, and it is not “persistent” (“static” ip assigned by dhcp to your mac address), then your ip/subnet will probably end up on this list some day.
@elgo: I agree with you. The tls setting in “/tool e-mail” would enable your router to send email even if the receiving email server thinks your router is “residential”.
I put together a script a while back for this purpose. I wanted to be alerted whenever anyone logged into the router or when anyone failed to log in. This was my solution:
The script can be easily modified to search for any text you would like. The example searches for logs that contain the text “logged in” or “login failure”.