SMTP Error code received doesn't match LMTP response
@foxcpp is already working on this.
Since Jan 10, 2026.
Assessment
This issue has not been assessed yet.
Description
Description of the bug
When using LMTP to offload IMAP delivery to dovecot for instance, the return SMTP error code is not properly propagated
Steps to reproduce
- Send a mail to a maddy server that is using LTMP with dovecot as an IMAP backend
- Let's say the recipient is exceeding its quota with this email
- Maddy receives back a 552 error code from Dovecot
- The error code is rewritten to 452 as per: https://github.com/foxcpp/maddy/blob/master/internal/smtpconn/smtpconn.go#L121 (for legacy support of too many RCPT If I got it correctly ?)
- The sender mail server receives back a 554 (Internal server error) from maddy
Log files
Here is a log of the different interaction (sender/receiver/dovecot). Both sender and receiver are running a maddy server:
https://hastebin.milkywan.fr/aqupejalus.pl
Configuration file
Simple LMTP taget:
target.lmtp local_mailboxes {
targets unix:///var/run/dovecot2/lmtp-maddy
}
Called by a simple message pipeline:
msgpipeline local_routing {
destination $(local_domains) {
modify {
replace_rcpt &local_rewrites
}
deliver_to &local_mailboxes
}
default_destination {
reject 550 5.1.1 "User doesn't exist"
}
}
For dovecot:
service lmtp {
unix_listener lmtp-maddy {
mode = 0600
user = maddy
}
}
Environment information
- maddy version: 0.8.1 linux/amd64 go1.24.6
- Dominant language
- Go
- Stars
- 6.1k
- Forks
- 327
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from foxcpp/maddy
-
ready-for-release
Difficulty 1/5 Under an hour Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 25/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
bug invalid
-
bug
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
bug group: validation priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
codecheckers/chekhov#51 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100