mirror of
https://github.com/axllent/mailpit.git
synced 2026-04-26 16:56:00 +03:00
[GH-ISSUE #277] SMTP relay "command: unencrypted connection" #183
Labels
No labels
awaiting feedback
bug
docker
documentation
enhancement
github_actions
invalid
pull-request
question
stale
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/mailpit#183
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @koushyk on GitHub (Apr 15, 2024).
Original GitHub issue: https://github.com/axllent/mailpit/issues/277
I'm getting an error on trying to relay, MP_SMTP_RELAY_ALLOW_INSECURE does not help
time="2024/04/15 08:19:55" level=error msg="[smtp] error sending message: error response to AUTH command: unencrypted connection"
vars I'm using
MP_MAX_MESSAGES : 2000
MP_SMTP_RELAY_AUTH : plain
MP_SMTP_RELAY_HOST : postfix-mta.devsvc.svc.cluster.local
MP_SMTP_RELAY_PORT : 25
MP_SMTP_RELAY_PASSWORD : *****
MP_SMTP_RELAY_USERNAME : *****
MP_SMTP_RELAY_ALLOW_INSECURE: true
@axllent commented on GitHub (Apr 15, 2024):
Is your postfix running with StartTLS? Sorry for the edit, I see you did set
MP_SMTP_RELAY_STARTTLS- but can you verify your SMTP server is using StartTLS?@koushyk commented on GitHub (Apr 15, 2024):
I've tried multiple combinations, postfix is not using startts
@axllent commented on GitHub (Apr 15, 2024):
That is very strange. Are you able to connect to that postfix server with any other SMTP client? The insecure setting you added is for when the TLS certificate cannot be validated, but you say your server isn't using TLS. It looks to me though as if your server is actually using TLS.
Please try connect to it using another SMTP client to verify it is connectable, and then report back?
@axllent commented on GitHub (Apr 16, 2024):
Actually, I think you're just missing the
MP_SMTP_RELAY_STARTTLS: falsein your config. Postfix, like all modern SMTPD servers requires StartTLS with authentication enabled, however this can be manually disabled (as you must have done). Mailpit's SMTP relay client will therefore try use StartTLS by default when using authentication... unless you specifically tell it not to.Please let me know if that solves it for you?
@koushyk commented on GitHub (Apr 16, 2024):
we are using maildev as a previous solution and it connects fine, I thought MP_SMTP_RELAY_STARTTLS: false is default.
I will doublecheck everything one more time
@axllent commented on GitHub (Apr 16, 2024):
Sorry, you are correct, the default is false. I have just done some testing here and am able to replicate the error
[smtp] error sending message: error response to AUTH command: unencrypted connection. This is an error being returned from the server stating that StartTLS is actually required to use authentication (as I previously suggested), so yes, your server is using StartTLS for authenticated connections, most likely with a self-signed/generated certificate when you installed postfix.The above config should do what you want (it works for me). I can't speak for maildev, but I assume it possibly just upgrades (and ignores the self-signed? certificate) by default.
@github-actions[bot] commented on GitHub (Apr 24, 2024):
This issue has been marked as stale because it has been open for 7 days with no activity.
@github-actions[bot] commented on GitHub (Apr 28, 2024):
This issue was closed because there has been no activity since being marked as stale.
@koushyk commented on GitHub (May 8, 2024):
when I've added
MP_SMTP_RELAY_ALLOW_INSECURE: true
MP_SMTP_RELAY_STARTTLS: true
I've got
time="2024/05/08 13:35:55" level=error msg="[smtp] error relaying message: error creating StartTLS config: 502 5.5.1 Error: command not implemented"
maybe its related with https://pkg.go.dev/net/smtp#PlainAuth
@axllent commented on GitHub (May 9, 2024):
Can you please
telnet postfix-mta.devsvc.svc.cluster.local 25and then typeEHLOand paste the response?I really cannot tell why or where this is failing in your setup, but I have not encountered this issue anywhere before. It would be ideal if you could provide me with a docker script to start my own postfix server which also fails in the same way so that I can further debug the issue and find the cause and/or a fix.
@koushyk commented on GitHub (May 9, 2024):
250-PIPELINING 250-SIZE 20480000 250-VRFY 250-ETRN 250-AUTH PLAIN 250-ENHANCEDSTATUSCODES 250-8BITMIME 250-DSN 250 CHUNKINGI will try to reconfigure postfix
@koushyk commented on GitHub (May 10, 2024):
After adding to postfix config:
smtpd_use_tls = yes smtpd_tls_cert_file = /etc/pki/tls/certs/public.cert smtpd_tls_key_file = /etc/pki/tls/private/private.key smtpd_tls_security_level = mayemails started to work fine, but I'm sure that it should work without tls anyway.
here is my config without tls