procmail
[Top] [All Lists]

Re: maintaining a list that procmail can check

2001-07-06 16:35:37
I explained,

| >As I said, I'm looking for the most efficient way.  The check has to be
| >done for every incoming message,

Sean followed up,

| EVERY incoming message, or only those determined to have some file
| attachment (or whatever it is you're checking for)?

Every incoming message to my account on that server.

| >The sequence is not important; new names could be inserted after line 1.

| Ah, but my suggestion was that the code for performing the inserion could
| copy the input file until it reached the "insert-before" anchor point, make
| the insertion, and continue copying (including the anchor).  The point is
| that nothing else in the file needs to be looked for if you already have a
| unique component which conveniently marks the end of the list you're
| manipulating.

If we were to do insertions after the first line, the utility could look for
the first newline, make the insertion, and continue copying without looking
at anything else in the file.

| You do have a C compiler available on the server, right?  We can hash out
| what is necessary to do this, and I could scrawl up some code for you.

There's a compiler, but I couldn't ask anyone else to go to that much effort
over this.

| If you're calling ln, or rm, you're calling an external process.

Only to add or delete, not to see whether a name is currently listed!

| How often do you expect to CHANGE the links?

They need to reflect the folder names chosen in my .procmailrc, because proc-
mail will be handing mail over to a program that puts messages onto the IMAP
server, and I need to handle things differently if an IMAP folder exists from
when it doesn't already exist.  Procmail cannot query the IMAP server for a
current listing of existing folders, so I need a mirror listing (the mail
delivery servers can see my home directory tree), visible to procmail, of
my existing IMAP folders at any given time.  When procmail determines that
a message should be delivered to a nonexistent folder, it has to invoke the
program that passes mail to the IMAP server with not only the proper folder
name but also the instruction to create it if it doesn't exist, plus procmail
has to update its own mirror list.  When I create or remove an IMAP folder in
my client when I'm not logged into a shell at that provider, I need a way to
update procmail's mirror list, and my first thought was a control message
mailed to my address there, which procmail would catch.

So I would change the links when ...

1. I join a mailing list or otherwise give procmail and IMAP a new
   destination folder name;
2. Any routine to create names dynamically is triggered; or
3. I quit a mailing list or stop using the procmail routine that wrote to a
   given folder name; or
4. I decide that a folder isn't going to be needed for a long time and my
   IMAP client shouldn't need to check it for new mail at every poll.

| >All the names will begin with a period so as not to mess
| >up ls output unless I specify -a to see them.
| 
| Hmm, I'd think putting them into a subdir might be slightly cleaner.

That's 4 Kb of disk use bloat for another directory!  OK, so I'm not near my
disk quota there, but I can't shake old habits.  Right now the links are in
~/.mailspool, the default folder for non-IMAP email, and I have that full of
other dotfiles that are symlinks to various files I need quick access to
while I'm cd'ed in there.  I could have another existing directory such as
~/News do double duty.

| As for the thanks - well, thanks, but it's a given amongst those who
| frequent this forum that input is appreciated.

Glad you understand.  But my first reply had basically argued against every
point that you made while you were trying to help me with my problem, without
a word of gratitude from me interspersed.  It came off sounding like a whiny
complaint.  That was just plain wrong of me.

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail