]> Pileus Git - ~andy/fetchmail/commitdiff
Added the `properties' option.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 20 Oct 1998 03:42:34 +0000 (03:42 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 20 Oct 1998 03:42:34 +0000 (03:42 -0000)
svn path=/trunk/; revision=2114

NEWS
conf.c
fetchmail.c
fetchmail.h
fetchmail.man
fetchmailconf
rcfile_l.l
rcfile_y.y
sample.rcfile

diff --git a/NEWS b/NEWS
index 2deccb6da97926bc9adae536ad6053153bf52400..907712390cb90acd1e9a60eb33341ffb24c55b59 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,13 +6,14 @@ fetchmail-4.6.3 ():
 * fetchmailconf now has access to information about which fetchmail
   compile-time options have been enabled, and uses it to control
   the choices in various panels.
+* Added `properties' option for extension scripts.
 
-There are 252 people on fetchmail-friends and 295 on fetchmail-announce.
+There are 250 people on fetchmail-friends and 294 on fetchmail-announce.
 
 fetchmail-4.6.2 (Fri Oct 16 12:49:30 EDT 1998):
 * Time out server open requests like we do reads.  This protects against
   buggy TCP/IP configurations that hang forever on a bad open.
-* The '--limit' option can now be used with daemon mode. The user is notfied
+* The '--limit' option can now be used with daemon mode. The user is notified
   that some messages are being skipped on the mail server; the user get
   notified by email that mentions all the messages being skipped (including
   their size). A -w/--warnings per-user option specifies at what intervals
diff --git a/conf.c b/conf.c
index 0c06b3e96341884fd47cda1113ae4ca04d370de9..4a544564a59940b87a051714319d959b7fe2eabd 100644 (file)
--- a/conf.c
+++ b/conf.c
@@ -322,6 +322,7 @@ void dump_config(struct runctl *runp, struct query *querylist)
        numdump("fetchlimit", ctl->fetchlimit);
        numdump("batchlimit", ctl->batchlimit);
        numdump("expunge", ctl->expunge);
+       stringdump("properties", ctl->properties);
        listdump("smtphunt", ctl->smtphunt);
        stringdump("smtpaddress", ctl->smtpaddress);
 
index 939eb3776bfcde8d5b7db349984f36376eb177bd..9e4d9240ec333cf03fe69c16e483f320a889633e 100644 (file)
@@ -774,6 +774,8 @@ static void optmerge(struct query *h2, struct query *h1, int force)
     FLAG_MERGE(fetchlimit);
     FLAG_MERGE(batchlimit);
     FLAG_MERGE(expunge);
+
+    FLAG_MERGE(properties);
 #undef FLAG_MERGE
 }
 
index 41d9da07c263a1cb16b5bb92ea4bca297e441c3e..18de9f6c70d63d97bd1d4b3d608619ff543ce79d 100644 (file)
@@ -224,6 +224,7 @@ struct query
     int        fetchlimit;             /* max # msgs to get in single poll */
     int        batchlimit;             /* max # msgs to pass in single SMTP session */
     int        expunge;                /* max # msgs to pass between expunges */
+    char *properties;          /* passthrough properties for extensions */
 
     struct idlist *oldsaved, *newsaved;
 
index f025e95472259b90ac22569e57a08b35311335ea..0e0dda7cd37dda0e23bb8b994554b99298f91c80 100644 (file)
@@ -803,9 +803,10 @@ spam message bodies.
 
 .SH THE RUN CONTROL FILE
 The preferred way to set up fetchmail is to write a
-\&\fI.fetchmailrc\fR file in your home directory.  When there is a
-conflict between the command-line arguments and the arguments in this
-file, the command-line arguments take precedence.
+\&\fI.fetchmailrc\fR file in your home directory (you may do this
+directly, with a text editor, or indirectly via \fIfetchmailconf\fR).
+When there is a conflict between the command-line arguments and the
+arguments in this file, the command-line arguments take precedence.
 .PP
 To protect the security of your passwords, when --version is not on
 your \fI~/.fetchmailrc\fR may not have more than 0600 (u=rw,g=,o=) permissions;
@@ -856,10 +857,38 @@ line.  (The `skip' verb allows you to experiment with test entries
 safely, or easily disable entries for hosts that are temporarily down.)
 .PP
 .SS Keyword/Option Summary
-Here are the legal server options.  Keyword suffixes enclosed in
+Here are the legal options.  Keyword suffixes enclosed in
 square brackets are optional.  Those corresponding to command-line
 options are followed by `-' and the appropriate option letter.
 
+Here are the legal global options:
+
+.TS
+l l lw34.
+Keyword        Opt     Function
+_
+set daemon     \&      T{
+Set a background poll interval in seconds
+T}
+set postmaster         \&      T{
+Give the name of the last-resort mail recipient
+T}
+set logfile    \&      T{
+Name of a file to dump error and status messages to
+T}
+set idfile     \&      T{
+Name of the file to store UID lists in
+T}
+set syslog     \&      T{
+Do error logging through syslog(3).
+T}
+set nosyslog   \&      T{
+Turn off error logging through syslog(3).
+T}
+.TE
+
+Here are the legal user options:
+
 .TS
 l l lw34.
 Keyword        Opt     Function
@@ -1027,11 +1056,8 @@ T}
 expunge        -e      T{
 Perform an expunge on every #th message (IMAP only)
 T}
-syslog         \&      T{
-Do error logging through syslog(3).
-T}
-nosyslog       \&      T{
-Turn off error logging through syslog(3).
+properties     \&      T{
+String value is ignored by fetchmail (may be used by extension scripts)
 T}
 .TE
 .PP
@@ -1209,6 +1235,12 @@ message headers and data into 8-bit data, making it easier to
 understand when reading mail. If your e-mail programs know how to
 deal with MIME messages, then this option is not needed.
 .PP
+The `properties' option is an extension mechanism.  It takes a string
+argument, which is ignored by fetchmail itself.  The string argument may be
+used to store configuration information for scripts which require it.
+In particular, the output of `--configdump' option will make properties
+associated with a user entry readily available to a Python script.
+.PP
 .SS Miscellaneous Run Control Options
 The words `here' and `there' have useful English-like
 significance.  Normally `user eric is esr' would mean that 
index 74302b906cae69ac3ed9ff7ae41ab6296e9cc516..d0e696742baafb9ab650b18e683f67f082f9f637 100755 (executable)
@@ -198,6 +198,7 @@ class User:
        self.fetchlimit = 0             # Max messages fetched per batch
        self.batchlimit = 0             # Max message forwarded per batch
        self.expunge = 1                # Interval between expunges (IMAP)
+        self.properties = None         # Extension properties
        User.typemap = (
            ('remote',      'String'),
            # leave out mailboxes and localnames
@@ -221,7 +222,8 @@ class User:
            ('warnings',    'Int'),
            ('fetchlimit',  'Int'),
            ('batchlimit',  'Int'),
-           ('expunge',     'Int'))
+           ('expunge',     'Int'),
+            ('properties',   'String'))
 
     def __repr__(self):
        str = "    "
@@ -271,6 +273,8 @@ class User:
            str = str + " batchlimit " + `self.batchlimit`
        if self.expunge != UserDefaults.expunge:
            str = str + " expunge " + `self.expunge`
+       if self.properties != UserDefaults.properties:
+           str = str + " properties " + `self.properties`
         str = str + "\n"
         trimmed = self.smtphunt;
         if trimmed != [] and trimmed[len(trimmed) - 1] == "localhost":
@@ -1229,14 +1233,16 @@ class UserEdit(Frame, MyWidget):
                      self.fetchlimit, '30').pack(side=TOP, fill=X)
             LabeledEntry(limwin, 'Max messages to forward per poll:',
                      self.batchlimit, '30').pack(side=TOP, fill=X)
-            LabeledEntry(limwin, 'Interval between expunges (IMAP):',
-                     self.expunge, '30').pack(side=TOP, fill=X)
+            if self.server.protocol in ('IMAP', 'IMAP-K4', 'IMAP-GSS'):
+                LabeledEntry(limwin, 'Interval between expunges (IMAP):',
+                             self.expunge, '30').pack(side=TOP, fill=X)
             limwin.pack(fill=X)
 
-            foldwin = Frame(rightwin, relief=RAISED, bd=5)
-            Label(foldwin, text="Remote folders (IMAP only)").pack(side=TOP)
-            ListEdit("New folder:", self.user.mailboxes, None, foldwin, None)
-            foldwin.pack(fill=X, anchor=N)
+            if self.server.protocol in ('IMAP', 'IMAP-K4', 'IMAP-GSS'):
+                foldwin = Frame(rightwin, relief=RAISED, bd=5)
+                Label(foldwin, text="Remote folders (IMAP only)").pack(side=TOP)
+                ListEdit("New folder:", self.user.mailboxes, None, foldwin, None)
+                foldwin.pack(fill=X, anchor=N)
 
         if mode != 'novice':
             rightwin.pack(side=LEFT)
index 4e57fdefb5fd526afea4a6ed4005bffb502742ca..2be9938b8a2881d2507cee59bdfc9c6c7bb0cce7 100644 (file)
@@ -64,6 +64,7 @@ monitor               { return MONITOR; }
 batchlimit     { return BATCHLIMIT; }
 fetchlimit     { return FETCHLIMIT; }
 expunge                { return EXPUNGE; }
+properties     { return PROPERTIES; }
 
 is             { return IS; }
 here           { return HERE; }
index 4bb5fdb4f733e4aff73e1341032c2be8a030b673..e86fe984c8eef3fbe9193e52984ceebf96ab841e 100644 (file)
@@ -63,7 +63,7 @@ extern char * yytext;
 %token SPAMRESPONSE PRECONNECT POSTCONNECT LIMIT
 %token NETSEC INTERFACE MONITOR
 %token IS HERE THERE TO MAP WILDCARD
-%token BATCHLIMIT FETCHLIMIT EXPUNGE
+%token BATCHLIMIT FETCHLIMIT EXPUNGE PROPERTIES
 %token SET LOGFILE DAEMON SYSLOG IDFILE INVISIBLE POSTMASTER WARNINGS
 %token <proto> PROTO
 %token <sval>  STRING
@@ -323,6 +323,8 @@ user_option : TO localnames HERE
                | FETCHLIMIT NUMBER     {current.fetchlimit = NUM_VALUE($2);}
                | BATCHLIMIT NUMBER     {current.batchlimit = NUM_VALUE($2);}
                | EXPUNGE NUMBER        {current.expunge    = NUM_VALUE($2);}
+
+               | PROPERTIES STRING     {current.properties = xstrdup($2);}
                ;
 %%
 
index c77f8cbd9cc4b443b37411aec5ac081a30f6a47e..cbd355930f8e285229a27592abda7b46ddc888e8 100644 (file)
@@ -75,6 +75,7 @@
 #   fetchlimit                -- must be followed by numeric msg fetch limit
 #   batchlimit                -- must be followed by numeric SMTP batch limit
 #   expunge                   -- must be followed by numeric delete count
+#   properties                -- must be followed by a string
 #
 # Legal protocol identifiers are
 #   pop2 (or POP2)