}
/* this should be rfc822_cpy_adrlist */
-ADDRESS *rfc822_cpy_adr (ADDRESS *addr)
+ADDRESS *rfc822_cpy_adr (ADDRESS *addr, int prune)
{
ADDRESS *top = NULL, *last = NULL;
for (; addr; addr = addr->next)
{
+ if (prune && addr->group && (!addr->next || !addr->next->mailbox))
+ {
+ addr = addr->next;
+ continue;
+ }
if (last)
{
last->next = rfc822_cpy_adr_real (addr);
}
/* append list 'b' to list 'a' and return the last element in the new list */
-ADDRESS *rfc822_append (ADDRESS **a, ADDRESS *b)
+ADDRESS *rfc822_append (ADDRESS **a, ADDRESS *b, int prune)
{
ADDRESS *tmp = *a;
if (!b)
return tmp;
if (tmp)
- tmp->next = rfc822_cpy_adr (b);
+ tmp->next = rfc822_cpy_adr (b, prune);
else
- tmp = *a = rfc822_cpy_adr (b);
+ tmp = *a = rfc822_cpy_adr (b, prune);
while (tmp && tmp->next)
tmp = tmp->next;
return tmp;
* domain-literal = "[" *(dtext / quoted-pair) "]"
*/
- char* dom;
unsigned int l, i;
if (!msgid || !*msgid)
return -1;
if (msgid[0] != '<' || msgid[l-1] != '>')
return -1;
- if (!(dom = strrchr (msgid, '@')))
+ if (!(strrchr (msgid, '@')))
return -1;
/* TODO: complete parser */