Re: Reply-to-All ignoring myself

2003-03-10 Thread Januk Aggarwal
Hello Jonathan,

On Sunday, March 9, 2003 at 17:16 GMT -0600, authorities charged
Jonathan Angliss [JA] for writing:

JA> I don't want the email to always CC itself to everybody but me...
JA> I only want that to happen on certain events, like when I hit
JA> reply-to-all.

JA> Okay so I think I can probably get away with replacing %OTOLIST
JA> and %OCCLIST with %TOLIST, and %CCLIST... Logical assumption for
JA> me... I was wrong. It doesn't work at all... nothing gets changed.
JA> So what's wrong with it? Or is there any easier safer way?

What about looking for multiple addresses in the %TOLIST and %CCLIST?

Just a guess, but maybe something like:

%IF:_%SetPattRegExp="@.*@"%RegExpMatch="%TOLIST%CCLIST"_<>__:_%-
%CC=''%TO=''%TO='%SETPATTREGEXP=''^(.*?)[,;]?\s*$''%-
%REGEXPMATCH=''%-
%SETPATTREGEXP="^(.*?[,;]?)([^,;]*%-
([EMAIL PROTECTED]|[EMAIL PROTECTED])?%-
[^,;]*[,;]?)(.*)$"%-
%REGEXPBLINDMATCH="%OTOLIST, %OCCLIST"%-
%SUBPATT="1"%SUBPATT="4"'''_

Note this is not tested...

-- 
Thanks for writing,
 Januk Aggarwal




 Current version is 1.61 | "Using TBTECH" information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Reply-to-All ignoring myself

2003-03-10 Thread Jonathan Angliss
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Monday, March 10, 2003, Januk Aggarwal wrote...

JA>> I don't want the email to always CC itself to everybody but me...
JA>> I only want that to happen on certain events, like when I hit
JA>> reply-to-all.

JA>> Okay so I think I can probably get away with replacing %OTOLIST
JA>> and %OCCLIST with %TOLIST, and %CCLIST... Logical assumption for
JA>> me... I was wrong. It doesn't work at all... nothing gets changed.
JA>> So what's wrong with it? Or is there any easier safer way?

> What about looking for multiple addresses in the %TOLIST and %CCLIST?

There would be multiple addresses in the %TOLIST/%CCLIST if I hit
reply-to-all... :)

> Just a guess, but maybe something like:

> %IF:_%SetPattRegExp="@.*@"%RegExpMatch="%TOLIST%CCLIST"_<>__:_%-
> %CC=''%TO=''%TO='%SETPATTREGEXP=''^(.*?)[,;]?\s*$''%-
> %REGEXPMATCH=''%-
> %SETPATTREGEXP="^(.*?[,;]?)([^,;]*%-
> ([EMAIL PROTECTED]|[EMAIL PROTECTED])?%-
> [^,;]*[,;]?)(.*)$"%-
> %REGEXPBLINDMATCH="%OTOLIST, %OCCLIST"%-
> %SUBPATT="1"%SUBPATT="4"'''_

Oh, I think I see where you're going... check to see if there are
multiples, then reclean the address list... will give that a test.

- --
Jonathan Angliss
([EMAIL PROTECTED])

-BEGIN PGP SIGNATURE-
Comment: Fingerprint: 676A 1701 665B E343 E393  B8D2 2B83 E814 F8FD 1F73

iQA/AwUBPmxixiuD6BT4/R9zEQJvcwCgsIhLrrUy+X4oexgIU+usy0U9YJMAn3SM
ynZNecekvrAnciS+C9Kxahpc
=fTLu
-END PGP SIGNATURE-



 Current version is 1.61 | "Using TBTECH" information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Problems with Januk's "Recipient list -Indented" macro

2003-03-10 Thread Nick Dutton
Hello,

Here's a problem that I've brought over from tbudl...

I can't seem to make this macro work at all.  It seems to me that
print_recipient2 is not getting called properly, or at all; the lines after
To, CC, BCC are always blank.

I've tried inserting text markers to indicate QT calls, and have never seen
the ones for print_recipient2 appear.

I'm no regex expert, but I'm clear on what's going on up until line 3 of
print_recipient - please, no laughing!

My three templates, directly ctrl-c & ctrl-v'd from TB, are below my sig.:

Thanks in advance,

--  
 Nick

Using TheBat!: v1.62i on Windows XP 5.1 Build 2600
Service Pack 1

Nick's QTs

- print-
> -=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> From: %FromName <%FromAddr>
> Date: %ODateEn %OTimeLongEn  %IF:'%TOLIST'<>'':'
>   To: %COMMENT="%TOLIST; "%QINCLUDE="print_recipient"' %IF:'%CCLIST'<>'':'
>   Cc: %COMMENT="%CCLIST; "%QINCLUDE="print_recipient"' %IF:'%BCCLIST'<>'':'
>  Bcc: %COMMENT="%BCCLIST; "%QINCLUDE="print_recipient"'
>  Subject: %Subj
> -=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> %text
> -=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

 end print ---

- print_recipient -

> %COMMENT="10
> %COMMENT"%-
> %SETPATTREGEXP="(?s-m)^\s{10}(.*)\n$"%-
> %REGEXPMATCH="%QINCLUDE='print_recipient2'"%-
> %COMMENT=""%-

- end print_recipient -


- print_recipient2 -

> %REM='
>   Recipient List reformating routine.
>   recipient2 = recursive engine QT
>   
>   Written by Januk Aggarwal
>   November 2002
> '%-
> %-
> %IF:'%-
> %SETPATTREGEXP=$(?i)^\d*\n(\"?(.*?)\"?\s*(\<.*?\>)?\s*[;,]\s*)$%-
> %REGEXPMATCH=$%COMMENT$'<>'':'%-
> %-
> %SETPATTREGEXP="\s{%-
> %-%-%SETPATTREGEXP=#^\d*#%-
> %-%-%REGEXPMATCH=#%COMMENT#}"%-
> %REGEXPMATCH=""%-
> %-
> %SETPATTREGEXP=$(?i)^\d*\n((\"?(.*?)\"?\s*(\<.*?\>)?)\s*[;,]\s*)?$%-
> %REGEXPBLINDMATCH=$%COMMENT$%-
> %SUBPATT=$2$
> %-
> %COMMENT=_%-
> %-%-%SETPATTREGEXP=$(?i)^(\d*\n)(\"?(.*?)\"?\s*(\<.*?\>)?\s*[;,]\s*)?(.*)$%-
> %-%-%REGEXPBLINDMATCH=$%COMMENT$%-
> %-%-%SUBPATT=$1$%-
> %-%-%SUBPATT=$5$_%-
> %-
> %QINCLUDE="print_recipient2"'%-

- end print_recipient2 -




 Current version is 1.61 | "Using TBTECH" information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Problems with Januk's "Recipient list -Indented" macro

2003-03-10 Thread Miguel A. Urech
Hello Nick,

> I can't seem to make this macro work at all. It seems to me that
> print_recipient2 is not getting called properly, or at all; the
> lines after To, CC, BCC are always blank.

I use a slightly modified version of Januk's macro for my reply
templates. It works quite well except in a couple of "peculiar"
occasions. Have you seen the thread in this list with subject
"Question about Januk's print template" that starts with
 ?

-- 
Best regards,

Miguel A. Urech (El Escorial - Spain)
Using The Bat! v1.62i



 Current version is 1.61 | "Using TBTECH" information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Reply-to-All ignoring myself

2003-03-10 Thread Januk Aggarwal
Hello Jonathan,

On Monday, March 10, 2003 at 04:02 GMT -0600, Jonathan Angliss [JA]
pressed random keys until the following was produced:

JA> There would be multiple addresses in the %TOLIST/%CCLIST if I hit
JA> reply-to-all... :)

Exactly.  And even if there weren't, you wouldn't need to run the
clean up routine anyway.

JA> Oh, I think I see where you're going... check to see if there are
JA> multiples, then reclean the address list...

Yep.  That's the idea.

JA> will give that a test.

Good luck.

-- 
Thanks for writing,
 Januk Aggarwal





 Current version is 1.61 | "Using TBTECH" information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Problems with Januk's "Recipient list -Indented" macro

2003-03-10 Thread Januk Aggarwal
Hello Nick,

On Monday, March 10, 2003 at 14:53 GMT +, something compelled Nick
Dutton [ND] to inscribe:

ND> I can't seem to make this macro work at all. It seems to me that
ND> print_recipient2 is not getting called properly, or at all; the
ND> lines after To, CC, BCC are always blank.

ND> I've tried inserting text markers to indicate QT calls, and have
ND> never seen the ones for print_recipient2 appear.

All of your templates seem to be ok.  The only thing I can think of to
check is that you've spelled the names of the templates correctly.  If
you want to change the names, just make sure you make the change in
the templates that call the others as well.

Note:  I updated the regexps in print_recipient2 to handle special
cases a bit better.  You may want to try it:

=[Begin print_recipient2]=
%REM='
  Recipient List reformating routine.
  recipient2 = recursive engine QT
  
  Written by Januk Aggarwal
  November 2002
'%-
%-
%IF:'%-
%SETPATTREGEXP=$(?i)^\d*\n\s*((\"?)(.*?)\2\s*(\<.*?\>)?\s*[;,]\s*)$%-
%REGEXPMATCH=$%COMMENT$'<>'':'%-
%-
%SETPATTREGEXP="\s{%-
%-%-%SETPATTREGEXP=#^\d*#%-
%-%-%REGEXPMATCH=#%COMMENT#}"%-
%REGEXPMATCH=""%-
%-
%SETPATTREGEXP=$(?i)^\d*\n\s*(((\"?)(.*?)\3\s*(\<.*?\>)?)\s*[;,]\s*)?$%-
%REGEXPBLINDMATCH=$%COMMENT$%-
%SUBPATT=$2$
%-
%COMMENT=_%-
%-%-%SETPATTREGEXP=$(?i)^(\d*\n)\s*((\"?)(.*?)\3\s*(\<.*?\>)?\s*[;,]\s*)?(.*)$%-
%-%-%REGEXPBLINDMATCH=$%COMMENT$%-
%-%-%SUBPATT=$1$%-
%-%-%SUBPATT=$6$_%-
%-
%QINCLUDE="print_recipient2"'%-
=[ End  print_recipient2]=

ND> I'm no regex expert, but I'm clear on what's going on up until
ND> line 3 of print_recipient - please, no laughing!

I don't have time to explain it right now, but I'll try to post a
summary tonight or tomorrow (unless someone else wants to take a shot
at it.) 

-- 
Thanks for writing,
 Januk Aggarwal

Using The Bat! 1.63 Beta/7 under Windows 98 4.10 Build  A

Is it OK to use the AM radio after noon?





 Current version is 1.61 | "Using TBTECH" information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re[2]: Problems with Januk's "Recipient list -Indented" macro

2003-03-10 Thread Nick Dutton
Januk,

Monday, March 10, 2003, 6:24:58 PM, you wrote:

ND>> I can't seem to make this macro work at all. It seems to me that
ND>> print_recipient2 is not getting called properly, or at all; the
ND>> lines after To, CC, BCC are always blank.

ND>> I've tried inserting text markers to indicate QT calls, and have
ND>> never seen the ones for print_recipient2 appear.

JA> All of your templates seem to be ok.  The only thing I can think of to
JA> check is that you've spelled the names of the templates correctly.  If
JA> you want to change the names, just make sure you make the change in
JA> the templates that call the others as well.

All names carefully cut&pasted from template body.

JA> Note:  I updated the regexps in print_recipient2 to handle special
JA> cases a bit better.  You may want to try it:

Success!  I'd managed to convince myself that print_recipient2 wasn't
getting called - so I was pleasantly surprised to find that your new one
works a treat.

ND>> I'm no regex expert, but I'm clear on what's going on up until
ND>> line 3 of print_recipient - please, no laughing!

JA> I don't have time to explain it right now, but I'll try to post a
JA> summary tonight or tomorrow (unless someone else wants to take a shot
JA> at it.) 

Although I'm still intrigues about how this failed, this really is just out
of idle curiosity, please don't waste your time on this unless you're
feeling _very_ public-spirited...

Thanks again, and now I'm off to change my reply templates like Miguel,

-- 
 Nick

Using TheBat!: v1.62i on Windows XP 5.1 Build 2600
Service Pack 1




 Current version is 1.61 | "Using TBTECH" information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re[2]: Problems with Januk's "Recipient list -Indented" macro

2003-03-10 Thread Nick Dutton
Hello Miguel,

Monday, March 10, 2003, 5:33:00 PM, you wrote:

>> I can't seem to make this macro work at all. It seems to me that
>> print_recipient2 is not getting called properly, or at all; the
>> lines after To, CC, BCC are always blank.

MAU> I use a slightly modified version of Januk's macro for my reply
MAU> templates. It works quite well except in a couple of "peculiar"
MAU> occasions. Have you seen the thread in this list with subject
MAU> "Question about Januk's print template" that starts with
MAU>  ?

Yes, I did check this out.  I've never been able to get this to work at all
and didn't want to "dirty" your thread.  I'd pretty much convinced myself
that print_recipient2 wasn't being called.  So imagine my surprise when, for
completeness, I go to step 4 and everything worked!

Thanks for the lead, I've closed off the other thread too,

-- 
 Nick

Using TheBat!: v1.62i on Windows XP 5.1 Build 2600
Service Pack 1




 Current version is 1.61 | "Using TBTECH" information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Problems with Januk's "Recipient list -Indented" macro

2003-03-10 Thread Miguel A. Urech
Hello Januk,

> Note: I updated the regexps in print_recipient2 to handle special
> cases a bit better. You may want to try it:

Just FYI, no intent to put any "pressure" or "hurry" on you. I have
tested this updated print_recipient2 and, in my case, I don't see any
change, I still get the failures where I did before.

-- 
Best regards,

Miguel A. Urech (El Escorial - Spain)
Using The Bat! v1.62i



 Current version is 1.61 | "Using TBTECH" information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: [eng] Re: Question about Januk's print template

2003-03-10 Thread Januk Aggarwal
Hello Miguel,

On Sunday, March 9, 2003 at 11:31 GMT +0100, an infinite number of
monkeys posting as Miguel A. Urech [MAU] typed:

Sorry I somehow missed your reply.

>> 1. Change the reply template so you remove the % symbol from in front
>>of the %COMMENT macros and the %QINCLUDE macros.
>>  - This will show us what exactly is being sent to print_recipient

MAU>  To: COMMENT="[EMAIL PROTECTED]; "QINCLUDE="print_recipient"
MAU>  To: COMMENT=""Miguel A. Urech" <[EMAIL PROTECTED]>; "QINCLUDE="print_recipient"

Ok, so this makes me confident that the problem is not in your main
template.

>> 2. Reverse the change above and change the last line in the
>>print_recipient template from %COMMENT="" to %COMMENT
>>  - This will let us see how far the print_recipient2 template got
>>before failing.

MAU>  To:
MAU>  To:

This one is less clear.  I don't really understand why it should be
blank.  Can you please try the following two modifications (one at a
time would be good) to your print_recipient template:

,- [ My print_recipient ]
| %COMMENT="9
| %COMMENT"%-
| %COMMENT
| %SETPATTREGEXP="(?s-m)^\s{9}(.*)\n$"%-
| %REGEXPMATCH="%QINCLUDE='print_recipient2'"%-
| %COMMENT=""%-
`-

,- [ My print_recipient ]
| %COMMENT="9
| %COMMENT"%-
| SETPATTREGEXP="(?s-m)^\s{9}(.*)\n$"%-
| REGEXPMATCH="%QINCLUDE='print_recipient2'"%-
| %COMMENT=""%-
`-

>> 3. Reverse the change above and *add* a line to the beginning of the
>>print_recipient2 template. Put the macro %COMMENT="" as the very
>>first line of print_recipient2.
>>  - This will tell us if print_recipient2 is being called, and what
>>text is being sent to be processed.

MAU>  To:
MAU>  To:

This is just mystifying, however, in light of Nick's problem &
solution, I don't know what to think.

>> 4. Reverse the change above and change print_recipient2 to the
>>following.
>>  - This template is slightly modified to ignore some more
>>white space.  The modification shouldn't hurt the performance
>>of the template in normal cases.

MAU>  To:
MAU>  To:

Hmm, and you said that this is the same output as when you run the
version in ...  The plot
thickens.

Sorry I'm making you do all these changes, but I can't replicate the
problem over here to test my brainstorming ideas.

One thing we should consider: if this is only happening on two
specific messages, _but_NO_others_, we may be beating a dead horse here.
It would be nice to understand why the templates failed, but we should
think about how much time is being spent versus how widespread the
problem is.

-- 
Thanks for writing,
 Januk Aggarwal





 Current version is 1.61 | "Using TBTECH" information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Problems with Januk's "Recipient list -Indented" macro

2003-03-10 Thread Januk Aggarwal
Hello Nick,

On Monday, March 10, 2003 at 18:37 GMT +, legend has it that Nick
Dutton [ND] recited the incantation:

ND> Success!  I'd managed to convince myself that print_recipient2 wasn't
ND> getting called - so I was pleasantly surprised to find that your new one
ND> works a treat.

Well, I'm confused, but glad it works.

ND>>> I'm no regex expert, but I'm clear on what's going on up until
ND>>> line 3 of print_recipient - please, no laughing!

Ok, here is a short summary.  I'm only going to analyze one regexp,
but three are basically the same, just the subpatterning is
*slightly* different.

,- [ Begin ] -
| %IF:'%-
| %SETPATTREGEXP=$(?i)^\d*\n\s*((\"?)(.*?)\2\s*(\<.*?\>)?\s*[;,]\s*)$%-
| %REGEXPMATCH=$%COMMENT$'<>'':'%-
`- [  End  ] -

This segment just looks to see if there is anything of interest in the
comment field.

,- [ Begin ] -
| %SETPATTREGEXP="\s{%-
| %-%-%SETPATTREGEXP=#^\d*#%-
| %-%-%REGEXPMATCH=#%COMMENT#}"%-
| %REGEXPMATCH=""%-
`- [  End  ] -

This is a nested set of regexps.  The outer one is trying to match a
certain number of spaces. It is the inner regexp which actually
finds (from the comment field) how many spaces it should look for.
This is how the variable indenting is done.

The outer pattern being constructed is, \s{##}, where ## is some user
specified number.  This just looks for ## whitespace characters.

The inner regexp is ^\d* which just looks for as many digits at the
beginning of the string as possible.

,- [ Begin ] -
| %SETPATTREGEXP=$(?i)^\d*\n\s*(((\"?)(.*?)\3\s*(\<.*?\>)?)\s*[;,]\s*)?$%-
| %REGEXPBLINDMATCH=$%COMMENT$%-
| %SUBPATT=$2$
`- [  End  ] -

This section finds and outputs the first entry from the list.

,- [ Begin ] -
| %COMMENT=_%-
| %-%-%SETPATTREGEXP=$(?i)^(\d*\n)\s*((\"?)(.*?)\3\s*(\<.*?\>)?\s*[;,]\s*)?(.*)$%-
| %-%-%REGEXPBLINDMATCH=$%COMMENT$%-
| %-%-%SUBPATT=$1$%-
| %-%-%SUBPATT=$6$_%-
`- [  End  ] -

This section finds the number of spaces, and everything after the
first entry in the list and sets the comment field to this new value.
So in effect we've just removed the first list item.

,- [ Begin ] -
| %QINCLUDE="print_recipient2"'%-
`- [  End  ] -

Lather. Rinse. Repeat.

The regexp that makes this whole thing tick:

,- [ Begin ] -
| (?i)^(\d*\n)\s*((\"?)(.*?)\3\s*(\<.*?\>)?\s*[;,]\s*)?(.*)
`- [  End  ] -

(?i) - Make search case INsensitive.  It's not really needed in
   this expression.

^(\d*\n) - Look for all digits on the first line (that's where we set
   the number of spaces to be used for indenting). In this
   case we're storing that number in subpattern 1.

\s*  - Ignore excess space at the beginning of the first entry.

Now we have a little more complex section.  The section itself
consists of the following fragment which is where we extract the first
entry from the list.  This entry (if found) is stored in subpattern 2.

,- [ Begin ] -
| ((\"?)(.*?)\3\s*(\<.*?\>)?\s*[;,]\s*)?
`- [  End  ] -

More specifically:

(- Start subpattern 2.

(\"?)- See if there is an opening quote mark and store the result
   in subpattern 3.  If there is no quote mark, subpattern 3
   will be empty.  Capturing this seemingly insignificant
   character in it's own subpattern is useful later.

(.*?)- Find the minimum number of any characters that will allow
   the rest of the regexp to be matched.  Store these
   characters in subpattern 4.  Note this is the name portion
   if one exists.

\3   - Find the same thing as subpattern 3.  So this requires us
   to have a closing quote mark if there was an opening quote
   mark.  If there wasn't one, then this command does nothing.
   An example where this is important (I don't know if this is
   RFC approved, but...):
   "Someone <[EMAIL PROTECTED]>" <[EMAIL PROTECTED]>
   This can be matched two ways if we didn't require the
   closing quote.  Remember, the alternative was \"? which
   looked for the existence of a quote mark, but it wasn't
   required, even if there was an opening quote mark.

\s*  - Find (and ignore) any whitespace between the name and
   address.  Note that these spaces will appear in subpattern
   2. 

(\<  - In subpattern 5 find a less than symbol (ie the opening to
   an address.)

.*?  - Find the minimum number of any characters.

 \>  - Find a greater than symbol (ie the closing of an address).
 
)?   - Find 1 or 0 instances of the address.  We want this because
   sometimes we'll only have the bare e-mail address.  In that
   case, subpattern 4 (the name subpattern) already captured
   the interesting bit.

\s*  - Ignore excess whitespace

[;,]\s*  - Find the list delimiter (a colon or a comma)