Before I reinvent a wheel, I thought I'd ask if anyone has a pointer
to a procmail recipe (using some clever MATCH magic perhaps or
maybe with a bit of additional sed) that would extract all the
address portions, minus comments, from a set of commented addresses?
I'd expect to do something like:
* To:[ ]*\/[^ ].*
RAWTO = $MATCH
then somehow render RAWTO into CLEANTO. Then do the same for Cc:
and any other fields I cared about.
This exercise gets non-trivial if you want to exclude comments with
addresses in them, so if I could steal someone else's ideas, I'd have
more time to work on non-wheel-inventing things. :) Surely this is
a common need, but I couldn't find anything on the procmail archive.
I think I've reached the point where further searching would take
longer than just diving in and writing it myself.
My current motivation is to just count the real addresses, so
* 1^1 RAWTO ?? regex-that-ignores-comments
would work. Alternatively, something like:
* 1^1 RAWTO ?? regex-that-counts-@
* -1^1 RAWTO ?? regex-that-counts-(_at_)-only-within-comments
would also do the trick. Counting, I'm sure, is much easier than
a full cleaning job, but if possible, it might be useful someday
to have the clean address set.
I'm certainly not looking for someone to write this for me; I'm just
looking for a pointer to someone's example page that has already done
procmail mailing list