From: Ammar Faizi <[email protected]>
To: "Turing - U.S. Software Jobs" <[email protected]>, [email protected]
Subject: Re: Ammar, we have awesome remote U.S. software engineering job opportunities waiting for engineers like you!
Date: Thu, 6 Jul 2023 15:05:18 +0700 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <DUBHVSwDT5iLD0p2u_kBhw@geopod-ismtpd-5>
It's like 7th times I've asked Turing to stop sending spam to
our mailing list. I've even blocked the turing.com domain, but
now it comes with a new domain to bypass my blocking.
Let's see if the following patch is capable of blocking all their
spam robots.
diff --git a/bin/public-inbox-tg.php b/bin/public-inbox-tg.php
index 2e611ec..08753cb 100644
--- a/bin/public-inbox-tg.php
+++ b/bin/public-inbox-tg.php
@@ -133,6 +133,29 @@ function clean_header_val(string $str): string
function fx(string $input): int
{
+ $hdr = explode("\n\n", $input, 2);
+ $hdr = trim($hdr[0]);
+ if (!preg_match("/(?:^|\\n)from:\s+?(.+?)(?:\\n\S+\:|$)/si", $hdr, $m)) {
+ $err = "Cannot get the \"from\" line";
+ goto out;
+ }
+ $from = clean_header_val($m[1]);
+
+ if (preg_match("/\\@turing\\.[\\w\\d\\.]+$/", $from)) {
+ /**
+ * Drop any email from turing.bla domain
+ * where 'bla' can be anything. Note that
+ * it was not enough to block turing.com
+ * because their spam system has started
+ * expanding to other TLDs (not only .com).
+ */
+
+ // Bounce the email.
+ printf("x: The MDA detected /\\@turing\\.[\\w\\d\\.]+$/ pattern and it's globally recognized as spam. The email cannot be delivered. Thank you!\n");
+
+ exit(1);
+ }
+
$tmpName = "/tmp/".date("Y_m_d_H_i_s_").rand().microtime(true).".txt";
file_put_contents($tmpName, $input);
shell_exec("/usr/local/bin/public-inbox-mda < {$tmpName}");
--
Ammar Faizi
next prev parent reply other threads:[~2023-07-06 8:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-06 5:07 Ammar, we have awesome remote U.S. software engineering job opportunities waiting for engineers like you! Turing - U.S. Software Jobs
2023-07-06 8:05 ` Ammar Faizi [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-05-26 5:06 Turing - U.S. Software Jobs
2023-05-26 5:51 ` Ammar Nofan Faizi
2023-05-11 5:06 Turing - U.S. Software Jobs
2023-05-11 5:11 ` Ammar Faizi
2023-04-24 5:17 Turing - U.S. Software Jobs
2023-04-24 5:20 ` Ammar Faizi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox