ninthwalker / NowShowing

Generates an email and web page of Plex recently added content
MIT License
73 stars 8 forks source link

Unauthenticated relay in SMTP <other> profile broken-ish #83

Open cchiapusio opened 6 years ago

cchiapusio commented 6 years ago

When setting SMTP profile to and clearing the username and password fields, the username and password entries need to be removed from cfg/advanced.yaml to allow unauthenticated SMTP relay to function.

provider: "other" address: "192.168.10.8" port: "25" username: "" password: "" report: interval: "7"

503 5.5.1 Error: authentication not enabled ["/usr/lib/ruby/2.3.0/net/smtp.rb:998:in check_auth_response'", "/usr/lib/ruby/2.3.0/net/smtp.rb:753:inauth_plain'", "/usr/lib/ruby/2.3.0/net/smtp.rb:745:in authenticate'", "/usr/lib/ruby/2.3.0/net/smtp.rb:580:indo_start'", "/usr/lib/ruby/2.3.0/net/smtp.rb:521:in start'", "/usr/lib/ruby/gems/2.3.0/gems/mail-2.6.3/lib/mail/network/delivery_methods/smtp.rb:112:indeliver!'", "/usr/lib/ruby/gems/2.3.0/gems/mail-2.6.3/lib/mail/message.rb:252:in deliver!'", "/var/lib/nowshowing/mailReport.rb:99:insendMail'", "/usr/local/sbin/combinedreport:452:in main'", "/usr/local/sbin/combinedreport:460:in

'"]

If you remove the null username and password entries:

provider: "other" address: "192.168.10.8" port: "25" report: interval: "7"

the email can be delivered:

I, [2018-08-03T12:46:33.480761 #1239] INFO -- : Script complete. Ran in 35.272127017 seconds

Aug 3 12:46:33 vega postfix/smtpd[10592]: connect from kong.home[192.168.10.4] Aug 3 12:46:33 vega postfix/smtpd[10592]: 523B018A9A1E: client=kong.home[192.168.10.4] Aug 3 12:46:33 vega postfix/cleanup[10595]: 523B018A9A1E: message-id=5b6486e948589_4d72af4a6b4513425955@9de3e737d2a5.mail Aug 3 12:46:33 vega postfix/qmgr[9520]: 523B018A9A1E: from=<>, size=175180, nrcpt=1 (queue active) Aug 3 12:46:33 vega postfix/smtpd[10592]: disconnect from kong.home[192.168.10.4] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5 Aug 3 12:46:34 vega postfix/smtp[10596]: 523B018A9A1E: to=me@someplace.else, relay=smtp.gmail.com[2607:f8b0:4002:c02::6c]:587, delay=1.2, delays=0.14/0.02/0.24/0.79, dsn=2.0.0, status=sent (250 2.0.0 OK 1533314794 f6-v6sm2110098ywc.21 - gsmtp) Aug 3 12:46:34 vega postfix/qmgr[9520]: 523B018A9A1E: removed

ninthwalker commented 6 years ago

Interesting. Thanks for the Feedback. This was designed for authenticated smtp relays, but you aren't the first to want to use it on a local non-auth'd server. I'll have to look into redesigning the way that part works a bit. Thanks for letting me know.