NeoMutt  2021-02-05-89-gabe350
Teaching an old dog new tricks
DOXYGEN
lib.h
Go to the documentation of this file.
1 
89 #ifndef MUTT_AUTOCRYPT_LIB_H
90 #define MUTT_AUTOCRYPT_LIB_H
91 
92 #include <stdbool.h>
93 #include <sqlite3.h>
94 #include <stdio.h>
95 
96 struct ConfigSet;
97 struct Email;
98 struct Envelope;
99 struct Mailbox;
100 
105 {
106  char *email_addr;
107  char *keyid;
108  char *keydata;
110  bool enabled;
111 };
112 
117 {
118  char *email_addr;
119  sqlite3_int64 last_seen;
120  sqlite3_int64 autocrypt_timestamp;
121  char *keyid;
122  char *keydata;
124  sqlite3_int64 gossip_timestamp;
127 };
128 
133 {
135  char *email_msgid;
136  sqlite3_int64 timestamp;
137  char *keydata;
138 };
139 
144 {
147  char *email_msgid;
148  sqlite3_int64 timestamp;
150 };
151 
156 {
162 };
163 
164 extern char *AutocryptSignAs;
165 extern char *AutocryptDefaultKey;
166 extern bool C_Autocrypt;
167 extern bool C_AutocryptReply;
168 extern char *C_AutocryptAcctFormat;
169 extern char *C_AutocryptDir;
170 
171 void dlg_select_autocrypt_account (struct Mailbox *m);
172 void mutt_autocrypt_cleanup (void);
173 int mutt_autocrypt_generate_gossip_list (struct Mailbox *m, struct Email *e);
174 int mutt_autocrypt_init (struct Mailbox *m, bool can_create);
175 int mutt_autocrypt_process_autocrypt_header(struct Mailbox *m, struct Email *e, struct Envelope *env);
176 int mutt_autocrypt_process_gossip_header (struct Mailbox *m, struct Email *e, struct Envelope *prot_headers);
177 int mutt_autocrypt_set_sign_as_default_key (struct Mailbox *m, struct Email *e);
178 enum AutocryptRec mutt_autocrypt_ui_recommendation (struct Mailbox *m, struct Email *e, char **keylist);
179 int mutt_autocrypt_write_autocrypt_header (struct Mailbox *m, struct Envelope *env, FILE *fp);
180 int mutt_autocrypt_write_gossip_headers (struct Mailbox *m, struct Envelope *env, FILE *fp);
181 
182 #endif /* MUTT_AUTOCRYPT_LIB_H */
Envelope
The header of an Email.
Definition: envelope.h:54
mutt_autocrypt_init
int mutt_autocrypt_init(struct Mailbox *m, bool can_create)
Initialise Autocrypt.
Definition: autocrypt.c:95
AUTOCRYPT_REC_NO
@ AUTOCRYPT_REC_NO
Do no use Autocrypt.
Definition: lib.h:158
Mailbox
A mailbox.
Definition: mailbox.h:81
AutocryptAccount
Autocrypt account.
Definition: lib.h:104
dlg_select_autocrypt_account
void dlg_select_autocrypt_account(struct Mailbox *m)
Display the Autocrypt account Menu.
Definition: dlgautocrypt.c:257
AutocryptPeer::keyid
char * keyid
Definition: lib.h:121
mutt_autocrypt_ui_recommendation
enum AutocryptRec mutt_autocrypt_ui_recommendation(struct Mailbox *m, struct Email *e, char **keylist)
Get the recommended action for an Email.
Definition: autocrypt.c:561
AutocryptPeer::email_addr
char * email_addr
Definition: lib.h:118
AutocryptPeer::autocrypt_timestamp
sqlite3_int64 autocrypt_timestamp
Definition: lib.h:120
AutocryptSignAs
char * AutocryptSignAs
Autocrypt Key id to sign as.
Definition: config.c:42
AUTOCRYPT_REC_YES
@ AUTOCRYPT_REC_YES
Autocrypt should be used.
Definition: lib.h:161
AutocryptAccount::email_addr
char * email_addr
Definition: lib.h:106
AutocryptAccount::prefer_encrypt
bool prefer_encrypt
false = nopref, true = mutual
Definition: lib.h:109
AutocryptPeer::keydata
char * keydata
Definition: lib.h:122
mutt_autocrypt_generate_gossip_list
int mutt_autocrypt_generate_gossip_list(struct Mailbox *m, struct Email *e)
Create the gossip list headers.
Definition: autocrypt.c:823
C_Autocrypt
bool C_Autocrypt
Config: Enables the Autocrypt feature.
Definition: config.c:37
C_AutocryptReply
bool C_AutocryptReply
Config: Replying to an autocrypt email automatically enables autocrypt in the reply.
Definition: config.c:38
AutocryptGossipHistory
Autocrypt gossip history.
Definition: lib.h:143
C_AutocryptAcctFormat
char * C_AutocryptAcctFormat
Config: Format of the autocrypt account menu.
Definition: config.c:39
AutocryptPeer::gossip_keydata
char * gossip_keydata
Definition: lib.h:126
AutocryptAccount::keyid
char * keyid
Definition: lib.h:107
AutocryptGossipHistory::email_msgid
char * email_msgid
Definition: lib.h:147
AutocryptPeer::prefer_encrypt
bool prefer_encrypt
false = nopref, true = mutual
Definition: lib.h:123
AutocryptPeerHistory
Autocrypt peer history.
Definition: lib.h:132
mutt_autocrypt_process_autocrypt_header
int mutt_autocrypt_process_autocrypt_header(struct Mailbox *m, struct Email *e, struct Envelope *env)
Parse an Autocrypt email header.
Definition: autocrypt.c:256
AutocryptPeerHistory::peer_email_addr
char * peer_email_addr
Definition: lib.h:134
AUTOCRYPT_REC_OFF
@ AUTOCRYPT_REC_OFF
No recommendations.
Definition: lib.h:157
AutocryptGossipHistory::sender_email_addr
char * sender_email_addr
Definition: lib.h:146
AutocryptAccount::enabled
bool enabled
Definition: lib.h:110
AutocryptPeerHistory::timestamp
sqlite3_int64 timestamp
Definition: lib.h:136
mutt_autocrypt_write_gossip_headers
int mutt_autocrypt_write_gossip_headers(struct Mailbox *m, struct Envelope *env, FILE *fp)
Write the Autocrypt gossip headers to a file.
Definition: autocrypt.c:801
mutt_autocrypt_process_gossip_header
int mutt_autocrypt_process_gossip_header(struct Mailbox *m, struct Email *e, struct Envelope *prot_headers)
Parse an Autocrypt email gossip header.
Definition: autocrypt.c:406
AUTOCRYPT_REC_DISCOURAGE
@ AUTOCRYPT_REC_DISCOURAGE
Prefer not to use Autocrypt.
Definition: lib.h:159
mutt_autocrypt_set_sign_as_default_key
int mutt_autocrypt_set_sign_as_default_key(struct Mailbox *m, struct Email *e)
Set the Autocrypt default key for signing.
Definition: autocrypt.c:697
AutocryptPeer
Autocrypt peer.
Definition: lib.h:116
AutocryptPeerHistory::keydata
char * keydata
Definition: lib.h:137
AutocryptPeer::gossip_timestamp
sqlite3_int64 gossip_timestamp
Definition: lib.h:124
AutocryptPeer::last_seen
sqlite3_int64 last_seen
Definition: lib.h:119
AutocryptAccount::keydata
char * keydata
Definition: lib.h:108
mutt_autocrypt_cleanup
void mutt_autocrypt_cleanup(void)
Shutdown Autocrypt.
Definition: autocrypt.c:135
ConfigSet
Container for lots of config items.
Definition: set.h:228
C_AutocryptDir
char * C_AutocryptDir
Config: Location of autocrypt files, including the GPG keyring and SQLite database.
Definition: config.c:40
mutt_autocrypt_write_autocrypt_header
int mutt_autocrypt_write_autocrypt_header(struct Mailbox *m, struct Envelope *env, FILE *fp)
Write the Autocrypt header to a file.
Definition: autocrypt.c:763
AutocryptPeer::gossip_keyid
char * gossip_keyid
Definition: lib.h:125
AutocryptDefaultKey
char * AutocryptDefaultKey
Autocrypt default key id (used for postponing messages)
Definition: config.c:43
AutocryptGossipHistory::timestamp
sqlite3_int64 timestamp
Definition: lib.h:148
Email
The envelope/body of an email.
Definition: email.h:37
AutocryptGossipHistory::gossip_keydata
char * gossip_keydata
Definition: lib.h:149
AutocryptRec
AutocryptRec
Recommendation.
Definition: lib.h:155
AUTOCRYPT_REC_AVAILABLE
@ AUTOCRYPT_REC_AVAILABLE
Autocrypt is available.
Definition: lib.h:160
AutocryptPeerHistory::email_msgid
char * email_msgid
Definition: lib.h:135
AutocryptGossipHistory::peer_email_addr
char * peer_email_addr
Definition: lib.h:145