C
C
CyberKastaneda2013-08-28 15:16:58
Google
CyberKastaneda, 2013-08-28 15:16:58

Letters sent using JavaMailSender from amazon EC2 to google mail (aliases) do not reach

Hello!
I've never been involved in the web, but I had to work here. The problem is the following - we have a virtual machine (ubuntu) on amazon EC2 (so far without a domain name), a site (java + JSP) is spinning there, an apache server that proxies everything tomcat, a Postfix mail server. From Java I send mail, which is successfully sent and reaches the addressee, but letters do not arrive at a certain address (alias). Not even to a specific address, but to any alias with a specific domain name. People (to whom mail does not reach) have mail on google, just with their domain name (I can’t describe it in more detail, because I don’t understand this myself, but I think webmasters will understand what it is about).
I think the code is not needed, but just in case, I send mail like this:

       MimeMessagePreparator preparator = new MimeMessagePreparator() {
       @Override
       public void prepare(MimeMessage mimeMessage) throws Exception {
                MimeMessageHelper message = new MimeMessageHelper(mimeMessage,true,"UTF-8");
                message.setFrom(emailFrom);
                message.setTo(emailManager);
                message.setSubject(emailToManagerSubject);
 
                Map<String,Object> model = new HashMap<String, Object>();
                // заполняю model
 
                String text = VelocityEngineUtils.mergeTemplateIntoString(
                        velocityEngine,
                        "email_tpl.vm",
                        "utf-8",
                        model
                );
                message.setText(text, true);
            }
        };
 
        try
        {
            this.mailSender.send(preparator);
        }
        catch (MailException ex)
        {
            logger.error("some text");
        }
}

where mailSender and velocityEngine are declared like this
    @Autowired
    JavaMailSender mailSender;
 
    @Autowired
    VelocityEngine velocityEngine;

Yes, even - letters reach any other mailing address (not an alias) with the same domain name, the problem is with aliases. Aliases with a different domain name (I tried to create a so-called "group" in my gmail account) also get through. In the Postfix logs (/var/log/mail.log) everything is fine, the mail is sent without errors, but the recipient claims that there are no letters.

Here, I do not know where to dig, maybe someone will have some ideas?

update
At sending by means of sendmail letters reach.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
spmbt, 2013-08-28
@spmbt

Have you looked at the responses of the Google mail daemons? They may consider your mail to be insecure or spam. Perhaps they do not condescend to answer. When sending my emails to similar Google aliases from a certain domain, there were also no responses at first, as far as I remember. Then one day it turned out:

<<< 552-5.7.0 This message was blocked because its content presents a potential
<<< 552-5.7.0 security issue. Please visit support.google.com/mail/bin/answe
<<< 552-5.7.0 r.py?answer=6590 to review our message content and attachment content
<<< 552 5.7.0 guidelines. i8si322258lam.42 - gsmtp
554 5.0.0 Service unavailable

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question