+/* given a list of addresses, return a list of unique addresses */
+void address_list_uniq(address_t *a)
+{
+ for (; a; a = a->next) {
+ address_t **b = &a->next;
+
+ if (!a->mailbox)
+ continue;
+
+ while (*b) {
+ if ((*b)->mailbox && !ascii_strcasecmp((*b)->mailbox, a->mailbox))
+ {
+ address_t *pop = address_list_pop(b);
+ address_delete(&pop);
+ } else {
+ b = &(*b)->next;
+ }
+ }
+ }
+}