Why am I getting an authentication error when sending an email mikrotik? - smtp

I set up sending emails from Mikrotik to gmail using TLS / SSL according to the official instructions. And then I enter the parameters for sending, I use my mail account gmail and send a test letter to my own account. As a result, I get an error in the logs Error sending e-mail : AUTH failed. I have tried many many combinations of everything I know, and in trying to send an e-mail, it is always the same error.
Any help will be greatly appreciated. Thanks in advance.
Device: cap ac, factory-software: 6.43.10.
/tool e-mail
set address=smtp.gmail.com
set port=587
set from=myusername#gmail.com
set user=myusername
set password=mypassword
send to=myusername#gmail.com subject="email test" body="email test" start-tls=yes

Problem solved with turning off 2fa and enabling less secure apps for gmail account.

Less secure App access is not longer available for gmail (since May 30, 2022)

Related

sending email using PutEmail processor in Nifi - Failing with Error

I am trying to send email using PutEmail processor in Nifi. Below is the configuration of the processor.
However, emails are not sent and getting this error. It would be great help if addressed.
#techno_mad - I would trust the error message. Test with a known working smtp combo with 100% confirmed smtp access. I also suggest, paste the nifi error as text, not an image. Your peers need to visit the link and are likely not typing it out.
https://support.google.com/mail/thread/5621336?hl=en
Test enabling “Access for less secure apps” (which just means the
client/app doesn’t use OAuth 2.0 - https://oauth.net/2/) for the
account you are trying to access. It's found in the account settings
on the Security tab, Account permissions (not available to accounts
with 2-step verification enabled):
https://support.google.com/accounts/answer/6010255?hl=en

bypass gmail device verification

I have a gmail account that I want to use for one of our internal services. We have a server running and we want this gmail account to be used to send out an automated email to people who register.
Now, here's the problem. I have correctly configured my gmail id in the server and know that I am able to correctly ping the gmail smtp server. However,I always get stuck because gmail by default expects you to verify any new device you log in from using an OTP. In my case, this is the first time login from this server machine and hence this happens. I can see it in the logs as well - it brings up this device verification page.
Some questions:
Is there a way I can turn off this feature in gmail? I don't think this is the same as 2 step verification. I have turned it off. I have also enabled my gmail account to be accessible from non secure apps.
If not, is there a way to do the verification step via command line on my Linux server?
Any other smtp based email service I could use that does not have so many security features?
Lastly, I am doing this for a quick prototype. Therefore I am ok bypassing some of these aspects. However, I would definitely want to ensure that the access to my account is secure once this is productized. Any links on how we can do this from non google apps or services?
Thanks in advance!!
It sounds to me you have an application that needs to work on your behalf and do some gmail-related tasks.
If that's the case, why not use the Gmail API with Service Account impersonation?
In short, a service account can impersonate a real user. This is a process that does not require manual input after it's setup, so it's ideal for server-side usage, where you might not even have a UI to interact with.
Also, the Gmail API is much easier to set up than Gmail SMTP, and there are examples out there on how to do this with this setup. You can look at this answer for some references on what it would take.

Issue Sending Mail via SMTP

My iOS application uses Mailcore to access a user's email account. Sending and receiving is done via SMTP and IMAP, and both processes work as expected for Gmail and Outlook (which both use OAuth for login).
I just added Yahoo (as well as some other providers to the app who do not use OAuth) and for all of these providers I am having an issue specifically with sending messages.
The issue is that although messages DO get sent successfully from my application, they do not appear in the sent folder on the web for the provider.
For example, if I log into my Yahoo account in my application, and send a message to my Gmail account, the message appears in my Gmail inbox on the web, but not in my Yahoo sent box on the web.
I tried adding Yahoo to the regular mail app on iPhone and sending a message from this account - this worked fine - the message shows up Yahoo sent box on the web. So, I then compared the headers of the two messages (the one sent from mail app and the one sent from my app) and the only obvious difference I see is in the line 'X-Rocket-Received':
Mail App:
X-Rocket-Received: from [11.180.250.219] (userName#71.208.72.234 with xymcookie [216.39.61.254])
by smtp203.mail.ne1.yahoo.com with SMTP; 23 May 2014 08:19:54 -0700 PDT
My App:
X-Rocket-Received: from (userName#118.41.27.139 with plain [98.138.105.21])
by smtp214.mail.ne1.yahoo.com with SMTP; 23 May 2014 08:58:29 -0700 PDT
Can anyone answer any of the following questions for me:
1) What does X-Rocket-Received mean?
2) What is the significance of "with xymcookie" versus "with plain"?
3) Is my issue likely to do with my not having an xymcookie?
4) Where might I begin to solve this issue?
Many thanks.
Additional information:
It was placed there by some server along the way. It is a non-standard header. It appears similar to a standard SMTP Received header though.
'xymcookie' is a non-standard authentication method used by Yahoo. It is not, as far as I can tell, publicly documented.
No.
See Remy's answer. Use IMAP Append for most servers. Gmail does not require it, but that is non-standard.
Sending an email with SMTP directly does not put the email in the provider's Sent folder. You have to log into the provider with IMAP and put a copy of the email into the Sent folder as a separate operation. Higher level apps, like iPhone's mail app, handle these details internally.

smtp mail settings not working in moodle 2.6

I am using moodle2.6.2 with essential theme.
I have created the smtp settings with gmail account, it was working fine.
If i changed my webmail account ,it shows the error like this,
"Sender address rejected: not owned by user rathish#mywebdomain.com".
Anybody can help me ?
I wouldn't recommend using Gmail or Google apps for sending emails from Moodle.
Gmail has a daily limit for sending emails and it won't allow sending emails from aliases - the email account has to exist.
http://docs.moodle.org/26/en/Email_setup_gmail
Check with your web host, they will probably have smtp - but also check their email sending limits too - I've had a site suspended because because too many emails going out.

Retrieve SMTP response of a mail

Is it possible to retrieve the SMTP response of a mail. For example, I am sending a mail to non existing email id. Surely our server will send us a mailer daemon failure mail to our mail id. I need to capture that failure mail.
How its possible? please explain me. Some time we may enter more than one non existing email id, so i have to retrieve all the failure mail alone for every corresponding emails
Please guide me!
Thanks in advance,
Praveen J
I think I understood your question correctly now. As I understand, you are writing an application to send mail. And in your application, whenever you send a mail, you also want verify that if mail was delivered and also if it was not delivered then you want to get hold of the failure message in your application. Is that how you mean?
Well, if that is how you mean, then I think it is impossible to track the mail status with your apllication code. For instance if you are using java sendMail in your apllication you can only ensure that the send happened from your code successfully(without any send exceptions like java.net.SocketException or javax.mail.MessagingException). But, you can never ensure if the mail really reached the recepient. i.e. you can never track in your application if the mail was rejected due to wrong recepient address or any other error like illegal attachment at receipient mail server or errors like blocked sender id etc.
That is because any such error condition will be communicated by the receipient mail server to the sending mail server the information of which is present in the sent mail's header.
Does that answer your question? (Or did I understand your question correctly? ;-))
I am not sure if I am getting your question right. If you send an email to any non existent address say xxx#gmail.com from your address yyy#yourhost.com, the mail server at gmail.com replies to the mail server at yourhost.com with failure message and reason, with your delivery address and you receive the fialure mail automatically. you don't have to do anything extra in this.
If you are talking about seeing mail headers, then it depends on which client you are using. For instace, if you are using MS outlook, you can right-click on the message and click options and then see internet headers section to get mail headers. If you are using some web based mail then i am sure there will some option to view detailed mail headers.
The bounced messages are going to return to a mailbox. You should be able to configure that mailbox by properly setting the headers on the messages you send out. You would then need to monitor that mailbox, or have that mailbox deliver the messages to your program.
I would suggest you consider using VERP for all messages you send out. It will make it much easier for you to identify which email address a particular bounce belongs too. To do this you would need control of your mail server though. It takes some work configuring things.
To answer the question with more detail you need to tell us how your are sending messages, what type of mail server you are running, and how much control you have over the mail server.
On Unix, you can use "procmail" for this. Procmail is a service which can intercept your mails and process them following rules.
If you can access your mail my IMAP, I suggest to look at the Python module imaplib.