[Exim] Re: URGENT: Mixed Case Address rules still needed fix…

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: George R. Kasica
CC: exim-users
Subject: [Exim] Re: URGENT: Mixed Case Address rules still needed fix - Exim-Files.zip
On Mon, 24 Dec 2001, George R. Kasica wrote:

> I hate to bother you with this directly, but I'm not getting a


I would normally add your message to those I get from the list, send you
an automated response, and deal with in due course.

But it's Christmas Eve, all my kids have gone out to the pub, there's
nothing much to watch on the tv for a while, and I'm feeling kind...

I haven't followed the problem. Is it that you have mixed-case logins?
And you still want to have caseless email handling?

Have you got my O'Reilly book? On pages 93-94 I describe exactly how to
handle this.

> >>>>locally_caseless is a global config option not a director option.
> >>>>So you'll want to do that outside of yoru directors.


Yes, that's step 1. You put that somewhere near the top of your config.
Having done that, local parts are handled case-insensitively.

Step 2 is to create a first director that turns incoming addresses into
the correct case for the remaining directors to handle. You need to
create a file for all those addresses which are to be handled
caselessly.

> >>>>Do you expect to receive mail for georgek@??? and
> >>>>GeorgeK@??? but CASeFuL@??? only gets mail for that address
> >>>>and no other caseless variation?
> >>>Exactly the problem. I'd say yes, that would be a good thing to do.


Your file will contain lines like this:

georgek: GeorgeK
caseful: CaseFUL

Then you create, as your *first* director, something like this:

sort_out_case:
  driver = smartuser
  new_address = \
      ${lookup{${lc:$local_part}}lsearch{/the/file}{$value@$domain}fail}


If you only want to do this for some domains, you may need to add a
"domains" setting. If you are handling different domains, you may need a
separate file for each domain, or you can look up $local_part@$domain
instead of just $local_part.

I hope you can see what is happening here. Because you have set
locally_caseless, $local_part will contain exactly what has been
supplied, with upper and lower case. However, in the director, the ${lc
operator will convert it into lower case as the key for the lookup. The
result of the lookup is the local part in the correct case. The
remaining directors should then be set up to handle caseful local parts.
If the local part does not match anything in the file, the "fail"
setting will cause the smartuser to decline, and the address is passed
on unaltered.

If you are going to have a lot of entries in the file (which you could,
of course, generate automatically from your passwd file by a simple
script) - say more than 30-50, you should investigate using a dbm or cdb
file instead of a linear search, for efficiency.

Happy Christmas,

Philip

--
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.