YoRyan/mailrise

Advertise auth support in EHLO

bt90 opened this issue · 3 comments

bt90 commented

I'm basically hitting the problem described here:

https://marlam.de/msmtp/old-mailinglist/msg00533.html

I've configured mailrise to use basic authentication but msmtp fails to send mails.

EHLO as reported by msmtp -v:

<-- 220 a4360929b762 Mailrise 0.0.post1.dev1+gbf98187
--> EHLO localhost
<-- 250-a4360929b762
<-- 250-SIZE 33554432
<-- 250-8BITMIME
<-- 250-SMTPUTF8
<-- 250 HELP
--> QUIT
<-- 221 Bye
msmtp: the server does not support authentication
msmtp: could not send mail (account mailrise from /etc/msmtprc)

According to the msmtp devs the mailserver should report this as part of its EHLO.

Btw the Readme is a bit confusing. The example seems to be missing the auth key.

Readme:

smtp:
  basic:
    username: password
    AzureDiamond: hunter2

Correct config according to https://github.com/YoRyan/mailrise#configuration

smtp:
  auth:
    basic:
      username: password
bt90 commented

Redacted version of my current configuration:

configs:
  pushover:
    urls:
      - pover://xxxxxxxxxxxxx@yyyyyyyyyyyyyyyyyyy
smtp:
  auth:
    basic:
      pushover: xxxxxxxxxxxxx

But apparently authentication doesn't seem to enforced at all?

curl smtp://localhost:8025 --mail-rcpt pushover@mailrise.xyz -T - <<<"Test E-Mail"

This triggers a Pushbullet notification even if no credentials are provided.

Oops. Not only was the Readme wrong, but the authenticator mechanism wasn't actually hooked up to aiosmtpd.

Both of these bugs should be fixed now.

$ telnet localhost 8025
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 fb2c38e646e3 Mailrise 1.2.1.post1.dev25+gbf98187
EHLO example.com
250-fb2c38e646e3
250-SIZE 33554432
250-8BITMIME
250-SMTPUTF8
250-AUTH LOGIN PLAIN
250 HELP
QUIT
221 Bye
Connection closed by foreign host.
bt90 commented

Just updated my container and everything works as intended now 👍