How can I test a procmail rule without sending myself an email?
8
votes
2
answers
2679
views
I am getting a lot of spam messages from a certain country. They all have the same pattern in the source. I want to write a procmail rule to automatically move all those emails to my Spam folder.
The source of a spam email might look like this ("[REDACTED]" added by me to protect my privacy):
Return-Path:
X-Original-To: [REDACTED]
Delivered-To: [REDACTED]
Received: from [REDACTED] ([REDACTED] [REDACTED])
by [REDACTED] (Postfix) with ESMTPS id 2AC8E731E799DC
for ; Sat, 9 Jul 2022 20:16:41 +0000 (UTC)
Received: from [REDACTED].org ([REDACTED].ru [REDACTED])
by [REDACTED] (Postfix) with ESMTP id 6F1865ECD8
for ; Sat, 9 Jul 2022 20:16:40 +0000 (UTC)
[...]
What I want to do is look at the "Received" headers and throw everything that comes from .ru TLD into Spam.
My attempt is this:
:0 H
* ^Received:*\.ru
.Spam/
However, I'm new to writing procmail rules. How can I go about testing my new rule so I know it's correct?
Asked by RommelTJ
(183 rep)
Jul 10, 2022, 08:39 PM
Last activity: Jul 12, 2022, 05:35 AM
Last activity: Jul 12, 2022, 05:35 AM