I currently use port 587 with the submission protocol to send emails on my server. I am wondering if there is a way to utilize Authelia with an MSA. I tried using the following, but to no avail:
notifier:
smtp:
username: myuser
password: mypassword
secure: true
host: 'smtp.myserver.com'
port: 587
sender: [email protected]
Which resulted in the following errors on the mail-server side:
Jan 4 00:39:59 myserver postfix/smtpd[31524]: connect from <ommitted>[ip]
Jan 4 00:39:59 myserver postfix/smtpd[31524]: lost connection after UNKNOWN from <ommitted>[ip]
Jan 4 00:39:59 myserver postfix/smtpd[31524]: disconnect from <ommitted>[ip]
While a successful connection (sent using gmail connecting to my port 587) looks like below:
Jan 4 00:51:47 myserver postfix/smtpd[31585]: connect from google.com[209.85.217.54]
Jan 4 00:51:47 myserver postfix/smtpd[31585]: 3C436467E5: client=mail-vs1-f54.google.com[209.85.217.54], sasl_method=<ommitted>, sasl_username=from-email-addr.com
Jan 4 00:51:47 myserver postsrsd[31592]: srs_forward: <from-email-addr.com> rewritten as <[email protected]>
Jan 4 00:51:47 myserver postfix/cleanup[31591]: 3C436467E5: message-id=<[email protected]>
Jan 4 00:51:47 myserver opendkim[9563]: 3C436467E5: DKIM-Signature field added (s=mail, d=myserver.com)
Jan 4 00:51:47 myserver postfix/qmgr[15986]: 3C436467E5: from=<[email protected]>, size=1389, nrcpt=1 (queue active)
Jan 4 00:51:47 myserver postfix/smtpd[31585]: disconnect from mail-vs1-f54.google.com[209.85.217.54]
Jan 4 00:51:47 myserver postfix/smtp[31594]: 3C436467E5: to=<[email protected]>, relay=dst.dst.com[1.2.3.4]:25, delay=0.22, delays=0.14/0.02/0.03/0.03, dsn=2.0.0, status=sent (250 Ok)
Jan 4 00:51:47 myserver postfix/qmgr[15986]: 3C436467E5: removed
Hello @zjzeit , Authelia is using nodemailer as the library to handle notifications so you should check the following doc: https://nodemailer.com/smtp/.
From what I can understand, port 587 is for secure connections. Is your server configured with TLS?
Port 587 is normally not encrypted to start with, that would be 465, 587 might use starttls after establishing the connection, according to the nodemailer doc, something like this should work
notifier:
smtp:
username: myuser
password: mypassword
secure: false
host: 'smtp.myserver.com'
port: 587
sender: [email protected]
secure is false as 587 is not using tls to start with, it's actually the first example on the linked nodemailer page.
That fixed it! Thank you. I use STARTTLS, but incorrectly considered it "secure: true"