Platoniq / decidim-install

A step-by-step guide to install Decidim on a production site
https://platoniq.github.io/decidim-install/
GNU Affero General Public License v3.0
54 stars 35 forks source link

SMTP authentication error (doh?) #59

Open Rggb opened 4 years ago

Rggb commented 4 years ago

I'm trying to configure a local Postfix installation to deliver mails.

All things work fine with an external service (eg. Google). After setting up the parameters needed by postfix for a particular organization:

image

mail delivery fails due to Net::SMTPAuthenticationError (in this example, using a newsletter):

E, [2020-07-07T17:21:43.722460 #15284] ERROR -- : [ActiveJob] [Decidim::Admin::NewsletterDeliveryJob] [4fc8365c-26bb-4745-9a76-558349a53097] Error performing Decidim::Admin::NewsletterDeliveryJob (Job ID: 4fc8365c-26bb-4745-9a76-558349a53097) from Async(newsletter) in 2058.78ms: Net::SMTPAuthenticationError (503 5.5.1 Error: authentication not enabled ): /var/www/.rbenv/versions/2.6.3/lib/ruby/2.6.0/net/smtp.rb:981:in check_auth_response' /var/www/.rbenv/versions/2.6.3/lib/ruby/2.6.0/net/smtp.rb:736:inauth_plain' /var/www/.rbenv/versions/2.6.3/lib/ruby/2.6.0/net/smtp.rb:728:in authenticate' /var/www/.rbenv/versions/2.6.3/lib/ruby/2.6.0/net/smtp.rb:565:indo_start' /var/www/.rbenv/versions/2.6.3/lib/ruby/2.6.0/net/smtp.rb:518:in `start'

Of course I don't need authentication using local Postfix server, while I (others) need it for external services.

I tried to play with config, without success. Suggestions?

microstudi commented 4 years ago

If you are using postfix, simply use sendmail as delivery method and comment everything else. This values won't be used (leave them empty)

In config/environments/production.rb:

imatge

Rggb commented 4 years ago

Thanks for your reply.

This will affect the entire environment afaik. so every organization will use sendmail method (in my config, the local Postfix), that's not what I'm trying to do.

By now I configured authentication for Postfix. I need an hack, will play with the code again in the future when worktime < lifetime ;)

Thanks again