+
+/*
+ * Insert mailname after element and returns the
+ * number of parsed addresses. element is set to
+ * the last parsed addresse.
+ */
+size_t
+getmboxes(char *line, struct mailname **element)
+{
+ struct mailname *mp, *next;
+ char *cp;
+ size_t i = 0;
+
+ next = (*element)->m_next;
+
+ while ((cp = getname(line))) {
+ mp = getm(cp, NULL, 0, AD_HOST, NULL);
+ (*element)->m_next = mp;
+ *element = mp;
+ i++;
+ }
+
+ (*element)->m_next = next;
+ return i;
+}