>>>>> On Fri, 1 Jul 1994 15:05:02 +0100, Andrew Smallbone
>>>>> <[EMAIL PROTECTED]> said:
Andrew> In the UK some mail addresses get reversed (I think this is something
Andrew> todo with passing from Janet to the Internet or Vice Versa) i.e:
Andrew> [EMAIL PROTECTED]
Andrew> to [EMAIL PROTECTED]
I think you want to use bbdb-canonicalize-net-hook somehow. I don't
know how you could know whether something like [EMAIL PROTECTED]
should be transformed to [EMAIL PROTECTED] though.
bbdb-canonicalize-net-hook
Documentation:
*If this is non-nil, it should be a function of one arg: a network address
string. Whenever the Insidious Big Brother Database "notices" a message,
the corresponding network address will be passed to this function first, as
a kind of "filter" to do whatever transformations upon it you like before
it is compared against or added to the database. For example: it is the case
that CS.CMU.EDU is a valid return address for all mail originating at a
machine in the .CS.CMU.EDU domain. So, if you wanted all such addresses to
be canonically hashed as [EMAIL PROTECTED], instead of as [EMAIL PROTECTED],
you might set this variable to a function like this:
(setq bbdb-canonicalize-net-hook
'(lambda (addr)
(cond ((string-match "\\`\\([^@]+@\\).*\\.\\(CS\\.CMU\\.EDU\\)\\'"
addr)
(concat (substring addr (match-beginning 1) (match-end 1))
(substring addr (match-beginning 2) (match-end 2))))
(t addr))))
You could also use this function to rewrite UUCP-style addresses into domain-
style addresses, or any number of things.
This function will be called repeatedly until it returns a value EQ to the
value passed in. So multiple rewrite rules might apply to a single address.