foxcpp / maddy

✉️ Composable all-in-one mail server.
https://maddy.email
GNU General Public License v3.0
4.95k stars 239 forks source link

Empty "From" address results in rejection (5.1.7 Malformed address) #603

Closed Dr-Escher closed 7 months ago

Dr-Escher commented 1 year ago

Describe the bug

While testing, I noticed maddy rejects mails with an empty "From" address.

First I wasn't sure about this behaviour, but RFC 1123 section 5.2.9 seems to demand the acceptance of such mails, as described here: https://serverfault.com/questions/151955/why-an-empty-mail-from-address-can-sent-out-email/151987#151987

Also this was previously considered as an issue: https://github.com/foxcpp/maddy/issues/337#issuecomment-783570586

Steps to reproduce

In fact I triggered this using an Outlook auto responder, as mentioned in the answer linked above.

Log files

Log from the sender:

from=<>, size=6781, class=0, nrcpts=1, msgid=<8b89858fca64442bb6508d83a24aae3b@FRYP281MB2793.DEUP281.PROD.OUTLOOK.COM>, proto=ESMTP, daemon=SMTP_MTA
dsn=5.1.7, stat=User unknown(Reason from remote:550 5.1.7 Malformed address (msg ID = 6249bab0))

Log from the receiver (maddy):

smtp: MAIL FROM error (deferred) {"check":"spf","msg_id":"d7d27c21","rcpt":"redacted@for.privacy","reason":"Malformed address","smtp_code":550,"smtp_enchcode":"5.1.7","smtp_msg":"Malformed address"}

Configuration file

Default configuration except $(hostname) and $(primary_domain)

Environment information

Running latest maddy from git master on Debian Bookworm 12.0

foxcpp commented 7 months ago

Fixed in ab94e0b.