Matching Addresses in Sieve

Doug Hardie bc979 at lafn.org
Fri Sep 30 21:14:23 UTC 2022


I have an email with the following header line:

From: 'Thank you!Kohls' <Kohls-MNc at FeedbackKohlsOpinionRequestedlxecrftHO.com>

I am trying to match that with:
if address :contains "from" "Thank you!Kohls"
{
        addflag "\\Seen";
        fileinto "Junk";
        stop;
}

However, the matching portion of the from address is only the section between < and >.  Since there are changing sections that are different for each email, I can't use that.  I wanted to match the stuff before <.  I have tried numerous formats for the if statement but none of them have worked.  What is the proper way to make that match work?  Thanks,

-- Doug



More information about the dovecot mailing list