Announcement Announcement Module
Collapse
No announcement yet.
Problems sending mails with mail.smtp.auth == false Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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.

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

    Underlining is the JavaMailSenderImpl with the following code

    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
    Code:
    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 s.th. 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.

    Comment


    • #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

      Comment

      Working...
      X