Skip to content

Commit

Permalink
target/smtp: Do not attempt STARTTLS by default for LMTP connections
Browse files Browse the repository at this point in the history
Security for LMTP should be configured using Implicit TLS that is
already supported using tls:// scheme for addresses. TLS
is also unnecessary for most LMTP use-cases (Unix sockets, etc) and
attempting STARTTLS caused issues in the past (see foxcpp#309).
  • Loading branch information
foxcpp committed Dec 6, 2020
1 parent 27ec4fa commit 889ba39
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/man/maddy-targets.5.scd
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,10 @@ Enable verbose logging.
Advanced TLS client configuration options. See *maddy-tls*(5) for details.

*Syntax*: attempt_starttls _boolean_ ++
*Default*: yes
*Default*: yes (no for target.lmtp)

Attempt to use STARTTLS if it is supported by the remote server.
If TLS handshake fails, connection will be retried without STARTTLS use
If TLS handshake fails, connection will be retried without STARTTLS
unless 'require_tls' is also specified.

*Syntax*: require_tls _boolean_ ++
Expand Down
1 change: 0 additions & 1 deletion docs/third-party/dovecot.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Add `local_mailboxes` block to maddy config using `target.lmtp` module:
```
target.lmtp local_mailboxes {
targets unix:///var/run/maddy/dovecot-lmtp.sock
attempt_starttls no
}
```

Expand Down
2 changes: 1 addition & 1 deletion internal/target/smtp/smtp_downstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (u *Downstream) Init(cfg *config.Map) error {
var targetsArg []string
cfg.Bool("debug", true, false, &u.log.Debug)
cfg.Bool("require_tls", false, false, &u.requireTLS)
cfg.Bool("attempt_starttls", false, true, &u.attemptStartTLS)
cfg.Bool("attempt_starttls", false, !u.lmtp, &u.attemptStartTLS)
cfg.String("hostname", true, true, "", &u.hostname)
cfg.StringList("targets", false, false, nil, &targetsArg)
cfg.Custom("auth", false, false, func() (interface{}, error) {
Expand Down

0 comments on commit 889ba39

Please sign in to comment.