I have a app through which you can send a email. This is done using the following code. The sender account is an GMail account:
GMailSender sender = new GMailSender("sender#gmail.com", "APassword");
sender.sendMail(subject,
emailText[0],
"sender#gmail.com",
receiver);
The receiver varies for testing reasons, but should be static when the app is released. Now I started testing by sending mails to another GMail account, which works fine. I continued to send mails to an outlook account, also works great. When I send emails to a private email server though, I get the following message back:
Delivery to the following recipient failed permanently:
booking#reciever.de
Technical details of permanent failure: Google tried to deliver your
message, but it was rejected by the server for the recipient domain
reciever.de by mail.reciever.de. [88.198.227.52].
The error that the other server returned was: 554 5.7.1
: Recipient address rejected: Relay access denied
I tried to figure out what this error is about, yet I have not completely understood it. I guess GMail doesn't like the receiver domain and thus does not send the email.(?)
How can I get GMail to ignore it and send it anyway? Or what else can I do to send the email? I would also greatly appreciate if someone could elaborate on this error, it is not much or well explained on the internet yet.
Related
While sending the schedule meeting email from our java application, we are creating an ics file through MIME object and its works perfect
While cancelling the meeting the mail is bounced back with 550-5.7.26
Error Description from Google
550, "5.7.26", " Unauthenticated email from domain-name is not accepted due to domain's DMARC policy. Please contact the administrator of domain-name domain. If this was a legitimate mail please visit Control unauthenticated mail from your domain to learn about the DMARC initiative. If the messages are valid and aren't spam, contact the administrator of the receiving mail server to determine why your outgoing messages don't pass authentication checks.
Below is the only difference in ics file between schedule and cancel email
For schedule invite
METHOD:REQUEST
STATUS:CONFIRMED
For cancel invite
METHOD:CANCEL
STATUS:CANCELLED
All other attributes(ORGANIZER, ATTENDEE ) are same
ORGANIZER;CN=<name>#<domain>.net:mailto:<name>#<domain>.net
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=<name>#gmail.com:mailto:<name>#gmail.com
And interesting things are:
We are facing this issue only when we send through MS graph((through MIME object)) not with
normal SMTP config
And the same ics is working fine for the outlook recipient. its not
working only for gmail recipient
Can any one please help with the below queries?
Why its only failing for cancel invite and working for sent invite?
What is the difference in consuming ics between request and cancel methods?
Why its working with normal SMTP config and not with MS
graph?
Why its not working only for gmail recipient?
I have been using the Email Sender (Java) in my GAE as described here and it works fine:
https://cloud.google.com/appengine/docs/java/mail/usingjavamail
I have cloned my project to a 2nd App engine (different branding, etc.) and suddenly the Email being sent doesn't arrive (yes, I've checked spam folders :-)
I created the new GAE and uploaded the code with no changes to my Email class. I added the sender email (xxx.yyy#gmail.com) to the Email API authorized senders list and they are also an Admin on the project. I get no errors or exceptions from the java code, and it says the email has been sent fine, but it never arrives. I even changed the email address to something random and I correctly received the following exception:
<stderr>: javax.mail.SendFailedException: Send failure (javax.mail.MessagingException: Illegal Arguments (java.lang.IllegalArgumentException: Unauthorized Sender: Unauthorized sender))
The code works in one project, but not the other. What am I missing? Do I need to add an API?
Thank you.
Tim
Does your sender email address fit the following :
For security purposes, the sender address of a message must be one of
the following:
The Gmail or Google Apps Account of the user who is currently signedin
Any email address of the form anything#appname.appspotmail.com or
anything#appalias.appspotmail.com
Any email address listed in the Cloud Platform Console under Email API Authorized Senders
source : https://cloud.google.com/appengine/docs/python/mail/
According to your question : just check if the sender email is in App Engine > Settings > Email API authorized senders
Well it now works!
I raised the issue with Google on the back of their Issue 12786: Emails appear sent - outside world disagrees
and pointed out that their spam filter was being a little too aggressive. How can an app send emails with links back to the xxx.appspot.com if the spam filter is blocking them.
Tested it again this morning and it works
Thanks Google (aka Chris)!
I got a requirement which I don't know how to get started.
Requirement:
The application will send emails to clients (using org.springframework.mail.javamail.JavaMailSender) with same "from email address" as support#mydomain.com. Also the email content will have some hidden information such as client_id. If the client reply back to that email, I need to get that as an HttpServletRequest to a Servlet so that I can process it.
EDIT:
This web application does not have google app engine setup, but my requirement is matching similar to this link.
When someone replies to the mail you sent him that mail will go to the POP3 server configured for your domain. From this SMTP server you can read this mail using the Java Mail API. You can have a Spring timer task to keep polling this mailbox after every few seconds.
I would look at the below resources to see how to read mail from the POP3 server -
Using JavaMail API -
http://metoojava.wordpress.com/2010/03/21/java-code-to-receive-mail-using-javamailapi
Using Spring -
http://blog.solidcraft.eu/2011/04/read-emails-from-imap-with-spring.html
Better and popular solution is to have a link in your email and asking user to click it and asking specifically not to reply to this email (from address can be noreply#domain.com)
For getting a servlet call in an email reply, you need to use
http://javamail.kenai.com/nonav/javadocs/com/sun/mail/pop3/package-summary.html
Keep polling for new emails in your reply address(for eg support#domain.com) using POP, and when new email comes trigger a httprequest(HttpClient? ).
On a related note you can add user_id and similar stuff using a + in reply email address
For eg support#domain.com and support+uid_21_catid_32#domain.com will deliver to same address. Everything after + is ignored. But you will get this info in reply email event as to address and decide on who is the user.This could be a security concern for sure if not properly implemented.
Is there a way to check if the email was received or not using spring framework's email functions?
You cannot check whether the email was received. The only errors that will be reported are those during the send process (Invalid address, wrong smtp credentials, etc.).
After the mail gets sent by the mail server, things are out of your business. What you could do is to check whether the receivers mail server sends a bounce (blocked email. full post box, no such address, etc.). But that have to happen outside the mail send process. Most likely done by a scheduler some time after emails have been sent.
i tried to send sms via smpp account and i have the error "'Must be bound to the SMSC before sending packets", the problem is that when i checked the smpp account, it is connedcted to SMSC, but sms are not going, sms are not even reaching the SMSC. please can somebody help
the SMPP protocol expects the client to
connect
authenticate
you need to identify the user credentials for your client and authenticate before you send an sms to the Gateway.
also, the SMPP server must be returning an error code, it would be helpful to post that as well.