Re: ExtractText and zbarimg

[email protected]
Newsgroups gmane.mail.spam.spamassassin.general
Message-ID <[email protected]>
On 7/2/25 3:45 PM, Alex wrote:
> Hi, I'm seeing an increase in the number of QR code spam that isn't being caught. I'm not even sure it's being checked using zbarimg. Here's what I have in ExtractText.cf:
> 
> extracttext_external    zbar            /usr/bin/zbarimg -D {}
> extracttext_use         zbar            .jpg .png .pdf .webp image/(?:jpeg|png) application/pdf
> add_header              all             ExtractText-Uris _EXTRACTTEXTURIS_
> 
adding .pdf to "extracttext_use" should be enough in this case

> Here's an example of the encoded PDF in an email that appears not to have been scanned. Should I add "application/octet-stream" to the extracttext_use line in addition to the others?
> 
> --===============5303414978067341145==
> 
> Content-Type: application/octet-stream
> MIME-Version: 1.0
> Content-Transfer-Encoding: base64
> Content-Disposition: attachment;
>   filename="Telecommuting_Policy_2025-07-01.pdf"
> 
> JVBERi0xLjQKMSAwIG9iago8PAovVGl0bGUgKP7/AFIAZQBtAG8AdABlACAAVwBvAHIAawAgAFAA
> bwBsAGkAYwB5ACAAfAAgAEkAbgB0AGUAcgBuAGEAbAAgAEgAUgAgAFAAbwByAHQAYQBsKQovQ3Jl
> YXRvciAo/v8AdwBrAGgAdABtAGwAdABvAHAAZABmACAAMAAuADEAMgAuADYpCi9Qcm9kdWNlciAo
> 
> When I run zbarimg on the saved PDF directly, it does reveal the QR-code link within the PDF.
> 
> Also, it's very slow because it has to spawn the binary with every request. Is there a way to load it into memory or use a library version to avoid having to do this every time? Sometimes salespeople send emails to 50+ people at a time with a legitimate PDF, but it has to spawn zbarimg for each of them, nevertheless, so it could eventually be a denial-of-service.
> 

maybe it could be possible to add a cache layer to extracttext plugin, could you open an enhancement request on https://bz.apache.org/SpamAssassin/ please ?
  Thanks
   Giovanni
OpenPGP_signature.asc (application/pgp-signature, 840 B)
-----BEGIN PGP SIGNATURE-----

wsF5BAABCAAjFiEEqg3TnG6R3qYMxl94+r7qCYlyWOUFAmhmoQgFAwAAAAAACgkQ+r7qCYlyWOU+
Nw/+LnJ/kXk3R5RRSoaDoCU2LTMcsq1OPuSaWNhNjQvcVxG3lnDOEY9b8KWkU4+XvBINK3Ycx1CK
h6//H9UCUPVK1zcLPwMPyNhMttxXsrcV6frSfp65rNNhl9M8wor3M2NXF26CfhTmq0xMw9/lpGgj
8jwp/uRb3+GJHNS7sy8w5RFDPAAx3mwaMveFJFpq2jqNmND7tGD6AefQmti9fni+NI55BG2KKFMx
KZa1KdnAJTtI01QdXeR9w0WndazTRjuV+6s1EX9myAfK4kIjkvnlQaQP/Jn5x4eJAjAhFmMOjEfn
6o0SiqgLjwManyI7RyTSviPjWCnEanAaBjF1LPKXEZLjaW6lpUp43RWjj8yYgheAupu5Bx/lIZ7k
16rc01PnwMA//fG8JG2fkDWRlX+4g0KK474fxFa4c+ZJ6qG8nKmTFh+cWzsxXwp5i/9BUzwYZ5Z5
S2WNiXutpWVB5GvUbhAclfC7qhNf7x9b09Yv5OpNIDmeGOL4p7Gp/e0d8o0mOO9Od4daFyXv9OeG
XKATclJbtGbvw2YWAecovkga9K14VpEP4K0lrcZ75YJ3IP1hjFlh9QeffGqK2U9veNsa63x213p7
k8BZAjHNBQKAA61jYFIOJEnm/oAjo+4lTYVo6p6zYfnpr2JzHyx3Larf/IrorwUQkbZbhVAy/S+T
ofE=
=YPDr
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.