[Dovecot] Getting the Sender from a Email
10 Nov
2010
10 Nov
'10
9:09 p.m.
Hi Timo....
I need to get the Sender from a Email.
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 ?
Tks !
10 Nov
10 Nov
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);
5119
Age (days ago)
5119
Last active (days ago)
1 comments
2 participants
participants (2)
-
Alex Baule
-
Timo Sirainen