roehling / postsrsd

Postfix Sender Rewriting Scheme daemon
325 stars 39 forks source link

553 5.1.7 local part too long in #108

Closed yctn closed 1 year ago

yctn commented 4 years ago

we are using postsrd. but something we receive this error duo to the mail adres being to long:

SRS0=fGv9=BC=a.ccdefghijklmn.com=bounce-4IDNASXYtY_FG21s4IoV1XzCfCtHkb2RZY_qdGZ8Q-6A@email.mydomin.com

is there a way to adjust de size of the rewrit? or limit it?

pfarikrispy commented 4 years ago

bump

roehling commented 4 years ago

Unfortunately, there's not much I can do. The stateless SRS implementation needs to store the full original email address in the localpart, plus additional 13 characters overhead, which limits the effective email address length that can be forwarded to 51 characters. If you're desperate, you could shave off another one or two characters by dangerously weakening the embedded hash and/or timestamp, but that's it.

A possible alternative would be an SRS implementation that stores the original email address in a database, together with a random secret token, and uses that secret token in the email address. This would resolve the address length problem, but as you need to keep the database entry for at least a few hours, you'd open yourself up to a denial of service attack where a malicious sender could spam you with thousands or millions of random email addresses to exhaust your available database storage.

roehling commented 3 years ago

I'll close this for now. Maybe I'll revisit this problem at a later date and add an optional database backend to PostSRSd.

roehling commented 3 years ago

On second thought, I'll leave it open as a reminder for myself.

pfarikrispy commented 3 years ago

Thanks for your thoughts and suggestions! We'll look it as well and see if we can work around the issue

roehling commented 1 year ago

https://github.com/roehling/postsrsd/releases/tag/2.0.0a1