Hello bats, on Fri, 5. Mar 2004 at 17:55:45 -0500 rich gregory wrote:
DH>> I'll give you a subject cleaner for now: > What does it do? it cleans the subject when you reply to a mail; removes multiple Re's and "was:" parts and the like at the end. For the mailinglist functionality I have the following: Getting mailinglist post address out of the headers with some hardcoded for specific lists (needs Python and plugin Pyxie): ----->8-------------------------------------------------------- %REM="get correct %TO for mailinglists"%- %PY(" from re import search r = re.search('([EMAIL PROTECTED])', '''%OTOLIST%OCCLIST''') if r: tb.set('To', r.group(1)) else: r = re.search('(?m)^List-Post: (?:<mailto:)?([EMAIL PROTECTED])>?\n', '''%HEADERS''') if r: tb.set('To', r.group(1)) ")%- %- ----->8-------------------------------------------------------- Then comes the subject cleaner (and a script wihch gets the proper fromaddr for myself). For the checking if writing to a mailinglist I use the following: ----->8-------------------------------------------------------- %REM="check if writing to mailinglist"%- %SetPattRegexp='^(.*)@'%- %_onML=%RegExpMatch=#%- %___%SetPattRegexp="(?ix)(tbudl|tbbeta|tbdev|tbtech)@thebat\.dutaint\.com |(tbot)@yahoogroups\.com |(otherlists)@domain\.com %___%REGEXPBLINDMATCH=%TOADDR%- %___%SUBPATT='0'#%- ----->8-------------------------------------------------------- After that I have a variable with the mailinglist name (the part that matched in the parenthesis) and can use that to generate a nice To:-headerentry fo ML posts: ----->8-------------------------------------------------------- %REM='Add mailinglist info to %TO'%- %IF:%_onML<>'':#%- %_oldTOAddr=%TOADDR%- %IF:'%FROMNAME'<>'%OFROMNAME':"%_newTO='%OFROMFNAME on '"%- %TO=''%TO="%_newTO%UPPER=%_onML <%_oldTOAddr>"%- %- %REM='No numbered RE: on mailinglists'%- %SINGLERE#%- %- %QInclude='#sig'%- ----->8-------------------------------------------------------- There is also sth to remove myself from CC-List (if I should do a reply-to-all): ----->8-------------------------------------------------------- %REM="___kill %FROMADDR from CCLIST; for reply-to-all____"%- %SETPATTREGEXP='(.*)?((,|^).*%FROMADDR[^\w]*)(.*)?'%- %REGEXPBLINDMATCH='%CCLIST'%- %IF:%SUBPATT='0'<>"":"%CC=''%CC=%SUBPATT='1'":''%- %IF:%SUBPATT='4'<>"":"%CC=%SUBPATT='4'":''%- %- ----->8-------------------------------------------------------- In general, I have a 'message' and 'reply' Quick-template (I do not forward often) that is simply included for my account's newmail/reply templates and I don't have special templates for folders, AB groups or contacts. These QTs both include (%QInclude) a #init template (which gets my fromaddr, the "hello name", checks if the mail should be signed/encrypted, ..) and afterwards generate the headers ("xx wrote:") and in case of reply cleans the subject, gets the proper address, ... That seems a bit complicated, but is in fact very good to maintain. And instead fiddling around with different AB templates I simply have to adjust my main templates a bit. HTH :) -- shinE! http://www.thequod.de ICQ#152282665 GnuPG/PGP key: http://thequod.de/danielhahler.asc Using The Bat! v2.04.7 on Windows XP 5.1 Build 2600 Service Pack 1 with POPFile 0.20.1 and avast Mar2004 (4.1.357). ________________________________________________ Current version is 2.04.7 | 'Using TBUDL' information: http://www.silverstones.com/thebat/TBUDLInfo.html