No internet connection
  1. Home
  2. Support

Email/SMTP config forces to define an user and password, should be optional

By Adrián López @adrianlzt
    2018-10-22 13:40:14.996Z

    We are using google as our relay SMTP server. We have to use that server without user and pass.

    Talkyard uses fake mail if user or password is not defined: https://github.com/debiki/talkyard/blob/67c11a773f8975410663b41723ece21214076e1c/app/debiki/Mailer.scala#L92

    Could we make that parameters optional?

    • 8 replies
    1. Can I ask, how do you authenticate against Google's mail server? Is it maybe by IP address, as described here?: https://support.google.com/a/answer/2956491?hl=en step 7:

      7. In the Authentication section, check one or both boxes to set an authentication method:

      • Only accept mail from the specified IP addresses—The system only accepts mail sent from these IP addresses as coming from your domains.
      • Require SMTP Authentication—Enforces the use of SMTP authentication to identify the sending domain. Using this option requires your clients to connect via TLS.

      Anyway since apparently controlling an IP address works fine, for authentication (i didn't know that until now when I read Google's docs), then yes the username and password settings should be made optional.

      (Thanks for linking to the source :- ) saved some time for me)

      1. AAdrián López @adrianlzt
          2018-10-22 14:41:12.644Z

          We use G-Suite, https://support.google.com/a/answer/176600?hl=en.

          I have checked to send an email using the server without auth and works correctly. I tried to use some random user/pass, but it does not work.

          Thanks!

          1. AAdrián López @adrianlzt
              2018-10-22 14:45:59.944Z

              BTW, any docs of how to build a custom image?

              I have been trying building with sbt, docker, etc but no luck

              1. Hmm I should document that better, and add a DOCKER_REPOSITORY variable in .env.

                I started a separate topic about this: How do you want to build and upgrade, yourself? — maybe you'd like to reply over there, with your thoughts?

              2. In reply toadrianlzt:

                I tried to use some random user/pass, but it does not work.

                What's the error message?

                If you type docker-compose logs app > dc-logs-app.txt, maybe you'd like to send me a private message with the dc-logs-app.txt file? Then i can check for error messages.

                Anyway, I'll do this in the next release, if there's no username: https://stackoverflow.com/a/19115844/694469, that is:

                • I'll do: properties.put("mail.smtp.auth", "false");

                • And I'll skip this line:

                  apacheCommonsEmail.setAuthenticator(new acm.DefaultAuthenticator(userName, password))
                1. AAdrián López @adrianlzt
                    2018-10-24 08:48:16.755Z

                    Sorry, I was meaning that trying to send an email to google SMTP with random user/pass was not working

              3. Progress
                with handling this problem
              4. @KajMagnus marked this topic as Planned 2018-10-23 04:08:49.035Z.
              5. Now I've removed the requirement to specify username and password. Your server should have auto-upgraded to the new version, 0.6.15, with this fixed, last night (Tue –> Wed). Would you like to see if works for you? (Sorry this took long. That's because there were some other changes that took long to review & test, in the same release.)

                1. @KajMagnus marked this topic as Started 2018-11-07 12:24:05.626Z.
                2. @KajMagnus marked this topic as Done 2018-11-09 15:37:39.207Z.