Community discussions

MikroTik App
 
mdkberry
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 70
Joined: Tue Jan 14, 2014 4:39 am

Email via Gmail no longer working since Aug 22

Sat Sep 22, 2018 6:03 am

nothing changed on my router that i am aware of but regular emails sent from RB2011 (6.40.9) via gmail no longer go out, they give a time out error.
it has been working fine for over a year.

I dont use the gmail account for anything else, so I dont log in to it. but when troubleshooting this issue I logged in and Google asked me security questions
I then had to set it to use less secure apps. but so far nothing is working to get it to work. I wondered if the ip address has changed since we cannot use urls in the mikrotik.

edit: this same account works fine from a PRTG server to email out of gmail using the url and same account and password so seems to be something with the Mikrotik settings. maybe ip address or lack of SSL?

any thoughts appreciated

here is my code, it was working but I now I just get a timeout error with no further info in the logs.
/tool e-mail
set address=173.194.77.108 from=myaddress@gmail.com password=\
    "laaadeeeda" port=587 start-tls=yes user=myaddress@gmail.com
 
nescafe2002
Forum Veteran
Forum Veteran
Posts: 897
Joined: Tue Aug 11, 2015 12:46 pm
Location: Netherlands

Re: Email via Gmail no longer working since Aug 22

Sat Sep 22, 2018 9:56 am

smtp.gmail.com resolves to another IP (173.194.79.108, depending on location and used dns service). Just set hostname as address and you should be fine.
 
mdkberry
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 70
Joined: Tue Jan 14, 2014 4:39 am

Re: Email via Gmail no longer working since Aug 22

Sun Sep 23, 2018 12:51 am

thanks I will try that when I can.

I am curious why this of all places does not make use of the DNS and URL option, since smtp.gmail.com is not a permanent/single ip address. Surely it would be of benefit and make sense to have URL option in the email configuration, why would it be detrimental? there must be some reason behind it.
Last edited by mdkberry on Sun Sep 23, 2018 1:27 am, edited 3 times in total.
 
User avatar
ADahi
Member Candidate
Member Candidate
Posts: 209
Joined: Thu Sep 21, 2017 7:16 pm
Location: Iraq, Ninavah
Contact:

Re: Email via Gmail no longer working since Aug 22

Sun Sep 23, 2018 12:58 am

smtp.gmail.com resolves to another IP (173.194.79.108, depending on location and used dns service). Just set hostname as address and you should be fine.

/tool e-mail
set address=[:resolve "smtp.gmail.com"] from=myaddress@gmail.com password=\
    "laaadeeeda" port=587 start-tls=yes user=myaddress@gmail.com
 
mdkberry
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 70
Joined: Tue Jan 14, 2014 4:39 am

Re: Email via Gmail no longer working since Aug 22

Sun Sep 23, 2018 1:26 am

smtp.gmail.com resolves to another IP (173.194.79.108, depending on location and used dns service). Just set hostname as address and you should be fine.


thanks I will try both methods suggested when I can.
 
nescafe2002
Forum Veteran
Forum Veteran
Posts: 897
Joined: Tue Aug 11, 2015 12:46 pm
Location: Netherlands

Re: Email via Gmail no longer working since Aug 22  [SOLVED]

Sun Sep 23, 2018 2:44 am

smtp.gmail.com resolves to another IP (173.194.79.108, depending on location and used dns service). Just set hostname as address and you should be fine.

/tool e-mail
set address=[:resolve "smtp.gmail.com"] from=myaddress@gmail.com password=\
    "laaadeeeda" port=587 start-tls=yes user=myaddress@gmail.com

This is a perfect example of how it should not be done. This will resolve smtp.gmail.com only once (on config update), fix the ip and further dns updates from Gmail will go unnoticed.

Therefore:

/tool e-mail set address="smtp.gmail.com"
 
mdkberry
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 70
Joined: Tue Jan 14, 2014 4:39 am

Re: Email via Gmail no longer working since Aug 22

Sun Sep 23, 2018 4:00 am

/tool e-mail set address="smtp.gmail.com"
haha, works perfectly. I honestly didnt think to just try using the URL, I assumed it was still IP only, as per the wiki on it. thanks.
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11627
Joined: Thu Mar 03, 2016 10:23 pm

Re: Email via Gmail no longer working since Aug 22

Sun Sep 23, 2018 12:46 pm

/tool e-mail set address="smtp.gmail.com"
haha, works perfectly. I honestly didnt think to just try using the URL, I assumed it was still IP only, as per the wiki on it. thanks.
FYI, smtp.gmail.com used in @nescafe202's code is not URL, it's FQDN. Try to be precise, everybody will understand you better.
 
Samot
Member Candidate
Member Candidate
Posts: 113
Joined: Sat Nov 25, 2017 10:01 pm

Re: Email via Gmail no longer working since Aug 22

Sun Sep 23, 2018 4:24 pm

/tool e-mail set address="smtp.gmail.com"
haha, works perfectly. I honestly didnt think to just try using the URL, I assumed it was still IP only, as per the wiki on it. thanks.
FYI, smtp.gmail.com used in @nescafe202's code is not URL, it's FQDN. Try to be precise, everybody will understand you better.
Well technically it's an URI or in this case the subset, URN. Here it just happens to also be an URN that is a FQDN. A FQDN and an IP address is nothing more than a URI and without a method of transport list when used (http://, ftp://, etc) it is considered an URN, the moment the transport method is added it is considered to be an URL. So to recap:

forum.mikrotik.com <<-- A FQDN that is in URN format
http://forum.mikrotik.com <<-- A FQDN that is in URL format
192.168.92.12 <<-- IP address, URN format
tftp://192.168.92.12 <<-- IP address, URL format.

All four of those are URIs, two of them use FQDNs. Try being precise, everybody will understand you better.
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11627
Joined: Thu Mar 03, 2016 10:23 pm

Re: Email via Gmail no longer working since Aug 22

Mon Sep 24, 2018 10:06 am

@Samot: in case you missed the point of solution of OPs problem: when setting up tool mail, one has to use specifically FQDN and not IP. Both are, per your explanation, URNs ... the first one solves problem and other does not.
 
abolfazl64
just joined
Posts: 1
Joined: Sat Mar 14, 2020 7:14 am

Re: Email via Gmail no longer working since Aug 22

Sat Mar 14, 2020 7:27 am

/tool e-mail set address="smtp.gmail.com"
haha, works perfectly. I honestly didnt think to just try using the URL, I assumed it was still IP only, as per the wiki on it. thanks.
Returns this error when sending email: couldnt perform action-invalid FROM address (6)
Although I used the code above

Who is online

Users browsing this forum: kormenator, oreggin, simtj and 159 guests