10 Nov
2010
10 Nov
'10
9:37 p.m.
On Wed, 2010-11-10 at 17:09 -0200, Alex Baule wrote:
Using this mail_get_first_header(mail, "From", &header) , i get the email in this format "Name user@dom" , in dovecot there is a way to get only the user@dom ?
Use lib-mail/message-address.h parser, something like:
struct message_address *addr; addr = message_address_parse(pool_datastack_create(), header, strlen(header), 1, FALSE); if (addr != NULL) printf("%s@%s", addr->mailbox, addr->domain);