]> Pileus Git - ~andy/fetchmail/blobdiff - fetchmail.h
Better behavior on line hits.
[~andy/fetchmail] / fetchmail.h
index f9de3d203f955c3737340f11f53fa4972b85920f..89891d5477ee69caab5517e1a8ccfc16cb633285 100644 (file)
@@ -90,6 +90,7 @@ struct hostdata               /* shared among all user connections to given server */
     int preauthenticate;               /* preauthentication mode to try */
     int timeout;                       /* inactivity timout in seconds */
     char *envelope;                    /* envelope address list header */
+    char *qvirtual;                    /* prefix removed from local user id */
     flag skip;                         /* suppress poll in implicit mode? */
     flag dns;                          /* do DNS lookup on multidrop? */
     flag uidl;                         /* use RFC1725 UIDLs? */
@@ -138,8 +139,12 @@ struct query
     int        limit;                  /* limit size of retrieved messages */
     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 */
 
     /* unseen, previous state of mailbox (initially from .fetchids) */
+#define UID_KEPT       0       /* this was remembered from a previous run */
+#define UID_DELETED    -1      /* this message has been deleted */
+#define UID_EXPUNGED   -2      /* this message has been expunged */ 
     struct idlist *oldsaved, *newsaved;
 
     /* internal use */
@@ -169,12 +174,20 @@ struct method
     int (*fetch_body)();       /* fetch a given message */
     int (*trail)();            /* eat trailer of a message */
     int (*delete)();           /* delete method */
-    flag (*retain_hdr)();      /* if this returns TRUE, retain message */
-    char *exit_cmd;            /* exit command */
+    int (*logout_cmd)();       /* logout command */
+    flag retry;                        /* can getrange poll for new messages? */
 };
 
-#define TAGLEN 6
+/*
+ * Note: tags are generated with an a%04d format from a 1-origin
+ * integer sequence number.  Length 4 permits transaction numbers
+ * up to 9999, so we force rollover with % 10000.  There's no special
+ * reason for this format other than to look like the exmples in the
+ * IMAP RFCs.
+ */
+#define TAGLEN 6               /* 'a' + 4 digits + NUL */
 extern char tag[TAGLEN];
+#define TAGMOD 10000
 
 /* list of hosts assembled from run control file and command line */
 extern struct query cmd_opts, *querylist;
@@ -208,6 +221,7 @@ extern flag versioninfo;    /* emit only version info */
 extern char *user;             /* name of invoking user */
 extern char *home;             /* home directory of invoking user */
 extern char *fetchmailhost;    /* the name of the host running fetchmail */
+extern int pass;               /* number of re-polling pass */
 
 /* prototypes for globally callable functions */
 
@@ -254,6 +268,7 @@ char *str_from_nr_list( struct idlist **idl, int number );
 char *str_find(struct idlist **, int);
 char *idpair_find(struct idlist **, const char *);
 void append_str_list(struct idlist **, struct idlist **);
+void expunge_uids(struct query *);
 void update_str_lists(struct query *);
 void write_saved_lists(struct query *, const char *);
 
@@ -292,6 +307,7 @@ struct query *hostalloc(struct query *);
 int parsecmdline (int, char **, struct query *);
 void optmerge(struct query *, struct query *);
 char *MD5Digest (unsigned char *);
+int POP3_auth_rpa(unsigned char *, unsigned char *, int socket);
 int daemonize(const char *, void (*)(int));
 char *getpassword(char *);
 void escapes(const char *, char *);