Andreas Krennmair:
[apps/madmutt.git] / mutt.h
diff --git a/mutt.h b/mutt.h
index 84ac4e9..d11f1cc 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -1,5 +1,7 @@
+
 /*
  * Copyright (C) 1996-2002 Michael R. Elkins <me@mutt.org>
 /*
  * Copyright (C) 1996-2002 Michael R. Elkins <me@mutt.org>
+ * Copyright (C) 2004 g10 Code GmbH
  * 
  *     This program is free software; you can redistribute it and/or modify
  *     it under the terms of the GNU General Public License as published by
  * 
  *     This program is free software; you can redistribute it and/or modify
  *     it under the terms of the GNU General Public License as published by
@@ -94,6 +96,8 @@
 #define CH_WEED_DELIVERED (1<<13) /* weed eventual Delivered-To headers */
 #define CH_FORCE_FROM  (1<<14) /* give CH_FROM precedence over CH_WEED? */
 #define CH_NOQFROM     (1<<15) /* give CH_FROM precedence over CH_WEED? */
 #define CH_WEED_DELIVERED (1<<13) /* weed eventual Delivered-To headers */
 #define CH_FORCE_FROM  (1<<14) /* give CH_FROM precedence over CH_WEED? */
 #define CH_NOQFROM     (1<<15) /* give CH_FROM precedence over CH_WEED? */
+#define CH_UPDATE_IRT  (1<<16) /* update In-Reply-To: */
+#define CH_UPDATE_REFS (1<<17) /* update References: */
 
 /* flags for mutt_enter_string() */
 #define  M_ALIAS   1      /* do alias "completion" by calling up the alias-menu */
 
 /* flags for mutt_enter_string() */
 #define  M_ALIAS   1      /* do alias "completion" by calling up the alias-menu */
 #define  M_CLEAR   (1<<5) /* clear input if printable character is pressed */
 #define  M_COMMAND (1<<6) /* do command completion */
 #define  M_PATTERN (1<<7) /* pattern mode - only used for history classes */
 #define  M_CLEAR   (1<<5) /* clear input if printable character is pressed */
 #define  M_COMMAND (1<<6) /* do command completion */
 #define  M_PATTERN (1<<7) /* pattern mode - only used for history classes */
+#define  M_LASTFOLDER (1<<8) /* last-folder mode - hack hack hack */
 
 /* flags for mutt_get_token() */
 #define M_TOKEN_EQUAL          1       /* treat '=' as a special */
 
 /* flags for mutt_get_token() */
 #define M_TOKEN_EQUAL          1       /* treat '=' as a special */
@@ -158,6 +163,13 @@ typedef enum
 #define M_CRYPTHOOK    (1<<8)
 #define M_ACCOUNTHOOK  (1<<9)
 #define M_REPLYHOOK    (1<<10)
 #define M_CRYPTHOOK    (1<<8)
 #define M_ACCOUNTHOOK  (1<<9)
 #define M_REPLYHOOK    (1<<10)
+#define M_SEND2HOOK     (1<<11)
+
+#ifdef USE_COMPRESSED
+#define M_OPENHOOK     (1<<12)
+#define M_APPENDHOOK   (1<<13)
+#define M_CLOSEHOOK    (1<<14)
+#endif
 
 /* tree characters for linearize_tree and print_enriched_string */
 #define M_TREE_LLCORNER                1
 
 /* tree characters for linearize_tree and print_enriched_string */
 #define M_TREE_LLCORNER                1
@@ -219,9 +231,11 @@ enum
   M_DATE,
   M_DATE_RECEIVED,
   M_DUPLICATED,
   M_DATE,
   M_DATE_RECEIVED,
   M_DUPLICATED,
+  M_UNREFERENCED,
   M_ID,
   M_BODY,
   M_HEADER,
   M_ID,
   M_BODY,
   M_HEADER,
+  M_HORMEL,
   M_WHOLE_MSG,
   M_SENDER,
   M_MESSAGE,
   M_WHOLE_MSG,
   M_SENDER,
   M_MESSAGE,
@@ -277,11 +291,14 @@ enum
   OPT_DELETE,
   OPT_FORWEDIT,
   OPT_INCLUDE,
   OPT_DELETE,
   OPT_FORWEDIT,
   OPT_INCLUDE,
+#ifdef USE_IMAP
+  OPT_IMAPRECONNECT,
+#endif
   OPT_MFUPTO,
   OPT_MIMEFWD,
   OPT_MIMEFWDREST,
   OPT_MOVE,
   OPT_MFUPTO,
   OPT_MIMEFWD,
   OPT_MIMEFWDREST,
   OPT_MOVE,
-  OPT_PGPTRADITIONAL, /* create old-style PGP messages */
+  OPT_PGPMIMEAUTO,     /* ask to revert to PGP/MIME when inline fails */
 #ifdef USE_POP
   OPT_POPDELETE,
   OPT_POPRECONNECT,
 #ifdef USE_POP
   OPT_POPDELETE,
   OPT_POPRECONNECT,
@@ -291,7 +308,7 @@ enum
   OPT_QUIT,
   OPT_REPLYTO,
   OPT_RECALL,
   OPT_QUIT,
   OPT_REPLYTO,
   OPT_RECALL,
-#ifdef USE_SSL
+#if defined(USE_SSL) || defined(USE_GNUTLS)
   OPT_SSLSTARTTLS,
 #endif
   OPT_SUBJECT,
   OPT_SSLSTARTTLS,
 #endif
   OPT_SUBJECT,
@@ -325,6 +342,9 @@ enum
 #define M_SEL_MULTI    (1<<1)
 #define M_SEL_FOLDER   (1<<2)
 
 #define M_SEL_MULTI    (1<<1)
 #define M_SEL_FOLDER   (1<<2)
 
+/* flags for parse_spam_list */
+#define M_SPAM          1
+#define M_NOSPAM        2
 
 /* boolean vars */
 enum
 
 /* boolean vars */
 enum
@@ -360,12 +380,16 @@ enum
   OPTFORCENAME,
   OPTFORWDECODE,
   OPTFORWQUOTE,
   OPTFORCENAME,
   OPTFORWDECODE,
   OPTFORWQUOTE,
+#if USE_HCACHE
+  OPTHCACHEVERIFY,
+#endif
   OPTHDRS,
   OPTHEADER,
   OPTHELP,
   OPTHIDDENHOST,
   OPTHIDELIMITED,
   OPTHIDEMISSING,
   OPTHDRS,
   OPTHEADER,
   OPTHELP,
   OPTHIDDENHOST,
   OPTHIDELIMITED,
   OPTHIDEMISSING,
+  OPTHIDETHREADSUBJECT,
   OPTHIDETOPLIMITED,
   OPTHIDETOPMISSING,
   OPTIGNORELISTREPLYTO,
   OPTHIDETOPLIMITED,
   OPTHIDETOPMISSING,
   OPTIGNORELISTREPLYTO,
@@ -374,22 +398,28 @@ enum
   OPTIMAPPASSIVE,
   OPTIMAPPEEK,
   OPTIMAPSERVERNOISE,
   OPTIMAPPASSIVE,
   OPTIMAPPEEK,
   OPTIMAPSERVERNOISE,
-# ifdef USE_SSL
+# if defined(USE_SSL) || defined(USE_GNUTLS)
   OPTIMAPFORCESSL,
 # endif
 #endif
   OPTIMAPFORCESSL,
 # endif
 #endif
-#if defined(USE_SSL) || defined(USE_NSS)
+#if defined(USE_SSL) || defined(USE_NSS) || defined(USE_GNUTLS)
+# ifndef USE_GNUTLS
   OPTSSLV2,
   OPTSSLV2,
+# endif
   OPTSSLV3,
   OPTTLSV1,
   OPTSSLV3,
   OPTTLSV1,
+# ifndef USE_GNUTLS
   OPTSSLSYSTEMCERTS,
   OPTSSLSYSTEMCERTS,
+# endif
 #endif
   OPTIMPLICITAUTOVIEW,
 #endif
   OPTIMPLICITAUTOVIEW,
+  OPTINCLUDEONLYFIRST,
   OPTKEEPFLAGGED,
   OPTMAILCAPSANITIZE,
   OPTMAILDIRTRASH,
   OPTMARKERS,
   OPTMARKOLD,
   OPTKEEPFLAGGED,
   OPTMAILCAPSANITIZE,
   OPTMAILDIRTRASH,
   OPTMARKERS,
   OPTMARKOLD,
+  OPTMBOXPANE,
   OPTMENUSCROLL,       /* scroll menu instead of implicit next-page */
   OPTMETAKEY,          /* interpret ALT-x as ESC-x */
   OPTMETOO,
   OPTMENUSCROLL,       /* scroll menu instead of implicit next-page */
   OPTMETAKEY,          /* interpret ALT-x as ESC-x */
   OPTMETOO,
@@ -425,8 +455,10 @@ enum
   OPTSIGDASHES,
   OPTSIGONTOP,
   OPTSORTRE,
   OPTSIGDASHES,
   OPTSIGONTOP,
   OPTSORTRE,
+  OPTSPAMSEP,
   OPTSTATUSONTOP,
   OPTSTRICTTHREADS,
   OPTSTATUSONTOP,
   OPTSTRICTTHREADS,
+  OPTSTUFFQUOTED,
   OPTSUSPEND,
   OPTTEXTFLOWED,
   OPTTHOROUGHSRC,
   OPTSUSPEND,
   OPTTEXTFLOWED,
   OPTTHOROUGHSRC,
@@ -446,6 +478,9 @@ enum
   OPTWRAPSEARCH,
   OPTWRITEBCC,         /* write out a bcc header? */
   OPTXMAILER,
   OPTWRAPSEARCH,
   OPTWRITEBCC,         /* write out a bcc header? */
   OPTXMAILER,
+  OPTXTERMSETTITLES,
+
+  OPTCRYPTUSEGPGME,
 
   /* PGP options */
   
 
   /* PGP options */
   
@@ -463,7 +498,6 @@ enum
   OPTPGPIGNORESUB,
   OPTPGPCHECKEXIT,
   OPTPGPLONGIDS,
   OPTPGPIGNORESUB,
   OPTPGPCHECKEXIT,
   OPTPGPLONGIDS,
-  OPTPGPAUTOTRAD,
 #if 0
   OPTPGPENCRYPTSELF,
 #endif
 #if 0
   OPTPGPENCRYPTSELF,
 #endif
@@ -471,6 +505,8 @@ enum
   OPTPGPSTRICTENC,
   OPTFORWDECRYPT,
   OPTPGPSHOWUNUSABLE,
   OPTPGPSTRICTENC,
   OPTFORWDECRYPT,
   OPTPGPSHOWUNUSABLE,
+  OPTPGPAUTOINLINE,
+  OPTPGPREPLYINLINE,
 
   /* news options */
 
 
   /* news options */
 
@@ -549,12 +585,23 @@ typedef struct rx_list_t
   struct rx_list_t *next;
 } RX_LIST;
 
   struct rx_list_t *next;
 } RX_LIST;
 
+typedef struct spam_list_t
+{
+  REGEXP *rx;
+  int     nmatch;
+  char   *template;
+  struct spam_list_t *next;
+} SPAM_LIST;
+
 #define mutt_new_list() safe_calloc (1, sizeof (LIST))
 #define mutt_new_list() safe_calloc (1, sizeof (LIST))
+#define mutt_new_spam_list() safe_calloc (1, sizeof (SPAM_LIST))
 #define mutt_new_rx_list() safe_calloc (1, sizeof (RX_LIST))
 void mutt_free_list (LIST **);
 void mutt_free_rx_list (RX_LIST **);
 #define mutt_new_rx_list() safe_calloc (1, sizeof (RX_LIST))
 void mutt_free_list (LIST **);
 void mutt_free_rx_list (RX_LIST **);
+void mutt_free_spam_list (SPAM_LIST **);
+LIST *mutt_copy_list (LIST *);
 int mutt_matches_ignore (const char *, LIST *);
 int mutt_matches_ignore (const char *, LIST *);
-
 /* add an element to a list */
 LIST *mutt_add_list (LIST *, const char *);
 
 /* add an element to a list */
 LIST *mutt_add_list (LIST *, const char *);
 
@@ -581,6 +628,7 @@ typedef struct envelope
   ADDRESS *sender;
   ADDRESS *reply_to;
   ADDRESS *mail_followup_to;
   ADDRESS *sender;
   ADDRESS *reply_to;
   ADDRESS *mail_followup_to;
+  char *list_post;             /* this stores a mailto URL, or nothing */
   char *subject;
   char *real_subj;             /* offset of the real subject */
   char *message_id;
   char *subject;
   char *real_subj;             /* offset of the real subject */
   char *message_id;
@@ -594,6 +642,7 @@ typedef struct envelope
   char *followup_to;
   char *x_comment_to;
 #endif
   char *followup_to;
   char *x_comment_to;
 #endif
+  BUFFER *spam;
   LIST *references;            /* message references (in reverse order) */
   LIST *in_reply_to;           /* in-reply-to header content */
   LIST *userhdrs;              /* user defined headers */
   LIST *references;            /* message references (in reverse order) */
   LIST *in_reply_to;           /* in-reply-to header content */
   LIST *userhdrs;              /* user defined headers */
@@ -674,8 +723,20 @@ typedef struct body
                                /* send mode: don't adjust the character
                                 * set when in send-mode.
                                 */
                                /* send mode: don't adjust the character
                                 * set when in send-mode.
                                 */
+  unsigned int is_signed_data : 1; /* A lot of MUAs don't indicate
+                                      S/MIME signed-data correctly,
+                                      e.g. they use foo.p7m even for
+                                      the name of signed data.  This
+                                      flag is used to keep track of
+                                      the actual message type.  It
+                                      gets set during the verification
+                                      (which is done if the encryption
+                                      try failed) and check by the
+                                      function to figure the type of
+                                      the message. */
 
   unsigned int goodsig : 1;    /* good cryptographic signature */
 
   unsigned int goodsig : 1;    /* good cryptographic signature */
+  unsigned int warnsig : 1;     /* maybe good signature */
   unsigned int badsig : 1;     /* bad cryptographic signature (needed to check encrypted s/mime-signatures) */
 
   unsigned int collapsed : 1;  /* used by recvattach */
   unsigned int badsig : 1;     /* bad cryptographic signature (needed to check encrypted s/mime-signatures) */
 
   unsigned int collapsed : 1;  /* used by recvattach */
@@ -684,7 +745,7 @@ typedef struct body
 
 typedef struct header
 {
 
 typedef struct header
 {
-  unsigned int security : 9;  /* bit 0-6: flags, bit 7,8: application.
+  unsigned int security : 11;  /* bit 0-6: flags, bit 7,8: application.
                                 see: crypt.h pgplib.h, smime.h */
 
   unsigned int mime : 1;               /* has a Mime-Version header? */
                                 see: crypt.h pgplib.h, smime.h */
 
   unsigned int mime : 1;               /* has a Mime-Version header? */
@@ -703,6 +764,8 @@ typedef struct header
   unsigned int subject_changed : 1;    /* used for threading */
   unsigned int threaded : 1;           /* used for threading */
   unsigned int display_subject : 1;    /* used for threading */
   unsigned int subject_changed : 1;    /* used for threading */
   unsigned int threaded : 1;           /* used for threading */
   unsigned int display_subject : 1;    /* used for threading */
+  unsigned int irt_changed : 1; /* In-Reply-To changed to link/break threads */
+  unsigned int refs_changed : 1; /* References changed to break thread */
   unsigned int recip_valid : 1;        /* is_recipient is valid */
   unsigned int active : 1;             /* message is not to be removed */
   unsigned int trash : 1;              /* message is marked as trashed on disk.
   unsigned int recip_valid : 1;        /* is_recipient is valid */
   unsigned int active : 1;             /* message is not to be removed */
   unsigned int trash : 1;              /* message is marked as trashed on disk.
@@ -746,6 +809,10 @@ typedef struct header
   char *tree;                  /* character string to print thread tree */
   struct thread *thread;
 
   char *tree;                  /* character string to print thread tree */
   struct thread *thread;
 
+#ifdef IMAP_EDIT_THREADS
+  ENVELOPE *new_env;   /* envelope information for rethreading */
+#endif
+
 #ifdef MIXMASTER
   LIST *chain;
 #endif
 #ifdef MIXMASTER
   LIST *chain;
 #endif
@@ -810,6 +877,7 @@ typedef struct
   char *pattern;                /* limit pattern string */
   pattern_t *limit_pattern;     /* compiled limit pattern */
   HEADER **hdrs;
   char *pattern;                /* limit pattern string */
   pattern_t *limit_pattern;     /* compiled limit pattern */
   HEADER **hdrs;
+  HEADER *last_tag;            /* last tagged msg. used to link threads */
   THREAD *tree;                        /* top of thread tree */
   HASH *id_hash;               /* hash table by msg id */
   HASH *subj_hash;             /* hash table by subject */
   THREAD *tree;                        /* top of thread tree */
   HASH *id_hash;               /* hash table by msg id */
   HASH *subj_hash;             /* hash table by subject */
@@ -831,6 +899,11 @@ typedef struct
 
   short magic;                 /* mailbox type */
 
 
   short magic;                 /* mailbox type */
 
+#ifdef USE_COMPRESSED
+  void *compressinfo;          /* compressed mbox module private data */
+  char *realpath;              /* path to compressed mailbox */
+#endif /* USE_COMPRESSED */
+
   unsigned int locked : 1;     /* is the mailbox locked? */
   unsigned int changed : 1;    /* mailbox has been modified */
   unsigned int readonly : 1;    /* don't allow changes to the mailbox */
   unsigned int locked : 1;     /* is the mailbox locked? */
   unsigned int changed : 1;    /* mailbox has been modified */
   unsigned int readonly : 1;    /* don't allow changes to the mailbox */
@@ -877,6 +950,8 @@ typedef struct
 #define M_WEED          (1<<3) /* weed headers even when not in display mode */
 #define M_CHARCONV     (1<<4) /* Do character set conversions */
 #define M_PRINTING     (1<<5) /* are we printing? - M_DISPLAY "light" */
 #define M_WEED          (1<<3) /* weed headers even when not in display mode */
 #define M_CHARCONV     (1<<4) /* Do character set conversions */
 #define M_PRINTING     (1<<5) /* are we printing? - M_DISPLAY "light" */
+#define M_REPLYING     (1<<6) /* are we replying? */
+#define M_FIRSTDONE    (1<<7) /* the first attachment has been done */
 
 #define state_set_prefix(s) ((s)->flags |= M_PENDINGPREFIX)
 #define state_reset_prefix(s) ((s)->flags &= ~M_PENDINGPREFIX)
 
 #define state_set_prefix(s) ((s)->flags |= M_PENDINGPREFIX)
 #define state_reset_prefix(s) ((s)->flags &= ~M_PENDINGPREFIX)