return NULL;
}
+/* This routine looks to see if the user has an alias defined for the given
+ address. */
+const address_t *alias_reverse_lookup(const alias_t *list, const address_t *a)
+{
+ if (!a || !a->mailbox)
+ return NULL;
+
+ for (; list; list = list->next) {
+ address_t *ap;
+
+ /* cycle through all addresses if this is a group alias */
+ for (ap = list->addr; ap; ap = ap->next) {
+ if (!ap->group && ap->mailbox
+ && !ascii_strcasecmp(ap->mailbox, a->mailbox))
+ return ap;
+ }
+ }
+
+ return NULL;
+}
+
static int string_is_address(const char *str, const char *u, const char *d)
{
char buf[LONG_STRING];
/************* READ MARK *********************/
-
-/*
- * This routine looks to see if the user has an alias defined for the given
- * address.
- */
-address_t *alias_reverse_lookup (address_t * a)
-{
- alias_t *t = Aliases;
- address_t *ap;
-
- if (!a || !a->mailbox)
- return NULL;
-
- for (; t; t = t->next) {
- /* cycle through all addresses if this is a group alias */
- for (ap = t->addr; ap; ap = ap->next) {
- if (!ap->group && ap->mailbox &&
- ascii_strcasecmp (ap->mailbox, a->mailbox) == 0)
- return ap;
- }
- }
- return 0;
-}
-
/* alias_complete() -- alias completion routine
*
* given a partial alias, this routine attempts to fill in the alias
DO_SLIST(alias_t, alias, alias_delete);
const address_t *alias_lookup(const alias_t *list, const char *s);
+const address_t *alias_reverse_lookup(const alias_t *list, const address_t *);
+
int mutt_addr_is_user(address_t *);
address_t *mutt_get_address(ENVELOPE *, const char **);
void mutt_create_alias(ENVELOPE *, address_t *);
address_t *mutt_expand_aliases(address_t *);
void mutt_expand_aliases_env(ENVELOPE *);
-address_t *alias_reverse_lookup(address_t *);
int mutt_alias_complete(char *, size_t);
void mutt_alias_menu(char *, size_t, alias_t *);
return res;
}
+/* FIXME: b0rken API's, replace that at any cost */
string_list_t *mutt_add_list_n(string_list_t *head, const void *data, size_t len) {
string_list_t *tmp;
string_list_t *string_list_dup(const string_list_t *);
+/* FIXME: b0rken API's, replace that at any cost */
/* add an element to a list */
string_list_t *mutt_add_list_n(string_list_t*, const void*, size_t len);
static inline string_list_t *mutt_add_list(string_list_t *head, const char *data) {
return mutt_add_list_n(head, data, len ? len + 1 : 0);
}
-
-
#endif /* MUTT_LIB_LIB_LIST_H */
* - or we have an alias for current address
* - or From: contains valid email address _and_ name has >= 2 fields
*/
- return (pat->
- not ^ (h->env && h->env->from && (mutt_addr_is_user (h->env->from)
- ||
- (alias_reverse_lookup
- (h->env->from) != NULL)
- || (h->env->from->personal
- && valid_realname (h->env->
- from->
- personal)
- && h->env->from->mailbox)
- )));
+ return (h->env && h->env->from
+ && (mutt_addr_is_user(h->env->from)
+ || alias_reverse_lookup(Aliases, h->env->from)
+ || (h->env->from->personal
+ && valid_realname(h->env-> from->personal)
+ && h->env->from->mailbox)
+ )) ^ pat->not;
#ifdef USE_NNTP
case M_NEWSGROUPS:
return (pat->
const char *name = "";
if (a) {
- if (option (OPTREVALIAS) && (ali = alias_reverse_lookup (a))
+ if (option (OPTREVALIAS) && (ali = alias_reverse_lookup(Aliases, a))
&& ali->personal)
name = ali->personal;
else if (a->personal)