[Mailman-Users] Re: Pipermail scrubbing ascii txt to ksh attachment

2021-03-06 Thread Mark Dale via Mailman-Users



 Original Message 
From: Mark Sapiro [mailto:m...@msapiro.net]
Sent: Saturday, March 6, 2021, 23:27 UTC
To: mailman-users@python.org
Subject: [Mailman-Users] Re: Pipermail scrubbing ascii txt to ksh attachment

> On 3/6/21 2:55 PM, Mark Dale via Mailman-Users wrote:
>>
>> If it turns out that the the owner is unable to modify their Perl script, 
>> setting this shell script to run once a day may not be a problem as their 
>> list is auto-posted to at a scheduled time every day. It's a kludge of a 
>> "fix" I know, but it will limp it home.

> 
> The patch I posted previously was bad. This one is correct. If you patch
> Scrubber.py with this patch, you won't need to edit the mbox and rebuild
> the archive as that message won't get scrubbed.
> 

A -- when I looked (blindly) at the script earlier I was thinking that it 
would only write the attachment as a .txt rather than .ksh file. 

I've added your most recent patch. Now standing by to watch the next post get 
archived in glorious plain text.

Thank you once again Mark. 




--
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/


[Mailman-Users] Re: Pipermail scrubbing ascii txt to ksh attachment

2021-03-06 Thread Mark Sapiro
On 3/6/21 2:55 PM, Mark Dale via Mailman-Users wrote:
> 
> If it turns out that the the owner is unable to modify their Perl script, 
> setting this shell script to run once a day may not be a problem as their 
> list is auto-posted to at a scheduled time every day. It's a kludge of a 
> "fix" I know, but it will limp it home.


The patch I posted previously was bad. This one is correct. If you patch
Scrubber.py with this patch, you won't need to edit the mbox and rebuild
the archive as that message won't get scrubbed.

-- 
Mark Sapiro The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan
=== modified file 'Mailman/Handlers/Scrubber.py'
--- Mailman/Handlers/Scrubber.py2020-06-21 18:45:30 +
+++ Mailman/Handlers/Scrubber.py2021-03-06 19:10:28 +
@@ -90,6 +90,9 @@
 if ctype.lower == 'application/octet-stream':
 # For this type, all[0] is '.obj'. '.bin' is better.
 return '.bin'
+if ctype.lower == 'text/plain':
+# For this type, all[0] is '.ksh'. '.txt' is better.
+return '.txt'
 return all and all[0]
 
 
@@ -196,8 +199,11 @@
 format = part.get_param('format')
 delsp = part.get_param('delsp')
 # TK: if part is attached then check charset and scrub if none
-if part.get('content-disposition') and \
-   not part.get_content_charset():
+# MAS: Content-Disposition is not a good test for 'attached'.
+# RFC 2183 sec. 2.10 allows Content-Disposition on the main body.
+# Make it specifically 'attachment'.
+if (part.get('content-disposition', '').lower() == 'attachment'
+and not part.get_content_charset()):
 omask = os.umask(002)
 try:
 url = save_attachment(mlist, part, dir)

--
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/


[Mailman-Users] Re: Pipermail scrubbing ascii txt to ksh attachment

2021-03-06 Thread Mark Dale via Mailman-Users



 Original Message 
From: Mark Sapiro [mailto:m...@msapiro.net]
Sent: Saturday, March 6, 2021, 01:19 UTC
To: mailman-users@python.org
Subject: [Mailman-Users] Re: Pipermail scrubbing ascii txt to ksh attachment

> On 3/5/21 2:56 PM, Mark Dale via Mailman-Users wrote:
>>
>>
>> I'll pass it on to the list owner to modify their script and see how we
>> get on.


> 
> 
> In case the script doesn't get modified, here's a patch I plan to commit
> to Scrubber.py which should help.
> 
> 
> --


Thanks again Mark. The list owner has indicated they can modify their Perl 
script (not done as yet), so I'll put your patch in place regardless.

I ran a script (below) against the mbox file to remove "Content-Disposition: 
inline" and change "Content-Type: text/plain" to include the charset and that 
has the archived messages now displaying nicely as plain text.

If it turns out that the the owner is unable to modify their Perl script, 
setting this shell script to run once a day may not be a problem as their list 
is auto-posted to at a scheduled time every day. It's a kludge of a "fix" I 
know, but it will limp it home.


#!/bin/bash
PATH=/usr/sbin:/usr/bin:/sbin:/bin
LISTNAME=redacted
echo $LISTNAME archive rebuild started at $(date +%H:%M:%S)
sed -i '/Content-Disposition: inline/d' 
/var/lib/mailman/archives/private/$LISTNAME.mbox/$LISTNAME.mbox
sed -i 's/Content-Type: text\/plain/Content-Type: text\/plain; 
charset="us-ascii"/' 
/var/lib/mailman/archives/private/$LISTNAME.mbox/$LISTNAME.mbox
/usr/lib/mailman/bin/arch --wipe $LISTNAME
echo $LISTNAME archive rebuild completed at $(date +%H:%M:%S)
exit 0
--
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/


[Mailman-Users] Re: SPF trouble

2021-03-06 Thread Mark Sapiro
On 3/5/21 7:46 AM, Markus Grunwald via Mailman-Users wrote:
> Hello,
> 
> I set up an announcement mailing list for my men's choir. It went quite
> smoothly and seems to work fine.
> 
> The server the-grue.de runs a multi domain postfix setup. The main
> domain is the-grue.de, my private domain. I host mails for
> maennerchor-kirchseeon.de, too and that's the domain that mailman should
> use.
> 
> 
> Now I wanted to check if there are any problems regarding spam with
> mx-tools, so I added p...@tools.mxtoolbox.com to the list and sent a
> mail to it using the same E-Mail address that I'm using in this mail.
> You can see the result here:
> 
> https://mxtoolbox.com/deliverability/5215ac61-ae11-46b6-90bf-14d71be76ef5
> 
> Email Deliverability:
> Testing 'the-grue.de' against '95.129.55.232'
> 
> So the domain of my e-mail adress is checked against the ip of the
> mailing list server which fails, of course.


And what it's is testing is not only if SPF passes (which it does), but
also if the domain of the sending server `aligns` with the domain of the
From: address. This is a DMARC check and will fail in this case.


> I have the test mail attached to this mail. There's something else strange:
> 
> X-Original-To: ankuendigun...@maennerchor-kirchseeon.de
> Delivered-To: ankuendigun...@the-grue.de
> 
> Where does the "@the-grue.de" come from?


Postfix delivery.

> This is the generated file /var/lib/mailman/data/virtual-mailman 
...
> # STANZA START: ankuendigungen
> # CREATED: Thu Feb 18 14:28:43 2021
> ankuendigun...@maennerchor-kirchseeon.de ankuendigungen


The above virtual mapping says deliver mail to
ankuendigun...@maennerchor-kirchseeon.de to the local address
ankuendigungen and postfix appends the local domain.

-- 
Mark Sapiro The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan
--
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/


[Mailman-Users] SPF trouble

2021-03-06 Thread Markus Grunwald via Mailman-Users
>From ankuendigungen-boun...@maennerchor-kirchseeon.de  Fri Mar  5 08:48:46 2021
Return-Path: 
X-Original-To: p...@tools.mxtoolbox.com
Delivered-To: to...@tools.mxtoolbox.com
Received: from mail.maennerchor-kirchseeon.de (mail.maennerchor-kirchseeon.de 
[95.129.55.232])
by tools.mxtoolbox.com (Postfix) with ESMTP id 68B92B5F23
for ; Fri,  5 Mar 2021 08:48:46 -0600 (CST)
Received: from www.the-grue.de (localhost [127.0.0.1])
by localhost (Postfix) with ESMTP id A85AB10C070;
Fri,  5 Mar 2021 15:48:45 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=the-grue.de; s=mail;
t=1614955725; bh=hKdcbAJ+YYImO1uwLn7XGnENfBcFle9rBSaWdsGEVPc=;
h=From:To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:
 List-Post:List-Help:List-Subscribe:From;
b=biDT1CDbZ4oYTlRhpw7f9x8KtbHuFqWQOUy8Qf/Fs7jsRWGnzO/on6b8ZqWBxvOLt
 7eDkcFTYq1xufdIKK2iAf6BrQ21CtiBAwpK/bk4ZZCT3TMmR/TIuNNlwveNunSOFj5
 H2YzyHSZRqQfqctt4DjeyEdWQ5LnN0WR6byDfRDeOwVFGEpe8QWQAiOLkOxXwPsCr3
 ptHSVGU9d2lpJDohFXnb0zB9Y3thPE/JC/kpIrknSQeK14fBi9EurrHDYM3lLxtTcS
 PmEE3qeflOQShmtyeId2SvNBeD4FN3hserM7vH2oLUocO/l6bDH/NcQbxjuVoSwmJG
 USnHP7GItxyGg==
X-Original-To: ankuendigun...@maennerchor-kirchseeon.de
Delivered-To: ankuendigun...@the-grue.de
Received: from bob.the-grue.de (ip5f5bfdd9.dynamic.kabel-deutschland.de
 [95.91.253.217])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mail.the-grue.de (Postfix) with ESMTPSA id 79DA010C070
 for ;
 Fri,  5 Mar 2021 15:48:37 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=the-grue.de; s=mail;
 t=1614955717; bh=VLFOKF7uPunFIavYg9cGBAnxnpbUFX2yDVm3d58/NaY=;
 h=From:To:Subject:Date:From;
 b=WulchybaGznPsq/ShaXFOhl6LVFCH3jOfIHrlZ7PYeF0ARmUAFZqT+y5OLY7S8y/1
 0b5fgkKjun5dpG61x0JjP5y4/SBFKH0Czq6+F005akrgd+vNbq7izRPz4kdNB1lhQO
 iYELnX/yybTjMorYFhWroCyiZFXbtVYhacDRBQtTel9/xNp3E9x288JKQ/ZtlOH7NF
 NKP/ktoUaJ4qOqaQLbba+maTzlUzhm151rlkyQsvovvuOEZFm2wBFalN/vOWfYmNjp
 /p1MAioYMVnoUIBaTDpt215oCTxwOXU17zoV/yH+CDzpWMi94+mfuEVj19zykOilnO
 Ep9YqUUo8H6Nw==
User-agent: mu4e 1.4.15; emacs 27.1
From: Markus Grunwald 
To: ankuendigun...@maennerchor-kirchseeon.de
Date: Fri, 05 Mar 2021 15:48:37 +0100
Message-ID: <875z258xmi@bob.galaxy.home>
MIME-Version: 1.0
Subject: =?utf-8?b?W0Fua8O8bmRpZ3VuZ2VuXSA=?= MX Tools Test Mail
X-BeenThere: ankuendigun...@maennerchor-kirchseeon.de
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: =?iso-8859-1?q?Ank=FCndigungen?=
 
List-Unsubscribe: 
,
 
List-Archive: 

List-Post: 
List-Help: 

List-Subscribe: 
,
 
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
Errors-To: ankuendigungen-boun...@maennerchor-kirchseeon.de
Sender: "Ankuendigungen" 

Please test this mail

--
Markus Grunwald
https://www.the-grue.de/~markus/markus_grunwald.gpg
--
Ankuendigungen mailing list
ankuendigun...@maennerchor-kirchseeon.de
https://maennerchor-kirchseeon.de/cgi-bin/mailman/listinfo/ankuendigungen

Hello,

I set up an announcement mailing list for my men's choir. It went 
quite smoothly and seems to work fine.


The server the-grue.de runs a multi domain postfix setup. The main 
domain is the-grue.de, my private domain. I host mails for 
maennerchor-kirchseeon.de, too and that's the domain that mailman 
should use.



Now I wanted to check if there are any problems regarding spam 
with mx-tools, so I added p...@tools.mxtoolbox.com to the list and 
sent a mail to it using the same E-Mail address that I'm using in 
this mail. You can see the result here:


https://mxtoolbox.com/deliverability/5215ac61-ae11-46b6-90bf-14d71be76ef5

Email Deliverability:
Testing 'the-grue.de' against '95.129.55.232'

So the domain of my e-mail adress is checked against the ip of the 
mailing list server which fails, of course.


I have the test mail attached to this mail. There's something else 
strange:


X-Original-To: ankuendigun...@maennerchor-kirchseeon.de
Delivered-To: ankuendigun...@the-grue.de

Where does the "@the-grue.de" come from?

This is the mailman config file:

% grep -e '^[^#]' mm_cfg.py

from Defaults import *
MAILMAN_SITE_LIST = 'mailman'
DEFAULT_URL_PATTERN = 'https://%s/cgi-bin/mailman/'
IMAGE_LOGOS = '/images/mailman/'
DEFAULT_EMAIL_HOST = 'maennerchor-kirchseeon.de'
DEFAULT_URL_HOST   =