{NULL, OP_NULL}
};
-ADDRESS *mutt_lookup_alias (const char *s)
+address_t *mutt_lookup_alias (const char *s)
{
ALIAS *t = Aliases;
return (NULL); /* no such alias */
}
-static ADDRESS *mutt_expand_aliases_r (ADDRESS * a, LIST ** expn)
+static address_t *mutt_expand_aliases_r (address_t * a, LIST ** expn)
{
- ADDRESS *head = NULL, *last = NULL, *t, *w;
+ address_t *head = NULL, *last = NULL, *t, *w;
LIST *u;
char i;
const char *fqdn;
return (head);
}
-ADDRESS *mutt_expand_aliases (ADDRESS * a)
+address_t *mutt_expand_aliases (address_t * a)
{
- ADDRESS *t;
+ address_t *t;
LIST *expn = NULL; /* previously expanded aliases to avoid loops */
t = mutt_expand_aliases_r (a, &expn);
}
}
-ADDRESS *mutt_get_address (ENVELOPE * env, const char **pfxp)
+address_t *mutt_get_address (ENVELOPE * env, const char **pfxp)
{
- ADDRESS *adr;
+ address_t *adr;
const char *pfx = NULL;
if (mutt_addr_is_user (env->from)) {
return adr;
}
-void mutt_create_alias (ENVELOPE * cur, ADDRESS * iadr)
+void mutt_create_alias (ENVELOPE * cur, address_t * iadr)
{
ALIAS *new, *t;
char buf[LONG_STRING], prompt[SHORT_STRING], *pc;
char *err = NULL;
char fixed[LONG_STRING];
FILE *rc;
- ADDRESS *adr = NULL;
+ address_t *adr = NULL;
if (cur) {
adr = mutt_get_address (cur, NULL);
* This routine looks to see if the user has an alias defined for the given
* address.
*/
-ADDRESS *alias_reverse_lookup (ADDRESS * a)
+address_t *alias_reverse_lookup (address_t * a)
{
ALIAS *t = Aliases;
- ADDRESS *ap;
+ address_t *ap;
if (!a || !a->mailbox)
return NULL;
}
/* returns TRUE if the given address belongs to the user. */
-int mutt_addr_is_user (ADDRESS * addr)
+int mutt_addr_is_user (address_t * addr)
{
/* NULL address is assumed to be the user. */
if (!addr) {
static int alias_SortAddress (const void *a, const void *b)
{
- ADDRESS *pa = (*(ALIAS **) a)->addr;
- ADDRESS *pb = (*(ALIAS **) b)->addr;
+ address_t *pa = (*(ALIAS **) a)->addr;
+ address_t *pb = (*(ALIAS **) b)->addr;
int r;
if (pa == pb)
typedef struct alias {
struct alias *self; /* XXX - ugly hack */
char *name;
- ADDRESS *addr;
+ address_t *addr;
struct alias *next;
short tagged;
short del;
short num;
} ALIAS;
-void mutt_create_alias (ENVELOPE *, ADDRESS *);
+void mutt_create_alias (ENVELOPE *, address_t *);
int mutt_check_alias_name (const char *, char *);
-ADDRESS *mutt_get_address (ENVELOPE *, const char **);
-ADDRESS *mutt_lookup_alias (const char *s);
-ADDRESS *mutt_expand_aliases (ADDRESS *);
+address_t *mutt_get_address (ENVELOPE *, const char **);
+address_t *mutt_lookup_alias (const char *s);
+address_t *mutt_expand_aliases (address_t *);
void mutt_expand_aliases_env (ENVELOPE *);
void mutt_free_alias (ALIAS **);
-ADDRESS *alias_reverse_lookup (ADDRESS *);
+address_t *alias_reverse_lookup (address_t *);
int mutt_alias_complete (char *, size_t);
-int mutt_addr_is_user (ADDRESS *);
+int mutt_addr_is_user (address_t *);
void mutt_alias_menu (char *, size_t, ALIAS *);
#endif /* !_MUTT_ALIAS_H */
{
char prompt[SHORT_STRING];
char buf[HUGE_STRING] = { 0 };
- ADDRESS *adr = NULL;
+ address_t *adr = NULL;
char *err = NULL;
int rc;
{
const char *pfx = NULL;
char buf[SHORT_STRING];
- ADDRESS *adr = NULL;
+ address_t *adr = NULL;
adr = mutt_get_address(env, &pfx);
return 0;
}
-static void draw_envelope_addr (int line, ADDRESS * addr)
+static void draw_envelope_addr (int line, address_t * addr)
{
char buf[STRING];
SETCOLOR (MT_COLOR_NORMAL);
}
-static int edit_address_list (int line, ADDRESS ** addr)
+static int edit_address_list (int line, address_t ** addr)
{
char buf[HUGE_STRING] = ""; /* needs to be large for alias expansion */
char *err = NULL;
* XXX - fix that.
*/
-static void format_address_header (char **h, ADDRESS * a)
+static void format_address_header (char **h, address_t * a)
{
char buf[HUGE_STRING];
char cbuf[STRING];
p_realloc(h, buflen);
for (count = 0; a; a = a->next, count++) {
- ADDRESS *tmp = a->next;
+ address_t *tmp = a->next;
a->next = NULL;
*buf = *cbuf = *c2buf = '\0';
char *s = *h;
int l;
- ADDRESS *a = NULL;
+ address_t *a = NULL;
switch (tolower ((unsigned char) *s)) {
case 'r':
/* Return a bit vector describing how well the addresses ADDR and
U_ADDR match and whether KEY is valid. */
-static int crypt_id_matches_addr (ADDRESS * addr, ADDRESS * u_addr,
+static int crypt_id_matches_addr (address_t * addr, address_t * u_addr,
crypt_key_t * key)
{
int rv = 0;
will be set to true on return if the user did override the the
key's validity. */
static crypt_key_t *crypt_select_key (crypt_key_t * keys,
- ADDRESS * p, const char *s,
+ address_t * p, const char *s,
unsigned int app, int *forced_valid)
{
int keymax;
return k;
}
-static crypt_key_t *crypt_getkeybyaddr (ADDRESS * a, short abilities,
+static crypt_key_t *crypt_getkeybyaddr (address_t * a, short abilities,
unsigned int app, int *forced_valid)
{
- ADDRESS *r, *p;
+ address_t *r, *p;
LIST *hints = NULL;
int weak = 0;
/* This routine attempts to find the keyids of the recipients of a
message. It returns NULL if any of the keys can not be found. */
-static char *find_keys (ADDRESS * to, ADDRESS * cc, ADDRESS * bcc,
+static char *find_keys (address_t * to, address_t * cc, address_t * bcc,
unsigned int app)
{
char *keyID, *keylist = NULL, *t;
size_t keylist_size = 0;
size_t keylist_used = 0;
- ADDRESS *tmp = NULL, *addr = NULL;
- ADDRESS **last = &tmp;
- ADDRESS *p, *q;
+ address_t *tmp = NULL, *addr = NULL;
+ address_t **last = &tmp;
+ address_t *p, *q;
int i;
crypt_key_t *k_info, *key;
const char *fqdn = mutt_fqdn (1);
return (keylist);
}
-char *pgp_gpgme_findkeys (ADDRESS * to, ADDRESS * cc, ADDRESS * bcc)
+char *pgp_gpgme_findkeys (address_t * to, address_t * cc, address_t * bcc)
{
return find_keys (to, cc, bcc, APPLICATION_PGP);
}
-char *smime_gpgme_findkeys (ADDRESS * to, ADDRESS * cc, ADDRESS * bcc)
+char *smime_gpgme_findkeys (address_t * to, address_t * cc, address_t * bcc)
{
return find_keys (to, cc, bcc, APPLICATION_SMIME);
}
static int verify_sender (HEADER * h, gpgme_protocol_t protocol)
{
- ADDRESS *sender = NULL;
+ address_t *sender = NULL;
unsigned int ret = 1;
if (h->env->from) {
void pgp_gpgme_init (void);
void smime_gpgme_init (void);
-char *pgp_gpgme_findkeys (ADDRESS * to, ADDRESS * cc, ADDRESS * bcc);
-char *smime_gpgme_findkeys (ADDRESS * to, ADDRESS * cc, ADDRESS * bcc);
+char *pgp_gpgme_findkeys (address_t * to, address_t * cc, address_t * bcc);
+char *smime_gpgme_findkeys (address_t * to, address_t * cc, address_t * bcc);
BODY *pgp_gpgme_encrypt_message (BODY * a, char *keylist, int sign);
BODY *smime_gpgme_build_smime_entity (BODY * a, char *keylist);
return pgp_application_pgp_handler (m, s);
}
-static char *crypt_mod_pgp_findkeys (ADDRESS * to, ADDRESS * cc,
- ADDRESS * bcc)
+static char *crypt_mod_pgp_findkeys (address_t * to, address_t * cc,
+ address_t * bcc)
{
return pgp_findKeys (to, cc, bcc);
}
return pgp_encrypted_handler (m, s);
}
-static void crypt_mod_pgp_invoke_getkeys (ADDRESS * addr)
+static void crypt_mod_pgp_invoke_getkeys (address_t * addr)
{
pgp_invoke_getkeys (addr);
}
return pgp_gpgme_check_traditional (fp, b, tagged_only);
}
-static char *crypt_mod_pgp_findkeys (ADDRESS * to, ADDRESS * cc,
- ADDRESS * bcc)
+static char *crypt_mod_pgp_findkeys (address_t * to, address_t * cc,
+ address_t * bcc)
{
return pgp_gpgme_findkeys (to, cc, bcc);
}
return smime_application_smime_handler (m, s);
}
-static char *crypt_mod_smime_findkeys (ADDRESS * to, ADDRESS * cc,
- ADDRESS * bcc)
+static char *crypt_mod_smime_findkeys (address_t * to, address_t * cc,
+ address_t * bcc)
{
return smime_findKeys (to, cc, bcc);
}
return smime_gpgme_application_handler (m, s);
}
-static char *crypt_mod_smime_findkeys (ADDRESS * to, ADDRESS * cc,
- ADDRESS * bcc)
+static char *crypt_mod_smime_findkeys (address_t * to, address_t * cc,
+ address_t * bcc)
{
return smime_gpgme_findkeys (to, cc, bcc);
}
typedef int (*crypt_func_application_handler_t) (BODY * m, STATE * s);
typedef int (*crypt_func_encrypted_handler_t) (BODY * m, STATE * s);
-typedef void (*crypt_func_pgp_invoke_getkeys_t) (ADDRESS * addr);
+typedef void (*crypt_func_pgp_invoke_getkeys_t) (address_t * addr);
typedef int (*crypt_func_pgp_check_traditional_t) (FILE * fp, BODY * b,
int tagged_only);
typedef BODY *(*crypt_func_pgp_traditional_encryptsign_t) (BODY * a,
int flags,
char *keylist);
typedef BODY *(*crypt_func_pgp_make_key_attachment_t) (char *tempf);
-typedef char *(*crypt_func_findkeys_t) (ADDRESS * to,
- ADDRESS * cc, ADDRESS * bcc);
+typedef char *(*crypt_func_findkeys_t) (address_t * to,
+ address_t * cc, address_t * bcc);
typedef BODY *(*crypt_func_sign_message_t) (BODY * a);
typedef BODY *(*crypt_func_pgp_encrypt_message_t) (BODY * a, char *keylist,
int sign);
{
int i;
char tempfname[_POSIX_PATH_MAX], *mbox;
- ADDRESS *tmp = NULL;
+ address_t *tmp = NULL;
FILE *fpout;
if (!WithCrypto)
}
/* fixme: needs documentation. */
-void crypt_pgp_invoke_getkeys (ADDRESS * addr)
+void crypt_pgp_invoke_getkeys (address_t * addr)
{
if (CRYPT_MOD_CALL_CHECK (PGP, pgp_invoke_getkeys))
(CRYPT_MOD_CALL (PGP, pgp_invoke_getkeys)) (addr);
/* This routine attempts to find the keyids of the recipients of a
message. It returns NULL if any of the keys can not be found. */
-char *crypt_pgp_findkeys (ADDRESS * to, ADDRESS * cc, ADDRESS * bcc)
+char *crypt_pgp_findkeys (address_t * to, address_t * cc, address_t * bcc)
{
if (CRYPT_MOD_CALL_CHECK (PGP, findkeys))
return (CRYPT_MOD_CALL (PGP, findkeys)) (to, cc, bcc);
/* This routine attempts to find the keyids of the recipients of a
message. It returns NULL if any of the keys can not be found. */
-char *crypt_smime_findkeys (ADDRESS * to, ADDRESS * cc, ADDRESS * bcc)
+char *crypt_smime_findkeys (address_t * to, address_t * cc, address_t * bcc)
{
if (CRYPT_MOD_CALL_CHECK (SMIME, findkeys))
return (CRYPT_MOD_CALL (SMIME, findkeys)) (to, cc, bcc);
WHERE char *MuttDotlock;
#endif
-WHERE ADDRESS *EnvFrom;
-WHERE ADDRESS *From;
+WHERE address_t *EnvFrom;
+WHERE address_t *From;
WHERE char *AliasFile;
WHERE char *AliasFmt;
*off += size;
}
-static unsigned char *dump_address (ADDRESS * a, unsigned char *d, int *off)
+static unsigned char *dump_address (address_t * a, unsigned char *d, int *off)
{
unsigned int counter = 0;
unsigned int start_off = *off;
return d;
}
-static void restore_address (ADDRESS ** a, const unsigned char *d, int *off)
+static void restore_address (address_t ** a, const unsigned char *d, int *off)
{
unsigned int counter;
restore_int (&counter, d, off);
while (counter) {
- *a = p_new(ADDRESS, 1);
+ *a = p_new(address_t, 1);
restore_char (&(*a)->personal, d, off);
restore_char (&(*a)->mailbox, d, off);
restore_int ((unsigned int *) &(*a)->group, d, off);
#include <string.h>
#include <locale.h>
-int mutt_is_mail_list (ADDRESS * addr)
+int mutt_is_mail_list (address_t * addr)
{
if (!rx_list_match (UnMailLists, addr->mailbox))
return rx_list_match (MailLists, addr->mailbox);
return 0;
}
-int mutt_is_subscribed_list (ADDRESS * addr)
+int mutt_is_subscribed_list (address_t * addr)
{
if (!rx_list_match (UnMailLists, addr->mailbox)
&& !rx_list_match (UnSubscribedLists, addr->mailbox))
* return 1. Otherwise, simply return 0.
*/
static int
-check_for_mailing_list (ADDRESS * adr, const char *pfx, char *buf, int buflen)
+check_for_mailing_list (address_t * adr, const char *pfx, char *buf, int buflen)
{
for (; adr; adr = adr->next) {
if (mutt_is_subscribed_list (adr)) {
* If one is found, print the address of the list into buf, then return 1.
* Otherwise, simply return 0.
*/
-static int check_for_mailing_list_addr (ADDRESS * adr, char *buf, int buflen)
+static int check_for_mailing_list_addr (address_t * adr, char *buf, int buflen)
{
for (; adr; adr = adr->next) {
if (mutt_is_subscribed_list (adr)) {
}
-static int first_mailing_list (char *buf, size_t buflen, ADDRESS * a)
+static int first_mailing_list (char *buf, size_t buflen, address_t * a)
{
for (; a; a = a->next) {
if (mutt_is_subscribed_list (a)) {
*buf = 0;
}
-static int user_in_addr (ADDRESS * a)
+static int user_in_addr (address_t * a)
{
for (; a; a = a->next)
if (mutt_addr_is_user (a))
*path = 0;
if (mutt_addr_hook (path, pathlen, M_SAVEHOOK, Context, hdr) != 0) {
char tmp[_POSIX_PATH_MAX];
- ADDRESS *adr;
+ address_t *adr;
ENVELOPE *env = hdr->env;
int fromMe = mutt_addr_is_user (env->from);
void mutt_select_fcc (char *path, size_t pathlen, HEADER * hdr)
{
- ADDRESS *adr;
+ address_t *adr;
char buf[_POSIX_PATH_MAX];
ENVELOPE *env = hdr->env;
return _mutt_string_hook (chs, M_ICONVHOOK);
}
-char *mutt_crypt_hook (ADDRESS * adr)
+char *mutt_crypt_hook (address_t * adr)
{
return _mutt_string_hook (adr->mailbox, M_CRYPTHOOK);
}
struct option_t* option) {
char s[HUGE_STRING];
s[0] = '\0';
- rfc822_write_address (s, sizeof(s), *((ADDRESS**) option->data), 0);
+ rfc822_write_address (s, sizeof(s), *((address_t**) option->data), 0);
snprintf (dst, dstlen, "%s=\"%s\"", option->option, NONULL (s));
}
char* errbuf, size_t errlen) {
if (!dst)
return (0);
- rfc822_free_address ((ADDRESS**) dst->data);
+ rfc822_free_address ((address_t**) dst->data);
if (val && *val)
- *((ADDRESS**) dst->data) = rfc822_parse_adrlist (NULL, val);
+ *((address_t**) dst->data) = rfc822_parse_adrlist (NULL, val);
return (1);
}
}
#ifdef DEBUG
if (DebugLevel >= 2) {
- ADDRESS *a;
+ address_t *a;
/* A group is terminated with an empty address, so check a->mailbox */
for (a = tmp->addr; a && a->mailbox; a = a->next) {
r = -1;
break;
} else if (DTYPE (option->type) == DT_ADDR)
- rfc822_free_address ((ADDRESS **) option->data);
+ rfc822_free_address ((address_t **) option->data);
else if (DTYPE (option->type) == DT_USER)
/* to unset $user_ means remove */
hash_delete (ConfigOptions, option->option,
}
else if (DTYPE (option->type) == DT_ADDR) {
rfc822_write_address (tmp, sizeof(tmp),
- *((ADDRESS **) option->data), 0);
+ *((address_t **) option->data), 0);
}
else if (DTYPE (option->type) == DT_QUAD)
m_strcpy(tmp, sizeof(tmp), vals[quadoption(option->data)]);
char *mailbox; /* mailbox and host address */
int group; /* group mailbox? */
struct address_t *next;
-} ADDRESS;
-
-void rfc822_free_address(ADDRESS **);
-void rfc822_qualify(ADDRESS *, const char *);
-ADDRESS *rfc822_parse_adrlist(ADDRESS *, const char *s);
-ADDRESS *rfc822_cpy_adr(ADDRESS * addr);
-ADDRESS *rfc822_cpy_adr_real(ADDRESS * addr);
-ADDRESS *rfc822_append(ADDRESS ** a, ADDRESS * b);
-void rfc822_write_address(char *, size_t, ADDRESS *, int);
-void rfc822_write_address_single(char *, size_t, ADDRESS *, int);
+} address_t;
+
+void rfc822_free_address(address_t **);
+void rfc822_qualify(address_t *, const char *);
+address_t *rfc822_parse_adrlist(address_t *, const char *s);
+address_t *rfc822_cpy_adr(address_t * addr);
+address_t *rfc822_cpy_adr_real(address_t * addr);
+address_t *rfc822_append(address_t ** a, address_t * b);
+void rfc822_write_address(char *, size_t, address_t *, int);
+void rfc822_write_address_single(char *, size_t, address_t *, int);
void rfc822_cat(char *, size_t, const char *, const char *);
extern int RFC822Error;
extern const char RFC822Specials[];
#define rfc822_error(x) RFC822Errors[x]
-#define rfc822_new_address() calloc(1,sizeof(ADDRESS))
+#define rfc822_new_address() calloc(1,sizeof(address_t))
/****************************************************************************/
/* RFC 2231 */
*w = 0;
}
-void rfc822_free_address (ADDRESS ** p)
+void rfc822_free_address (address_t ** p)
{
- ADDRESS *t;
+ address_t *t;
while (*p) {
t = *p;
char *token, size_t * tokenlen,
size_t tokenmax, char *comment,
size_t * commentlen, size_t commentmax,
- ADDRESS * addr)
+ address_t * addr)
{
s = parse_mailboxdomain (s, ".\"(\\",
token, tokenlen, tokenmax,
static const char *parse_route_addr (const char *s,
char *comment, size_t * commentlen,
- size_t commentmax, ADDRESS * addr)
+ size_t commentmax, address_t * addr)
{
char token[STRING];
size_t tokenlen = 0;
static const char *parse_addr_spec (const char *s,
char *comment, size_t * commentlen,
- size_t commentmax, ADDRESS * addr)
+ size_t commentmax, address_t * addr)
{
char token[STRING];
size_t tokenlen = 0;
}
static void
-add_addrspec (ADDRESS ** top, ADDRESS ** last, const char *phrase,
+add_addrspec (address_t ** top, address_t ** last, const char *phrase,
char *comment, size_t * commentlen, size_t commentmax)
{
- ADDRESS *cur = rfc822_new_address ();
+ address_t *cur = rfc822_new_address ();
if (parse_addr_spec (phrase, comment, commentlen, commentmax, cur) == NULL) {
rfc822_free_address (&cur);
*last = cur;
}
-ADDRESS *rfc822_parse_adrlist (ADDRESS * top, const char *s)
+address_t *rfc822_parse_adrlist (address_t * top, const char *s)
{
int ws_pending;
const char *begin, *ps;
char comment[STRING], phrase[STRING];
size_t phraselen = 0, commentlen = 0;
- ADDRESS *cur, *last = NULL;
+ address_t *cur, *last = NULL;
RFC822Error = 0;
return top;
}
-void rfc822_qualify (ADDRESS * addr, const char *host)
+void rfc822_qualify (address_t * addr, const char *host)
{
char *p;
m_strcpy(buf, buflen, value);
}
-void rfc822_write_address_single (char *buf, size_t buflen, ADDRESS * addr,
+void rfc822_write_address_single (char *buf, size_t buflen, address_t * addr,
int display)
{
size_t len;
}
/* note: it is assumed that `buf' is nul terminated! */
-void rfc822_write_address (char *buf, size_t buflen, ADDRESS * addr,
+void rfc822_write_address (char *buf, size_t buflen, address_t * addr,
int display)
{
char *pbuf = buf;
}
/* this should be rfc822_cpy_adr */
-ADDRESS *rfc822_cpy_adr_real (ADDRESS * addr)
+address_t *rfc822_cpy_adr_real (address_t * addr)
{
- ADDRESS *p = rfc822_new_address ();
+ address_t *p = rfc822_new_address ();
p->personal = m_strdup(addr->personal);
p->mailbox = m_strdup(addr->mailbox);
}
/* this should be rfc822_cpy_adrlist */
-ADDRESS *rfc822_cpy_adr (ADDRESS * addr)
+address_t *rfc822_cpy_adr (address_t * addr)
{
- ADDRESS *top = NULL, *last = NULL;
+ address_t *top = NULL, *last = NULL;
for (; addr; addr = addr->next) {
if (last) {
}
/* append list 'b' to list 'a' and return the last element in the new list */
-ADDRESS *rfc822_append (ADDRESS ** a, ADDRESS * b)
+address_t *rfc822_append (address_t ** a, address_t * b)
{
- ADDRESS *tmp = *a;
+ address_t *tmp = *a;
while (tmp && tmp->next)
tmp = tmp->next;
if (alias_queries) {
int rv = 0;
- ADDRESS *a;
+ address_t *a;
for (; alias_queries; alias_queries = alias_queries->next) {
if ((a = mutt_lookup_alias (alias_queries->data))) {
void mutt_init (int, LIST *);
typedef struct envelope {
- ADDRESS *return_path;
- ADDRESS *from;
- ADDRESS *to;
- ADDRESS *cc;
- ADDRESS *bcc;
- ADDRESS *sender;
- ADDRESS *reply_to;
- ADDRESS *mail_followup_to;
+ address_t *return_path;
+ address_t *from;
+ address_t *to;
+ address_t *cc;
+ address_t *bcc;
+ address_t *sender;
+ address_t *reply_to;
+ address_t *mail_followup_to;
char *list_post; /* this stores a mailto URL, or nothing */
char *subject;
char *real_subj; /* offset of the real subject */
#ifndef MUTT_CRYPT_H
#define MUTT_CRYPT_H
-#include "mutt.h" /* Need this to declare BODY, ADDRESS. STATE etc. */
+#include "mutt.h" /* Need this to declare BODY, address_t. STATE etc. */
#include "state.h"
/* FIXME: They should be pointer to anonymous structures for better
int crypt_pgp_encrypted_handler (BODY * a, STATE * s);
/* fixme: needs documentation. */
-void crypt_pgp_invoke_getkeys (ADDRESS * addr);
+void crypt_pgp_invoke_getkeys (address_t * addr);
/* Ask for a PGP key. */
pgp_key_t crypt_pgp_ask_for_key (char *tag, char *whatfor,
/* This routine attempts to find the keyids of the recipients of a
message. It returns NULL if any of the keys can not be found. */
-char *crypt_pgp_findkeys (ADDRESS * to, ADDRESS * cc, ADDRESS * bcc);
+char *crypt_pgp_findkeys (address_t * to, address_t * cc, address_t * bcc);
/* Create a new body with a PGP signed message from A. */
BODY *crypt_pgp_sign_message (BODY * a);
/* This routine attempts to find the keyids of the recipients of a
message. It returns NULL if any of the keys can not be found. */
-char *crypt_smime_findkeys (ADDRESS * to, ADDRESS * cc, ADDRESS * bcc);
+char *crypt_smime_findkeys (address_t * to, address_t * cc, address_t * bcc);
/* fixme: Needs documentation. */
BODY *crypt_smime_sign_message (BODY * a);
return 0;
}
-int mutt_addrlist_to_idna (ADDRESS * a, char **err)
+int mutt_addrlist_to_idna (address_t * a, char **err)
{
char *user = NULL, *domain = NULL;
char *tmp = NULL;
return 0;
}
-int mutt_addrlist_to_local (ADDRESS * a)
+int mutt_addrlist_to_local (address_t * a)
{
char *user, *domain;
char *tmp = NULL;
}
/* convert just for displaying purposes */
-const char *mutt_addr_for_display (ADDRESS * a)
+const char *mutt_addr_for_display (address_t * a)
{
static char *buff = NULL;
char *tmp = NULL;
int mutt_idna_to_local (const char *, char **, int);
int mutt_local_to_idna (const char *, char **);
-int mutt_addrlist_to_idna (ADDRESS *, char **);
-int mutt_addrlist_to_local (ADDRESS *);
+int mutt_addrlist_to_idna (address_t *, char **);
+int mutt_addrlist_to_local (address_t *);
void mutt_env_to_local (ENVELOPE *);
int mutt_env_to_idna (ENVELOPE *, const char **, const char **);
-const char *mutt_addr_for_display (ADDRESS * a);
+const char *mutt_addr_for_display (address_t * a);
/* Work around incompatibilities in the libidn API */
* Very similar to sendlib.c::add_args
*/
static int
-_mutt_libesmtp_add_recipients (smtp_message_t message, ADDRESS * addr)
+_mutt_libesmtp_add_recipients (smtp_message_t message, address_t * addr)
{
int ret = 0;
* Returns 0 upon success, -1 upon failure (and prints an error
* message).
*/
-int mutt_libesmtp_invoke (ADDRESS * from, /* the sender */
- ADDRESS * to, ADDRESS * cc, ADDRESS * bcc, /* recips */
+int mutt_libesmtp_invoke (address_t * from, /* the sender */
+ address_t * to, address_t * cc, address_t * bcc, /* recips */
const char *msg, /* file containing message */
int eightbit)
{ /* message contains 8bit chars */
char* errbuf, size_t errlen);
#endif
-int mutt_libesmtp_invoke (ADDRESS * from, /* the sender */
- ADDRESS * to, ADDRESS * cc, ADDRESS * bcc, /* recips */
+int mutt_libesmtp_invoke (address_t * from, /* the sender */
+ address_t * to, address_t * cc, address_t * bcc, /* recips */
const char *msg, /* file containing message */
int eightbit); /* message contains 8bit chars */
case '@':
{
HEADER *h;
- ADDRESS *alias;
+ address_t *alias;
if ((alias = mutt_lookup_alias (s + 1))) {
h = mutt_new_header ();
return 0;
}
-void mutt_save_path (char *d, size_t dsize, ADDRESS * a)
+void mutt_save_path (char *d, size_t dsize, address_t * a)
{
if (a && a->mailbox) {
m_strcpy(d, dsize, a->mailbox);
*d = 0;
}
-void mutt_safe_path (char *s, size_t l, ADDRESS * a)
+void mutt_safe_path (char *s, size_t l, address_t * a)
{
char *p;
}
/* return 1 if address lists are strictly identical */
-int mutt_cmp_addr (const ADDRESS * a, const ADDRESS * b)
+int mutt_cmp_addr (const address_t * a, const address_t * b)
{
while (a && b) {
if (m_strcmp(a->mailbox, b->mailbox) ||
MESSAGE *mx_open_new_message (CONTEXT * dest, HEADER * hdr, int flags)
{
MESSAGE *msg;
- ADDRESS *p = NULL;
+ address_t *p = NULL;
if (!MX_IDX(dest->magic-1)) {
debug_print (1, ("function unimplemented for mailbox type %d.\n", dest->magic));
return (e);
}
-ADDRESS *mutt_parse_adrlist (ADDRESS * p, const char *s)
+address_t *mutt_parse_adrlist (address_t * p, const char *s)
{
const char *q;
int n, ...)
{
va_list ap;
- ADDRESS *a;
+ address_t *a;
va_start (ap, n);
for (; n; n--) {
- for (a = va_arg (ap, ADDRESS *); a; a = a->next) {
+ for (a = va_arg (ap, address_t *); a; a = a->next) {
if (pat->alladdr ^
((a->mailbox && patmatch (pat, a->mailbox) == 0) ||
(match_personal && a->personal &&
return 0;
}
-int mutt_is_list_recipient (int alladdr, ADDRESS * a1, ADDRESS * a2)
+int mutt_is_list_recipient (int alladdr, address_t * a1, address_t * a2)
{
for (; a1; a1 = a1->next)
if (alladdr ^ mutt_is_subscribed_list (a1))
return alladdr;
}
-int mutt_is_list_cc (int alladdr, ADDRESS * a1, ADDRESS * a2)
+int mutt_is_list_cc (int alladdr, address_t * a1, address_t * a2)
{
for (; a1; a1 = a1->next)
if (alladdr ^ mutt_is_mail_list (a1))
return alladdr;
}
-static int match_user (int alladdr, ADDRESS * a1, ADDRESS * a2)
+static int match_user (int alladdr, address_t * a1, address_t * a2)
{
for (; a1; a1 = a1->next)
if (alladdr ^ mutt_addr_is_user (a1))
/* This routine attempts to find the keyids of the recipients of a message.
* It returns NULL if any of the keys can not be found.
*/
-char *pgp_findKeys (ADDRESS * to, ADDRESS * cc, ADDRESS * bcc)
+char *pgp_findKeys (address_t * to, address_t * cc, address_t * bcc)
{
char *keyID, *keylist = NULL, *t;
size_t keylist_size = 0;
size_t keylist_used = 0;
- ADDRESS *tmp = NULL, *addr = NULL;
- ADDRESS **last = &tmp;
- ADDRESS *p, *q;
+ address_t *tmp = NULL, *addr = NULL;
+ address_t **last = &tmp;
+ address_t *p, *q;
int i;
pgp_key_t k_info = NULL, key = NULL;
/* pgp_key_t gpg_get_candidates (struct pgp_vinfo *, pgp_ring_t, LIST *); */
pgp_key_t pgp_ask_for_key (char *, char *, short, pgp_ring_t);
pgp_key_t pgp_get_candidates (pgp_ring_t, LIST *);
-pgp_key_t pgp_getkeybyaddr (ADDRESS *, short, pgp_ring_t);
+pgp_key_t pgp_getkeybyaddr (address_t *, short, pgp_ring_t);
pgp_key_t pgp_getkeybystr (char *, short, pgp_ring_t);
-char *pgp_findKeys (ADDRESS * to, ADDRESS * cc, ADDRESS * bcc);
+char *pgp_findKeys (address_t * to, address_t * cc, address_t * bcc);
void pgp_forget_passphrase (void);
int pgp_application_pgp_handler (BODY *, STATE *);
void pgp_invoke_import (const char *fname);
-void pgp_invoke_getkeys (ADDRESS *);
+void pgp_invoke_getkeys (address_t *);
/* private ? */
mutt_system (cmd);
}
-void pgp_invoke_getkeys (ADDRESS * addr)
+void pgp_invoke_getkeys (address_t * addr)
{
char buff[LONG_STRING];
char tmp[LONG_STRING];
#define PGP_KV_MATCH (PGP_KV_ADDR|PGP_KV_STRING)
-static int pgp_id_matches_addr (ADDRESS * addr, ADDRESS * u_addr,
+static int pgp_id_matches_addr (address_t * addr, address_t * u_addr,
pgp_uid_t * uid)
{
int rv = 0;
return rv;
}
-static pgp_key_t pgp_select_key (pgp_key_t keys, ADDRESS * p, const char *s)
+static pgp_key_t pgp_select_key (pgp_key_t keys, address_t * p, const char *s)
{
int keymax;
pgp_uid_t **KeyTable;
return NULL;
}
-pgp_key_t pgp_getkeybyaddr (ADDRESS * a, short abilities, pgp_ring_t keyring)
+pgp_key_t pgp_getkeybyaddr (address_t * a, short abilities, pgp_ring_t keyring)
{
- ADDRESS *r, *p;
+ address_t *r, *p;
LIST *hints = NULL;
int weak = 0;
int mutt_option_value (const char* val, char* dst, size_t dstlen);
-ADDRESS *mutt_default_from (void);
-ADDRESS *mutt_remove_duplicates (ADDRESS *);
-ADDRESS *mutt_parse_adrlist (ADDRESS *, const char *);
+address_t *mutt_default_from (void);
+address_t *mutt_remove_duplicates (address_t *);
+address_t *mutt_parse_adrlist (address_t *, const char *);
BODY *mutt_make_file_attach (const char *);
BODY *mutt_make_message_attach (CONTEXT *, HEADER *, int);
HEADER *mutt_dup_header (HEADER *);
int mutt_cmp_header (const HEADER*, const HEADER*);
-int mutt_cmp_addr (const ADDRESS * a, const ADDRESS * b);
+int mutt_cmp_addr (const address_t * a, const address_t * b);
int mutt_cmp_list (const LIST * a, const LIST * b);
int mutt_cmp_env (const ENVELOPE * e1, const ENVELOPE * e2);
int mutt_cmp_param (const PARAMETER * p1, const PARAMETER * p2);
char *mutt_gecos_name (char *, size_t, struct passwd *);
char *mutt_gen_msgid (void);
char *mutt_get_body_charset (char *, size_t, BODY *);
-const char *mutt_get_name (ADDRESS *);
+const char *mutt_get_name (address_t *);
char *mutt_get_parameter (const char *, PARAMETER *);
-char *mutt_crypt_hook (ADDRESS *);
+char *mutt_crypt_hook (address_t *);
char *mutt_make_date (char *, size_t);
const char *mutt_make_version (int full);
void mutt_allow_interrupt (int);
void mutt_block_signals (void);
void mutt_block_signals_system (void);
-int mutt_bounce_message (FILE * fp, HEADER *, ADDRESS *);
+int mutt_bounce_message (FILE * fp, HEADER *, address_t *);
void mutt_canonical_charset (char *, size_t, const char *);
int mutt_count_body_parts (HEADER *hdr, int flags);
void mutt_check_rescore (CONTEXT *);
void mutt_print_message (HEADER *);
void mutt_query_exit (void);
void mutt_query_menu (char *, size_t);
-void mutt_safe_path (char *s, size_t l, ADDRESS * a);
-void mutt_save_path (char *s, size_t l, ADDRESS * a);
+void mutt_safe_path (char *s, size_t l, address_t * a);
+void mutt_save_path (char *s, size_t l, address_t * a);
void mutt_score_message (CONTEXT *, HEADER *, int);
void mutt_select_fcc (char *, size_t, HEADER *);
void mutt_update_encoding (BODY * a);
void mutt_version (void);
void mutt_write_references (LIST *, FILE *);
-void mutt_write_address_list (ADDRESS * adr, FILE * fp, int linelen,
+void mutt_write_address_list (address_t * adr, FILE * fp, int linelen,
int display);
int mutt_addwch (wchar_t);
int mutt_get_hook_type (const char *);
int mutt_get_postponed (CONTEXT *, HEADER *, HEADER **, char *, size_t);
int mutt_index_menu (void);
-int mutt_invoke_mta (ADDRESS *, ADDRESS *, ADDRESS *, ADDRESS *, const char *,
+int mutt_invoke_mta (address_t *, address_t *, address_t *, address_t *, const char *,
int);
-int mutt_is_mail_list (ADDRESS *);
-int mutt_is_list_cc (int, ADDRESS *, ADDRESS *);
-int mutt_is_list_recipient (int, ADDRESS *, ADDRESS *);
-int mutt_is_subscribed_list (ADDRESS *);
+int mutt_is_mail_list (address_t *);
+int mutt_is_list_cc (int, address_t *, address_t *);
+int mutt_is_list_recipient (int, address_t *, address_t *);
+int mutt_is_subscribed_list (address_t *);
int mutt_is_text_part (BODY *);
int mutt_is_valid_mailbox (const char *);
int mutt_lookup_mime_type (BODY *, const char *);
#include <ctype.h>
typedef struct query {
- ADDRESS *addr;
+ address_t *addr;
char *name;
char *other;
struct query *next;
static void query_menu (char *buf, size_t buflen, QUERY * results,
int retbuf);
-static ADDRESS *result_to_addr (QUERY * r)
+static address_t *result_to_addr (QUERY * r)
{
- static ADDRESS *tmp;
+ static address_t *tmp;
tmp = rfc822_cpy_adr (r->addr);
int mutt_query_complete (char *buf, size_t buflen)
{
QUERY *results = NULL;
- ADDRESS *tmpa;
+ address_t *tmpa;
if (!QueryCmd) {
mutt_error _("Query command not defined.");
case OP_CREATE_ALIAS:
if (menu->tagprefix) {
- ADDRESS *naddr = NULL;
+ address_t *naddr = NULL;
for (i = 0; i < menu->max; i++)
if (QueryTable[i].tagged) {
- ADDRESS *a = result_to_addr (QueryTable[i].data);
+ address_t *a = result_to_addr (QueryTable[i].data);
rfc822_append (&naddr, a);
rfc822_free_address (&a);
mutt_create_alias (NULL, naddr);
}
else {
- ADDRESS *a = result_to_addr (QueryTable[menu->current].data);
+ address_t *a = result_to_addr (QueryTable[menu->current].data);
mutt_create_alias (NULL, a);
rfc822_free_address (&a);
else {
for (i = 0; i < menu->max; i++)
if (QueryTable[i].tagged) {
- ADDRESS *a = result_to_addr (QueryTable[i].data);
+ address_t *a = result_to_addr (QueryTable[i].data);
rfc822_append (&msg->env->to, a);
rfc822_free_address (&a);
for (i = 0; i < menu->max; i++) {
if (QueryTable[i].tagged) {
if (curpos == 0) {
- ADDRESS *tmpa = result_to_addr (QueryTable[i].data);
+ address_t *tmpa = result_to_addr (QueryTable[i].data);
mutt_addrlist_to_local (tmpa);
tagged = 1;
rfc822_free_address (&tmpa);
}
else if (curpos + 2 < buflen) {
- ADDRESS *tmpa = result_to_addr (QueryTable[i].data);
+ address_t *tmpa = result_to_addr (QueryTable[i].data);
mutt_addrlist_to_local (tmpa);
strcat (buf, ", "); /* __STRCAT_CHECKED__ */
}
/* then enter current message */
if (!tagged) {
- ADDRESS *tmpa = result_to_addr (QueryTable[menu->current].data);
+ address_t *tmpa = result_to_addr (QueryTable[menu->current].data);
mutt_addrlist_to_local (tmpa);
rfc822_write_address (buf, buflen, tmpa, 0);
char prompt[STRING];
char buf[HUGE_STRING];
char *err = NULL;
- ADDRESS *adr = NULL;
+ address_t *adr = NULL;
int ret = 0;
int p = 0;
{
const char *fqdn;
short need_hostname = 0;
- ADDRESS *p;
+ address_t *p;
if (msg->env->cc || msg->env->bcc) {
mutt_error _("Mixmaster doesn't accept Cc or Bcc headers.");
*pd = e;
}
-void rfc2047_encode_adrlist (ADDRESS * addr, const char *tag)
+void rfc2047_encode_adrlist (address_t * addr, const char *tag)
{
- ADDRESS *ptr = addr;
+ address_t *ptr = addr;
int col = tag ? m_strlen(tag) + 2 : 32;
while (ptr) {
str_adjust (pd);
}
-void rfc2047_decode_adrlist (ADDRESS * a)
+void rfc2047_decode_adrlist (address_t * a)
{
while (a) {
if (a->personal)
char *u, size_t ulen, char **d, size_t * dlen);
void _rfc2047_encode_string (char **, int, int);
-void rfc2047_encode_adrlist (ADDRESS *, const char *);
+void rfc2047_encode_adrlist (address_t *, const char *);
#define rfc2047_encode_string(a) _rfc2047_encode_string (a, 0, 32);
void rfc2047_decode (char **);
-void rfc2047_decode_adrlist (ADDRESS *);
+void rfc2047_decode_adrlist (address_t *);
void rfc2047_decode_envelope (ENVELOPE* e);
}
/* compare two e-mail addresses and return 1 if they are equivalent */
-static int mutt_addrcmp (ADDRESS * a, ADDRESS * b)
+static int mutt_addrcmp (address_t * a, address_t * b)
{
if (!a->mailbox || !b->mailbox)
return 0;
}
/* search an e-mail address in a list */
-static int mutt_addrsrc (ADDRESS * a, ADDRESS * lst)
+static int mutt_addrsrc (address_t * a, address_t * lst)
{
for (; lst; lst = lst->next) {
if (mutt_addrcmp (a, lst))
}
/* removes addresses from "b" which are contained in "a" */
-static ADDRESS *mutt_remove_xrefs (ADDRESS * a, ADDRESS * b)
+static address_t *mutt_remove_xrefs (address_t * a, address_t * b)
{
- ADDRESS *top, *p, *prev = NULL;
+ address_t *top, *p, *prev = NULL;
top = b;
while (b) {
/* remove any address which matches the current user. if `leave_only' is
* nonzero, don't remove the user's address if it is the only one in the list
*/
-static ADDRESS *remove_user (ADDRESS * a, int leave_only)
+static address_t *remove_user (address_t * a, int leave_only)
{
- ADDRESS *top = NULL, *last = NULL;
+ address_t *top = NULL, *last = NULL;
while (a) {
if (!mutt_addr_is_user (a)) {
last->next = NULL;
}
else {
- ADDRESS *tmp = a;
+ address_t *tmp = a;
a = a->next;
if (!leave_only || a || last) {
return top;
}
-static ADDRESS *find_mailing_lists (ADDRESS * t, ADDRESS * c)
+static address_t *find_mailing_lists (address_t * t, address_t * c)
{
- ADDRESS *top = NULL, *ptr = NULL;
+ address_t *top = NULL, *ptr = NULL;
for (; t || c; t = c, c = NULL) {
for (; t; t = t->next) {
return top;
}
-static int edit_address (ADDRESS ** a, const char *field)
+static int edit_address (address_t ** a, const char *field)
{
char buf[HUGE_STRING];
char *err = NULL;
return 0;
}
-static int default_to (ADDRESS ** to, ENVELOPE * env, int flags, int hmfupto)
+static int default_to (address_t ** to, ENVELOPE * env, int flags, int hmfupto)
{
char prompt[STRING];
- ADDRESS *tmp;
+ address_t *tmp;
if (flags && env->mail_followup_to && hmfupto == M_YES) {
rfc822_append (to, env->mail_followup_to);
int mutt_fetch_recips (ENVELOPE * out, ENVELOPE * in, int flags)
{
char prompt[STRING];
- ADDRESS *tmp;
+ address_t *tmp;
int hmfupto = -1;
if ((flags & (SENDLISTREPLY | SENDGROUPREPLY)) && in->mail_followup_to) {
void mutt_set_followup_to (ENVELOPE * e)
{
- ADDRESS *t = NULL;
- ADDRESS *from;
+ address_t *t = NULL;
+ address_t *from;
/*
* Only generate the Mail-Followup-To if the user has requested it, and
/* look through the recipients of the message we are replying to, and if
we find an address that matches $alternates, we use that as the default
from field */
-static ADDRESS *set_reverse_name (ENVELOPE * env)
+static address_t *set_reverse_name (ENVELOPE * env)
{
- ADDRESS *tmp;
+ address_t *tmp;
for (tmp = env->to; tmp; tmp = tmp->next) {
if (mutt_addr_is_user (tmp))
return (tmp);
}
-ADDRESS *mutt_default_from (void)
+address_t *mutt_default_from (void)
{
- ADDRESS *adr;
+ address_t *adr;
const char *fqdn = mutt_fqdn (1);
/*
/* wrapper around mutt_write_address() so we can handle very large
recipient lists without needing a huge temporary buffer in memory */
-void mutt_write_address_list (ADDRESS * adr, FILE * fp, int linelen,
+void mutt_write_address_list (address_t * adr, FILE * fp, int linelen,
int display)
{
- ADDRESS *tmp;
+ address_t *tmp;
char buf[LONG_STRING];
int count = 0;
int len;
}
static const char **
-add_args(const char **args, size_t *argslen, size_t *argsmax, ADDRESS * addr)
+add_args(const char **args, size_t *argslen, size_t *argsmax, address_t * addr)
{
for (; addr; addr = addr->next) {
/* weed out group mailboxes, since those are for display only */
return (args);
}
-static int mutt_invoke_sendmail (ADDRESS * from, /* the sender */
- ADDRESS * to, ADDRESS * cc, ADDRESS * bcc, /* recips */
+static int mutt_invoke_sendmail (address_t * from, /* the sender */
+ address_t * to, address_t * cc, address_t * bcc, /* recips */
const char *msg, /* file containing message */
int eightbit)
{ /* message contains 8bit chars */
args = add_option(args, &argslen, &argsmax, "-B8BITMIME");
if (option (OPTENVFROM)) {
- ADDRESS *f = NULL;
+ address_t *f = NULL;
if (EnvFrom)
f = EnvFrom;
else if (from && !from->next)
return (i);
}
-int mutt_invoke_mta (ADDRESS * from, /* the sender */
- ADDRESS * to, ADDRESS * cc, ADDRESS * bcc, /* recips */
+int mutt_invoke_mta (address_t * from, /* the sender */
+ address_t * to, address_t * cc, address_t * bcc, /* recips */
const char *msg, /* file containing message */
int eightbit)
{ /* message contains 8bit chars */
rfc2047_decode (&env->subject);
}
-static int _mutt_bounce_message (FILE * fp, HEADER * h, ADDRESS * to,
- const char *resent_from, ADDRESS * env_from)
+static int _mutt_bounce_message (FILE * fp, HEADER * h, address_t * to,
+ const char *resent_from, address_t * env_from)
{
int i, ret = 0;
FILE *f;
return ret;
}
-int mutt_bounce_message (FILE * fp, HEADER * h, ADDRESS * to)
+int mutt_bounce_message (FILE * fp, HEADER * h, address_t * to)
{
- ADDRESS *from;
+ address_t *from;
const char *fqdn = mutt_fqdn (1);
char resent_from[STRING];
int ret;
/* given a list of addresses, return a list of unique addresses */
-ADDRESS *mutt_remove_duplicates (ADDRESS * addr)
+address_t *mutt_remove_duplicates (address_t * addr)
{
- ADDRESS *top = addr;
- ADDRESS **last = ⊤
- ADDRESS *tmp;
+ address_t *top = addr;
+ address_t **last = ⊤
+ address_t *tmp;
int dup;
while (addr) {
void smime_getkeys (ENVELOPE * env)
{
- ADDRESS *t;
+ address_t *t;
int found = 0;
if (option (OPTSDEFAULTDECRYPTKEY) && SmimeDefaultKey && *SmimeDefaultKey) {
* It returns NULL if any of the keys can not be found.
*/
-char *smime_findKeys (ADDRESS * to, ADDRESS * cc, ADDRESS * bcc)
+char *smime_findKeys (address_t * to, address_t * cc, address_t * bcc)
{
char *keyID, *keylist = NULL;
size_t keylist_size = 0;
size_t keylist_used = 0;
- ADDRESS *tmp = NULL, *addr = NULL;
- ADDRESS **last = &tmp;
- ADDRESS *p, *q;
+ address_t *tmp = NULL, *addr = NULL;
+ address_t **last = &tmp;
+ address_t *p, *q;
int i;
const char *fqdn = mutt_fqdn (1);
char *smime_ask_for_key (char *, char *, short);
-char *smime_findKeys (ADDRESS * to, ADDRESS * cc, ADDRESS * bcc);
+char *smime_findKeys (address_t * to, address_t * cc, address_t * bcc);
void smime_invoke_import (char *, char *);
return (SORTCODE (rc));
}
-const char *mutt_get_name (ADDRESS * a)
+const char *mutt_get_name (address_t * a)
{
- ADDRESS *ali;
+ address_t *ali;
const char *name = "";
if (a) {