[GH-ISSUE #26] Issue warning if configured to require authentication but not TLS #9

Closed
opened 2026-02-26 18:32:56 +03:00 by kerem · 1 comment
Owner

Originally created by @JonathonReinhart on GitHub (Mar 31, 2021).
Original GitHub issue: https://github.com/decke/smtprelay/issues/26

smtpd only allows authentication if the session is operating with TLS:

	if session.server.Authenticator != nil && session.tls {
		extensions = append(extensions, "AUTH PLAIN LOGIN")
	}

This is probably a safe requirement.

However, the following configuration will never work:

$ ./smtprelay -listen ':2525' -allowed_users userlist.txt

If authentication is required (-allowed_users), then a -listen w/o tls:// or starttls:// should be forbidden.

Originally created by @JonathonReinhart on GitHub (Mar 31, 2021). Original GitHub issue: https://github.com/decke/smtprelay/issues/26 `smtpd` [only allows authentication if the session is operating with TLS](https://github.com/chrj/smtpd/blob/v0.3.0/smtpd.go#L415-L417): ```go if session.server.Authenticator != nil && session.tls { extensions = append(extensions, "AUTH PLAIN LOGIN") } ``` This is probably a safe requirement. However, the following configuration will never work: ``` $ ./smtprelay -listen ':2525' -allowed_users userlist.txt ``` If authentication is required (`-allowed_users`), then a `-listen` w/o `tls://` or `starttls://` should be forbidden.
kerem closed this issue 2026-02-26 18:32:56 +03:00
Author
Owner

@decke commented on GitHub (Mar 31, 2021):

Yeah that is true and it is to avoid sending authentication credentials over an unencrypted channel. So this combination does not make sense and we should make a small note in the config text that allowedUsers requires encrypted channel and error out early if this combination is used.

<!-- gh-comment-id:811437812 --> @decke commented on GitHub (Mar 31, 2021): Yeah that is true and it is to avoid sending authentication credentials over an unencrypted channel. So this combination does not make sense and we should make a small note in the config text that allowedUsers requires encrypted channel and error out early if this combination is used.
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/smtprelay#9
No description provided.