Hello bats, on Wed, 14. Apr 2004 at 16:13:16 +0200 Krzysztof Kudlacik wrote:
>> I have not exactly what you're looking for, but this is sth that I've >> put up to kill %FROMADDR from the recipient list (TO + CC) - useful when >> I reply-to-all and don't want to send it also to myself: > It works nice ;) > But it has one disadventage - it kills only one e-mail address which is > defined in properties of account. It fails if I use also some aliases. Can > it be improved to clear also some other aliases not mentioned directly in > account properties? I'd use a python script for that. First you'll need the TBPyxie (http://www.google.com?q=tbpyxie) plugin and can then use something like this: ----->8-------------------------------------------------------- %Py(" from re import sub from string import strip cclist = '''%CCLIST''' cclist = '''huibla, [EMAIL PROTECTED], daniel [EMAIL PROTECTED], [EMAIL PROTECTED], hoschi, ''' killlist = ['bla', 'oschi'] for kill in killlist: cclist = sub( r'[^,^]*' + kill + r'[^,$]*,?', '', cclist ) cclist = strip(cclist, ', ') ")%- %CC=''%CC='%PYX("cclist")'%- ----->8-------------------------------------------------------- That's quite powerful. We put the %CCLIST into a python variable. killlist is a list of strings that should be killed. We loop through every string in this list and do a re.sub on that. First param is a regex pattern to match, second is the replacement and the third param is the string we want to be replaced. After looping we strip commas and spaces from cclist, then delete the old %CC and put the new in there instead. Please note: the whole thing is very "hungry". everything put into killlist will kill an address, if it's in there. So if you want to kill every address on a specific domain you should set killlist = ['@domain.tld']. btw: the 'r' in front of a string simply means: raw string, so backslashes won't be replaced. I think we would not need it here, but for regexps you should always use raw strings. HTH, I replaced my old CCLIST-killer with this one, too.. :) -- shinE! GnuPG/PGP key: http://thequod.de/danielhahler.asc lifted with The Bat! 2.05 Beta/14 on Windows XP Service Pack 1. ________________________________________________________ http://www.silverstones.com/thebat/TBUDLInfo.html
