Dmytro Alieksieiev via Postfix-users: > On 19/04/2025 13:09, Viktor Dukhovni via Postfix-users wrote: > > > On 19/04/2025 13:09, Viktor Dukhovni via Postfix-users wrote: > > To rewrite envelope recipients, use "virtual_aliases", not > > "recipient_canonical_maps". > > Hi Viktor, sorry, but for me this not solution. The whole point of SRS > is to utilize own domain in envelope as result - own SPF and be on track > with bounces, if I would not need this - I would not use SRS. > > Also discussion moved from "Localpart length validation" to SRS, but SRS > itself or it's configuration was not my question in this thread - it > works as intended. SRS just picked this input validation issue in > ATM I don't see it in > Postfix at this part of logic which can be abused in other places too, > not just with SRS. First comes to mind is MemCache and key name limit of > 250 bytes.
Email address lengths are complicated. According to John C. Klensin in https://www.rfc-editor.org/errata/eid1003 the maximum length of a reverse (MAIL FROM) or forward (RCPT TO) path is 256 octets (254 excluding the <>) and that should determine the maximum email address length. This is more than the 320 octets that we get from adding up the localpart (64), @, and domain (255). Whether the limit is 320 or 254, that is more than the MemCache key limit of 250 octets. That means that MemCache can't handle email addresses with a length that is allowed by RFC 5321. So, if you want to use SRS and memcached then it may be preferable to reject addresses that won't fit some application-dependent upper bound. There is no universal limit that solves all problems, because what a system can handle depends on the local configutation details. For the Postfix memcache client, maybe we can improve Postfix behavior by pretending that keys longer than 250 octets don't exist, instead of returning an error. The memcache client already pretends that 'too large' data blobs don't exist (that is, it does not store them). Wietse _______________________________________________ Postfix-users mailing list -- postfix-users@postfix.org To unsubscribe send an email to postfix-users-le...@postfix.org