}
/**
- * mutt_addr_qualify - Expand local names in an Address list using a hostname
- * @param addr Address list
+ * mutt_addresslist_qualify - Expand local names in an Address list using a hostname
+ * @param al Address list
* @param host Hostname
*
* Any addresses containing a bare name will be expanded using the hostname.
*/
void mutt_addresslist_qualify(struct AddressList *al, const char *host)
{
- if (!host || !*host)
+ if (!al || !host || !*host)
return;
struct AddressNode *an = NULL;
}
}
-void mutt_addr_qualify(struct Address *addr, const char *host)
-{
- struct AddressList *al = mutt_addr_to_addresslist(addr);
- mutt_addresslist_qualify(al, host);
- mutt_addresslist_to_addr(al); // addr does not change
- FREE(&al);
-}
-
/**
* mutt_addr_cat - Copy a string and escape the specified characters
* @param buf Buffer for the result
bool mutt_addr_is_local(const struct Address *a);
int mutt_addr_mbox_to_udomain(const char *mbox, char **user, char **domain);
struct Address *mutt_addr_new(void);
-void mutt_addr_qualify(struct Address *addr, const char *host);
int mutt_addr_remove_from_list(struct AddressList *a, const char *mailbox);
void mutt_addr_remove_xrefs(const struct AddressList *a, struct AddressList *b);
void mutt_addr_set_intl(struct Address *a, char *intl_mailbox);
if (!from->personal)
from->personal = mutt_str_strdup(C_Realname);
- if (fqdn)
- mutt_addr_qualify(from, fqdn);
+ mutt_addresslist_qualify(&from_list, fqdn);
rfc2047_encode_addrlist(&from_list, "Resent-From");
if (mutt_addresslist_to_intl(&from_list, &err))
test/address/mutt_addresslist_equal.o \
test/address/mutt_addresslist_parse2.o \
test/address/mutt_addresslist_parse.o \
+ test/address/mutt_addresslist_qualify.o \
test/address/mutt_addrlist_dedupe.o \
test/address/mutt_addrlist_to_intl.o \
test/address/mutt_addrlist_to_local.o \
test/address/mutt_addr_mbox_to_udomain.o \
test/address/mutt_addr_new.o \
- test/address/mutt_addr_qualify.o \
test/address/mutt_addr_remove_from_list.o \
test/address/mutt_addr_remove_xrefs.o \
test/address/mutt_addr_search.o \
/**
* @file
- * Test code for mutt_addr_qualify()
+ * Test code for mutt_addresslist_qualify()
*
* @authors
* Copyright (C) 2019 Richard Russon <rich@flatcap.org>
#include "mutt/mutt.h"
#include "address/lib.h"
-void test_mutt_addr_qualify(void)
+void test_mutt_addresslist_qualify(void)
{
- // void mutt_addr_qualify(struct Address *addr, const char *host);
+ // void mutt_addresslist_qualify(struct Address *addr, const char *host);
{
- mutt_addr_qualify(NULL, "example.com");
- TEST_CHECK_(1, "mutt_addr_qualify(NULL, \"example.com\")");
+ mutt_addresslist_qualify(NULL, "example.com");
+ TEST_CHECK_(1, "mutt_addresslist_qualify(NULL, \"example.com\")");
}
{
- struct Address addr = { 0 };
- mutt_addr_qualify(&addr, NULL);
- TEST_CHECK_(1, "mutt_addr_qualify(&addr, NULL)");
+ struct AddressList al = TAILQ_HEAD_INITIALIZER(al);
+ mutt_addresslist_qualify(&al, NULL);
+ TEST_CHECK_(1, "mutt_addresslist_qualify(&addr, NULL)");
}
}
NEOMUTT_TEST_ITEM(test_mutt_addr_is_local) \
NEOMUTT_TEST_ITEM(test_mutt_addr_mbox_to_udomain) \
NEOMUTT_TEST_ITEM(test_mutt_addr_new) \
- NEOMUTT_TEST_ITEM(test_mutt_addr_qualify) \
NEOMUTT_TEST_ITEM(test_mutt_addr_remove_from_list) \
NEOMUTT_TEST_ITEM(test_mutt_addr_remove_xrefs) \
NEOMUTT_TEST_ITEM(test_mutt_addr_search) \
NEOMUTT_TEST_ITEM(test_mutt_addresslist_equal) \
NEOMUTT_TEST_ITEM(test_mutt_addresslist_parse) \
NEOMUTT_TEST_ITEM(test_mutt_addresslist_parse2) \
+ NEOMUTT_TEST_ITEM(test_mutt_addresslist_qualify) \
NEOMUTT_TEST_ITEM(test_mutt_addrlist_to_intl) \
NEOMUTT_TEST_ITEM(test_mutt_addrlist_to_local) \
NEOMUTT_TEST_ITEM(test_mutt_actx_add_attach) \