On 6/17/20 11:32 AM, tlhackque via Mailman-Users wrote:
>>From /usr/lib/mailman/cron/senddigests, I'm seeing this - which is the
> result of an annoying webbug URL in some (actually important) inbound
> messages.
> 
> I guess one approach would be for the filename name to be simply the
> sha-xxx of the generated name...not being a Python person, what's the
> best way to solve this?
> 
> 
> Traceback (most recent call last):
...
> IOError: [Errno 36] File name too long: 
> '/var/lib/mailman/archives/private/sb-notices/attachments/20200617/7bfd746c/openupnuTyAIB5RnlGqcUYpxASzOCjK0U2XEEfdN09lb80k8EAccOT3iskue1a45bqJenPWT4XeDAj9c-2FnJ-2F1UfxwtikwjXfVn4FKSvPvMQ4-2F-2BnoeZraMSMf1dLwio-2FiUT1wYNZx4eF1A5j8DF1-2FMAhxu72-2BX1pzdJx1CWDywpoyPVWKwluqE4AyFhrreaxc8kYpHZaUFUlP3MPFmNEDQ5Tr-2Bg-2BJRAhSYLdif3kj8rKn-2FDEhbw-3D.gif'


The easiest thing is to set

SCRUBBER_DONT_USE_ATTACHMENT_FILENAME = Yes

in mm_cfg.py, but this is the default, so you must be overriding it, and
if that's for good reason, you could apply the attached patch after
changing 'MAX' to an integer equal to about 10 less than the longest
filename you want to allow. The -10 is to allow for the extension and a
possible '-nnnn' that will be added.

-- 
Mark Sapiro <m...@msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan
=== modified file 'Mailman/Handlers/Scrubber.py'
--- Mailman/Handlers/Scrubber.py        2018-11-10 18:57:54 +0000
+++ Mailman/Handlers/Scrubber.py        2020-06-18 16:15:39 +0000
@@ -471,7 +471,7 @@
             # guessed so attachments can't lie about their type.  Also, if the
             # filename /has/ no extension, then tack on the one we guessed.
             # The extension was removed from the name above.
-            filebase = filename
+            filebase = filename[:MAX]
         # Now we're looking for a unique name for this file on the file
         # system.  If msgdir/filebase.ext isn't unique, we'll add a counter
         # after filebase, e.g. msgdir/filebase-cnt.ext

------------------------------------------------------
Mailman-Users mailing list -- mailman-users@python.org
To unsubscribe send an email to mailman-users-le...@python.org
https://mail.python.org/mailman3/lists/mailman-users.python.org/
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: https://www.mail-archive.com/mailman-users@python.org/
    https://mail.python.org/archives/list/mailman-users@python.org/

Reply via email to