Results 1 to 3 of 3

Thread: Problems sending mails with mail.smtp.auth == false

  1. #1
    Join Date
    Sep 2005
    Posts
    26

    Default 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. #2
    Join Date
    Dec 2008
    Location
    New York City
    Posts
    134

    Default

    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. #3
    Join Date
    Sep 2005
    Posts
    26

    Default

    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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •