Re: Folder specific mailing, smart fcc-save-hooks, question.

2002-10-05 Thread Rafael C. Gawenda

* Ryan Sorensen [EMAIL PROTECTED] [2002-10-04 14:47 (13:28:38)]

 for i in $(ls $1);do\

 Now the question: Can I make these all case insensitive? For
 instance right now things to [EMAIL PROTECTED] and [EMAIL PROTECTED] or
 [EMAIL PROTECTED] are all treated differently, so with a mail sent
 to each of these addresses, only the one that matches the
 folder name including case sensitivity gets put there, the
 others go into record.

Change that line in you scripts with:

for i in $(ls $(echo $1 | tr '[A-Z]' '[a-z]'))

You can also use some perl magic, if tr isn't available on your
system.

-- 
Rafael C. Gawenda
 2:346/7.549@fidonet
Registered LiNUX user #93375


Computers are useless. They can only give you answers (Pablo
Picasso)



msg31575/pgp0.pgp
Description: PGP signature


Folder specific mailing, smart fcc-save-hooks, question.

2002-10-04 Thread Ryan Sorensen

I was recently unsubscribed (I am subscribed again now), saw a message
from Bernard Massot in the archives, asking about folder-specific macros
for 'm', to send mail to the right participants.

He thought it would be a good idea to send this to the list, so here it is,
with a bit more tacked on the end, along with a question at the end.

---
What I do is admittedly a little complicated.

Procmail automatically creates folders for lists (ask for the recipe if
you want, I got it off the net somewhere...) and puts them in folders
like this: (Snipped output, but explanatory enough...)

apex:~/.Mail/lists$ ls
[EMAIL PROTECTED]/ [EMAIL PROTECTED]/
[EMAIL PROTECTED]/

I also have save hooks to save to the email address of the sender, and save
sent messages to that folder, if it exists. [ed note: appended on bottom]

What you want is here:

# These use macros to specify a default recipient for the folders it
# makes sense for.
folder-hook . 'macro index m mail'
folder-hook . 'macro pager m mail'
source ~/.mutt/hooks/folder.recip.sh ~/.Mail/lists/|
source ~/.mutt/hooks/folder.recip.sh ~/.Mail/people/|

With me so far?

~~/.mutt/hooks/folder.recip.sh is the following:

#!/bin/sh

# Generates folder-hooks of the form:
#
# folder-hook DIRNAME 'macro index m mailDIRNAMEenter'


if [ $# -ne 1 ]; then
echo Usage: $0 name;
exit 127;
fi

for i in $(ls $1);do
echo folder-hook $i 'macro index m \mail$ienter\';
echo folder-hook $i 'macro pager m \mail$ienter\';
done

# end


And there we have it.

# These generate fcc-save-hooks for each address/list that already has
# its own folder.
source ~/.mutt/hooks/save.sh ~/.Mail/lists/|
source ~/.mutt/hooks/save.sh ~/.Mail/people/|

save-hook . =people/%a


~~/.mutt/hooks/save.sh is this:

#!/bin/sh

# Generates fcc-save-hooks of the form:
# fcc-save-hook DIRNAME =DIR/ADDRESS

if [ $# -ne 1 ]; then
echo Usage: $0 name;
exit 127;
fi

for i in $(ls $1);do\
echo fcc-save-hook $i =$(basename $1)/$i;\
done


And then that's done too. If you don't have a folder for a person, it
throws a message sent to them into record, if you do, it puts it in
there.


Now the question: Can I make these all case insensitive? For instance
right now things to [EMAIL PROTECTED] and [EMAIL PROTECTED] or [EMAIL PROTECTED] are all
treated differently, so with a mail sent to each of these addresses,
only the one that matches the folder name including case sensitivity
gets put there, the others go into record.

Thanks in advance.