Look at you go - along with the mkdir and rmdir stuff you might want to
consider functions to manage Maildir folders and shared folders... then
folder creation and subscription could be automated?

Just a random thought.

m/

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Courier
User
Sent: Wednesday, October 01, 2003 9:21 AM
To: [EMAIL PROTECTED]
Subject: [courier-users] Proposing new functions for maildropfilter


There are some functions that I would like to see in maildrop's
filtering language, and I'm wondering how you folks feel about me
writing these functions and then supplying patches for maildrop?

If there is enough interest in this, I will start work on this right
away in my spare time.  I would then have a prototype ready within a
week or so.

The following group of functions are intended to replace the
following type of construct:

  INVOKE=`/bin/test -f $FILE 1>/dev/null 2>&1`
  if ( $RETURNCODE != 0 )
  {
    ... etc. ...
  }

The following alternative functions avoid the overhead of forking a
subprocess, setting up a pipe to capture its output, and then
discarding the output once the command finishes ... all to simply
query the process's return code for a true/false value that could be
gotten much more quickly and easily via a system library function,
and in some cases, to get a simple side-effect.

  isfile(item)
    returns 1 if the named item is an existing file;
    otherwise returns 0

  isdir(item)
    returns 1 if the named item is an existing directory;
    otherwise returns 0

  isreadable(item)
    returns 1 if the named item is an existing and readable
    file or directory; otherwise returns 0

  iswritable(item)
    returns 1 if the named item is an existing and writable
    file or directory; otherwise returns 0

  isexecutable(item)
    returns 1 if the named item is an existing and executable
    file, or a directory into which it is possible to cd;
    otherwise returns 0

  unlink(file)
    tries to remove the file; returns 1 if successful,
    otherwise 0

  rename(old, new)
    tries to rename the old item to have the new name;
    has the same semantics as the Unix rename function;
    returns 1 on success, otherwise 0

  rmdir(dir)
    tries to remove the directory; has the same semantics
    as the Unix library function in that it will only
    remove an empty directory; returns 1 if successful,
    otherwise 0

  mkdir(dir, mode)
    tries to make an empty directory; has the same
    semantics as the Unix library function in that the
    you have to specify the mode of the directory that's
    going to be created; returns 1 if successful, otherwise 0


--
 Courier User
 [EMAIL PROTECTED]


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to