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? */
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 */
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;
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 */
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 *);
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 *);