[Dovecot] order of variable modifiers
I'd like to have a variable substitute take the domain name part, lower case it, MD5 it, and take a 2-character substring of that. Would that be like %2MLd ? The documentation on the H hash modifier described reversing with R, but expresses it at %3RHu which seems to me like it would be reversing the hash result rather than the user string.
I'm undecided about MD5 vs. hash, and could go either way. But I was thinking:
mail_location = /data/mail/%2MLd/%Ld/%2MLn/%Ln
On Fri, 2010-04-23 at 09:37 -0400, Phil Howard wrote:
I'd like to have a variable substitute take the domain name part, lower case it, MD5 it, and take a 2-character substring of that. Would that be like %2MLd ?
It's left to right, so "%2LMd". The substring is a special case, it's always done to the finalized string.
The documentation on the H hash modifier described reversing with R, but expresses it at %3RHu which seems to me like it would be reversing the hash result rather than the user string.
Maybe the text is a bit confusing. It does first reverse the string and then take a hash of it. I guess the main problem here is that the %H hash function is pretty bad, and doesn't give as good output values if the end of the string is always the same.
participants (2)
-
Phil Howard
-
Timo Sirainen