Announcement Announcement Module
No announcement yet.
Problems sending mails with mail.smtp.auth == false Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problems sending mails with mail.smtp.auth == false

    Hi there,

    I need some feedback from you.

    I want to send out emails without authentication from a trusted host.

      <si-mail:outbound-channel-adapter channel="outboundMail" host="" java-mail-properties="javaMailProperties"/>
      <util:properties id="javaMailProperties">
        <prop key="mail.smtp.auth">false</prop>
    In this case I'm using Spring Integration, but this doesn't matter.

    Underlining is the JavaMailSenderImpl with the following code

    // JavaMailSenderImpl.doSend
    transport = getTransport(getSession());
    transport.connect(getHost(), getPort(), getUsername(), getPassword());
    I see that my mail property is used to create the session, nevertheless I got an exception
    com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.1 Client was not authenticated
    Is it right, that JavaMailSenderImpl requires authentication (username and password), so that setting mail.smtp.auth to false has no effect?
    The JavaDoc of setUsername and setPassword suggest different.

    Can somebody turn on the light for me?

    Thanks a lot, Leif

  • #2
    No. JavaMailSenderImpl does not require authentication. I ran into this today. But removing that property all together fixed my issue. Ie, for my environment that didn't require authentication - all i needed was the host and port.


    • #3
      You are right, JavaMailSenderImpl DO NOT require authentication.

      The problem is that unauthorized mailing is only possible from our server, from a developer machine - where I tested it - it is not possible.
      So our ops guys clarified it.

      Thanks, Leif