[Dovecot] Explain about (mail_get_first_header(mail, "From", &header)

Timo Sirainen tss at iki.fi
Mon Jun 13 16:09:27 EEST 2011


On Fri, 2011-06-10 at 09:19 -0300, Alex Baule wrote:
> Hi Timo...
> 
> Inside my plugin, i use the (mail_get_first_header(mail, "From",
> &header) function, to get the email From to put in some Blacklist.
> 
> Looking in the header under this mail, we have 2 "From" fields.

Do you mean these?

>From dma_3783 at envios.socomdescontos.com.br Tue Jun 07 15:43:04 2011
From: "CompraFacil.com.br" <mkt at socomdescontos.com.br>

> Using the function above, i get the Second "From", but my MTA (exim)
> look in to The First From, in the First Line, in that way, my
> blacklist don't work, because the sender to be blocked is different
> from
> 
> the From looked by dovecot.
> 
> There is a way to get the "From" from First line ?

The first line isn't a From: header. It's the "envelope sender". That
line typically exists only with mbox format, not with other mailbox
formats.. If you deliver a mail via dovecot-lda it removes this From
line if it sees it.

Typically you'd get this info from Return-Path: header.



More information about the dovecot mailing list