+/* 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;
+}
+