Re: filter based on "From: " content

To catch mail to self could be an overkill as someone could copy mail to self (multiple addresses in "To:") when people tend not to manage "Sent" box these days. I was thinking a recipe to parse out the 2 parts in "From:" line: "joe@mysite.org" <extusr@water.ne.jp> which obviously is not legitimate. That's why I mentioned using 'formail'.. Zhiliang On Tue, 17 Nov 2020, Vlado Keselj wrote:
Date: Tue, 17 Nov 2020 08:36:08 -0400 (AST) From: Vlado Keselj <vlado@dnlp.ca> To: Zhiliang Hu <hu@animalgenome.org> Cc: procmail@lists.rwth-aachen.de Subject: Re: filter based on "From: " content
Are you saying that something like
:0 * ^From:.*joe@mysite.org * ^To:.*joe@mysite.org spam
would not work?
On Mon, 16 Nov 2020, Zhiliang Hu wrote:
Recently I get lots spam mails typically with faked "From:" and "To:" like
From: "joe@mysite.org" <extusr@water.ne.jp> To: joe@mysite.org
where "joe@mysite.org" is our local user. My problem with procmailrc approach is that 'formail' extraction will largely leave out the "joe@mysite.org" part in the "From:" line. Before I may attempt an external script to do the catch, I wonder is there already, or possibly some simple filter to catch these within procmailrc?
Zhiliang ____________________________________________________________ procmail mailing list -- procmail@lists.rwth-aachen.de Procmail homepage: http://www.procmail.org/ To unsubscribe send an email to procmail-leave@lists.rwth-aachen.de https://lists.rwth-aachen.de/postorius/lists/procmail.lists.rwth-aachen.de

On 2020-11-18 00:33, Zhiliang Hu wrote:
To catch mail to self could be an overkill as someone could copy mail to self (multiple addresses in "To:") when people tend not to manage "Sent" box these days.
I was thinking a recipe to parse out the 2 parts in "From:" line: "joe@mysite.org" <extusr@water.ne.jp> which obviously is not legitimate. That's why I mentioned using 'formail'..
See (for example) H_vars.inc in https://rvtol.home.xs4all.nl/procmail/basic/pm/ on how to match and capture parts of the message into variables. In there, $H_From_ and $H_From are separate captures: the envelope-from and the header-from. In https://rvtol.home.xs4all.nl/procmail/basic/ there is a gl_demo.rc that shows some usage. -- Ruud
participants (2)
-
Ruud H.G. van Tol
-
Zhiliang Hu