[Mailman-Users] Br0ken Mailman - Ubuntu 18.04.1 LTS

2019-01-29 Thread Odhiambo Washington
I got an error this morning about some strange permission while run the
cron.

Cron  [ -x /usr/local/mailman/cron/senddigests ] &&
/usr/local/mailman/cron/senddigests:

Traceback (most recent call last):
  File "/usr/local/mailman/cron/senddigests", line 120, in 
main()
  File "/usr/local/mailman/cron/senddigests", line 98, in main
mlist = MailList.MailList(listname, lock=0)
  File "/usr/local/mailman/Mailman/MailList.py", line 133, in __init__
self.Load()
  File "/usr/local/mailman/Mailman/MailList.py", line 693, in Load
dict, e = self.__load(file)
  File "/usr/local/mailman/Mailman/MailList.py", line 656, in __load
fp = open(dbfile)
IOError: [Errno 13] Permission denied:
'/usr/local/mailman/lists/skunkworks/config.pck'

So I fumbled around trying to figure it out without success!
bin/check_perms -f did not help either.

And now I tried to manually recompile and build mailman and ended up with
even more problems:

root@lists:/home/wash/Mailman/2.1.29/mailman-2.1.29# ./configure
--with-cgi-gid=33 --with-mail-gid=117
checking for --with-python... no
checking for python... /usr/bin/python
checking Python interpreter... /usr/bin/python
checking Python version... 2.7.15rc1
checking dnspython... Traceback (most recent call last):
  File "conftest.py", line 2, in 
import dns.resolver
  File "build/bdist.linux-x86_64/egg/dns/resolver.py", line 33, in 
  File "build/bdist.linux-x86_64/egg/dns/message.py", line 36, in 
  File "build/bdist.linux-x86_64/egg/dns/rrset.py", line 24, in 
  File "build/bdist.linux-x86_64/egg/dns/renderer.py", line 26, in 
  File "build/bdist.linux-x86_64/egg/dns/tsig.py", line 64, in 
  File "build/bdist.linux-x86_64/egg/dns/name.py", line 912, in from_text
struct.error: cannot convert argument to integer
cat: conftest.out: No such file or directory

...
...

make install
..
..

Compiling /usr/local/mailman/Mailman/Queue/ArchRunner.py ...
Compiling /usr/local/mailman/Mailman/Queue/BounceRunner.py ...
Compiling /usr/local/mailman/Mailman/Queue/CommandRunner.py ...
Compiling /usr/local/mailman/Mailman/Queue/IncomingRunner.py ...
Compiling /usr/local/mailman/Mailman/Queue/MaildirRunner.py ...
Compiling /usr/local/mailman/Mailman/Queue/NewsRunner.py ...
Compiling /usr/local/mailman/Mailman/Queue/OutgoingRunner.py ...
Compiling /usr/local/mailman/Mailman/Queue/RetryRunner.py ...
Compiling /usr/local/mailman/Mailman/Queue/Runner.py ...
Compiling /usr/local/mailman/Mailman/Queue/Switchboard.py ...
Compiling /usr/local/mailman/Mailman/Queue/VirginRunner.py ...
Compiling /usr/local/mailman/Mailman/Queue/__init__.py ...
Compiling /usr/local/mailman/Mailman/Queue/sbcache.py ...
Compiling /usr/local/mailman/Mailman/SafeDict.py ...
Compiling /usr/local/mailman/Mailman/SecurityManager.py ...
Compiling /usr/local/mailman/Mailman/Site.py ...
Compiling /usr/local/mailman/Mailman/TopicMgr.py ...
Compiling /usr/local/mailman/Mailman/UserDesc.py ...
Compiling /usr/local/mailman/Mailman/Utils.py ...
Compiling /usr/local/mailman/Mailman/Version.py ...
Compiling /usr/local/mailman/Mailman/__init__.py ...
Compiling /usr/local/mailman/Mailman/htmlformat.py ...
Compiling /usr/local/mailman/Mailman/i18n.py ...
Compiling /usr/local/mailman/Mailman/versions.py ...
Traceback (most recent call last):
  File "bin/update", line 50, in 
from Mailman import Utils
  File "/usr/local/mailman/Mailman/Utils.py", line 76, in 
import dns.resolver
  File "build/bdist.linux-x86_64/egg/dns/resolver.py", line 33, in 
  File "build/bdist.linux-x86_64/egg/dns/message.py", line 36, in 
  File "build/bdist.linux-x86_64/egg/dns/rrset.py", line 24, in 
  File "build/bdist.linux-x86_64/egg/dns/renderer.py", line 26, in 
  File "build/bdist.linux-x86_64/egg/dns/tsig.py", line 64, in 
  File "build/bdist.linux-x86_64/egg/dns/name.py", line 912, in from_text
struct.error: cannot convert argument to integer
Makefile:133: recipe for target 'update' failed
make: *** [update] Error 1

And of now I am just flummoxed :)

What is it about this dns,resolver??



-- 
Best regards,
Odhiambo WASHINGTON,
Nairobi,KE
+254 7 3200 0004/+254 7 2274 3223
"Oh, the cruft.", grep ^[^#] :-)
--
Mailman-Users mailing list Mailman-Users@python.org
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org


Re: [Mailman-Users] Br0ken Mailman - Ubuntu 18.04.1 LTS - SOLVED

2019-01-29 Thread Odhiambo Washington
I somehow managed to solve this:
apt install python-pip
/usr/bin/pip uninstall dnspython
/usr/bin/pip install dnspython

Ubuntu seems to have moved python2.7 to /usr/bin while making python3.7
resident in /usr/local/bin


On Tue, 29 Jan 2019 at 14:34, Odhiambo Washington 
wrote:

> I got an error this morning about some strange permission while run the
> cron.
>
> Cron  [ -x /usr/local/mailman/cron/senddigests ] &&
> /usr/local/mailman/cron/senddigests:
>
> Traceback (most recent call last):
>   File "/usr/local/mailman/cron/senddigests", line 120, in 
> main()
>   File "/usr/local/mailman/cron/senddigests", line 98, in main
> mlist = MailList.MailList(listname, lock=0)
>   File "/usr/local/mailman/Mailman/MailList.py", line 133, in __init__
> self.Load()
>   File "/usr/local/mailman/Mailman/MailList.py", line 693, in Load
> dict, e = self.__load(file)
>   File "/usr/local/mailman/Mailman/MailList.py", line 656, in __load
> fp = open(dbfile)
> IOError: [Errno 13] Permission denied:
> '/usr/local/mailman/lists/skunkworks/config.pck'
>
> So I fumbled around trying to figure it out without success!
> bin/check_perms -f did not help either.
>
> And now I tried to manually recompile and build mailman and ended up with
> even more problems:
>
> root@lists:/home/wash/Mailman/2.1.29/mailman-2.1.29# ./configure
> --with-cgi-gid=33 --with-mail-gid=117
> checking for --with-python... no
> checking for python... /usr/bin/python
> checking Python interpreter... /usr/bin/python
> checking Python version... 2.7.15rc1
> checking dnspython... Traceback (most recent call last):
>   File "conftest.py", line 2, in 
> import dns.resolver
>   File "build/bdist.linux-x86_64/egg/dns/resolver.py", line 33, in 
>   File "build/bdist.linux-x86_64/egg/dns/message.py", line 36, in 
>   File "build/bdist.linux-x86_64/egg/dns/rrset.py", line 24, in 
>   File "build/bdist.linux-x86_64/egg/dns/renderer.py", line 26, in 
>   File "build/bdist.linux-x86_64/egg/dns/tsig.py", line 64, in 
>   File "build/bdist.linux-x86_64/egg/dns/name.py", line 912, in from_text
> struct.error: cannot convert argument to integer
> cat: conftest.out: No such file or directory
>
> ...
> ...
>
> make install
> ..
> ..
>
> Compiling /usr/local/mailman/Mailman/Queue/ArchRunner.py ...
> Compiling /usr/local/mailman/Mailman/Queue/BounceRunner.py ...
> Compiling /usr/local/mailman/Mailman/Queue/CommandRunner.py ...
> Compiling /usr/local/mailman/Mailman/Queue/IncomingRunner.py ...
> Compiling /usr/local/mailman/Mailman/Queue/MaildirRunner.py ...
> Compiling /usr/local/mailman/Mailman/Queue/NewsRunner.py ...
> Compiling /usr/local/mailman/Mailman/Queue/OutgoingRunner.py ...
> Compiling /usr/local/mailman/Mailman/Queue/RetryRunner.py ...
> Compiling /usr/local/mailman/Mailman/Queue/Runner.py ...
> Compiling /usr/local/mailman/Mailman/Queue/Switchboard.py ...
> Compiling /usr/local/mailman/Mailman/Queue/VirginRunner.py ...
> Compiling /usr/local/mailman/Mailman/Queue/__init__.py ...
> Compiling /usr/local/mailman/Mailman/Queue/sbcache.py ...
> Compiling /usr/local/mailman/Mailman/SafeDict.py ...
> Compiling /usr/local/mailman/Mailman/SecurityManager.py ...
> Compiling /usr/local/mailman/Mailman/Site.py ...
> Compiling /usr/local/mailman/Mailman/TopicMgr.py ...
> Compiling /usr/local/mailman/Mailman/UserDesc.py ...
> Compiling /usr/local/mailman/Mailman/Utils.py ...
> Compiling /usr/local/mailman/Mailman/Version.py ...
> Compiling /usr/local/mailman/Mailman/__init__.py ...
> Compiling /usr/local/mailman/Mailman/htmlformat.py ...
> Compiling /usr/local/mailman/Mailman/i18n.py ...
> Compiling /usr/local/mailman/Mailman/versions.py ...
> Traceback (most recent call last):
>   File "bin/update", line 50, in 
> from Mailman import Utils
>   File "/usr/local/mailman/Mailman/Utils.py", line 76, in 
> import dns.resolver
>   File "build/bdist.linux-x86_64/egg/dns/resolver.py", line 33, in 
>   File "build/bdist.linux-x86_64/egg/dns/message.py", line 36, in 
>   File "build/bdist.linux-x86_64/egg/dns/rrset.py", line 24, in 
>   File "build/bdist.linux-x86_64/egg/dns/renderer.py", line 26, in 
>   File "build/bdist.linux-x86_64/egg/dns/tsig.py", line 64, in 
>   File "build/bdist.linux-x86_64/egg/dns/name.py", line 912, in from_text
> struct.error: cannot convert argument to integer
> Makefile:133: recipe for target 'update' failed
> make: *** [update] Error 1
>
> And of now I am just flummoxed :)
>
> What is it about this dns,resolver??
>
>
>
> --
> Best regards,
> Odhiambo WASHINGTON,
> Nairobi,KE
> +254 7 3200 0004/+254 7 2274 3223
> "Oh, the cruft.", grep ^[^#] :-)
>


-- 
Best regards,
Odhiambo WASHINGTON,
Nairobi,KE
+254 7 3200 0004/+254 7 2274 3223
"Oh, the cruft.", grep ^[^#] :-)
--
Mailman-Users mailing list Mailman-Users@python.org
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
S

Re: [Mailman-Users] Manually treat certain domains as if they have restrictive DMARC policy

2019-01-29 Thread David Gibbs via Mailman-Users

On 1/29/2019 12:13 AM, Mark Sapiro wrote:

Also, Adding a global setting for dmarc_moderation_addresses on top of
the per-list setting is not difficult either. See

for how this was done for a global ban_list.


I'm by no means a Python expert (far from it), but I hacked this together...

=== modified file 'Mailman/Defaults.py.in'
--- Mailman/Defaults.py.in  2018-07-12 03:14:02 +
+++ Mailman/Defaults.py.in  2019-01-29 14:27:59 +
@@ -145,6 +145,11 @@
 # GLOBAL_BAN_LIST = ['xxx@aol\.com', '^yyy.*@gmail\.com$']
 GLOBAL_BAN_LIST = []

+# Installation wide DMARC list.  This is a list of email addresses and
+# regexp patterns (beginning with ^) that will be treated as if they
+# have a restrictive DMARC policy. Same examples as GLOBAL_BAN_LIST
+GLOBAL_DMARC_LIST = []
+
 # If the following is set to Yes, and a web subscribe comes from an IPv4
 # address and the IP is listed in Spamhaus SBL, CSS or XBL, the subscription
 # will be blocked.  It will work with IPv6 addresses if Python's py2-ipaddress

=== modified file 'Mailman/Handlers/SpamDetect.py'
--- Mailman/Handlers/SpamDetect.py  2018-12-01 04:13:12 +
+++ Mailman/Handlers/SpamDetect.py  2019-01-29 14:24:26 +
@@ -110,6 +110,7 @@
 dn, addr = parseaddr(msg.get('from'))
 if addr and mlist.dmarc_moderation_action > 0:
 if (mlist.GetPattern(addr, mlist.dmarc_moderation_addresses) or
+mlist.getPattern(addr, mm_cfg.GLOBAL_DMARC_LIST) or
 Utils.IsDMARCProhibited(mlist, addr)):
 # Note that for dmarc_moderation_action, 0 = Accept,
 #1 = Munge, 2 = Wrap, 3 = Reject, 4 = Discard





--
IBM i on Power Systems: For when you can't afford to be out of business!

I'm riding 615 miles (Yes, you read that right) in the American Diabetes 
Association's Tour de Cure to raise money for diabetes research, education, 
advocacy, and awareness.  You can make a tax-deductible donation to my ride by 
visiting https://gmane.diabetessucks.net.

You can see where my donations come from by visiting my interactive donation 
map ... https://gmane.diabetessucks.net/map (it's a geeky thing).

I may have diabetes, but diabetes doesn't have me!

--
Mailman-Users mailing list Mailman-Users@python.org
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org


Re: [Mailman-Users] Manually treat certain domains as if they have restrictive DMARC policy

2019-01-29 Thread Mark Sapiro
On 1/29/19 6:55 AM, David Gibbs via Mailman-Users wrote:
> 
> I'm by no means a Python expert (far from it), but I hacked this
> together...
> 
> === modified file 'Mailman/Defaults.py.in'
> --- Mailman/Defaults.py.in  2018-07-12 03:14:02 +
> +++ Mailman/Defaults.py.in  2019-01-29 14:27:59 +
> @@ -145,6 +145,11 @@
>  # GLOBAL_BAN_LIST = ['xxx@aol\.com', '^yyy.*@gmail\.com$']
>  GLOBAL_BAN_LIST = []
> 
> +# Installation wide DMARC list.  This is a list of email addresses and
> +# regexp patterns (beginning with ^) that will be treated as if they
> +# have a restrictive DMARC policy. Same examples as GLOBAL_BAN_LIST
> +GLOBAL_DMARC_LIST = []
> +
>  # If the following is set to Yes, and a web subscribe comes from an IPv4
>  # address and the IP is listed in Spamhaus SBL, CSS or XBL, the subscription
>  # will be blocked.  It will work with IPv6 addresses if Python's 
> py2-ipaddress


The above is good, but you will have to run 'configure' with appropriate
options to propagate that to Defaults.py and then add your actual list
by setting GLOBAL_DMARC_LIST in mm_cfg.py.


> === modified file 'Mailman/Handlers/SpamDetect.py'
> --- Mailman/Handlers/SpamDetect.py  2018-12-01 04:13:12 +
> +++ Mailman/Handlers/SpamDetect.py  2019-01-29 14:24:26 +
> @@ -110,6 +110,7 @@
>  dn, addr = parseaddr(msg.get('from'))
>  if addr and mlist.dmarc_moderation_action > 0:
>  if (mlist.GetPattern(addr, mlist.dmarc_moderation_addresses) or
> +    mlist.getPattern(addr, mm_cfg.GLOBAL_DMARC_LIST) or

GetPattern, not getPattern. Otherwise good.

>  Utils.IsDMARCProhibited(mlist, addr)):
>  # Note that for dmarc_moderation_action, 0 = Accept,
>  #    1 = Munge, 2 = Wrap, 3 = Reject, 4 = Discard
> 


-- 
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
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org


Re: [Mailman-Users] Br0ken Mailman - Ubuntu 18.04.1 LTS

2019-01-29 Thread Mark Sapiro
On 1/29/19 3:34 AM, Odhiambo Washington wrote:
> I got an error this morning about some strange permission while run the
> cron.
> 
> Cron  [ -x /usr/local/mailman/cron/senddigests ] &&
> /usr/local/mailman/cron/senddigests:
> 
> Traceback (most recent call last):
>   File "/usr/local/mailman/cron/senddigests", line 120, in 
> main()
>   File "/usr/local/mailman/cron/senddigests", line 98, in main
> mlist = MailList.MailList(listname, lock=0)
>   File "/usr/local/mailman/Mailman/MailList.py", line 133, in __init__
> self.Load()
>   File "/usr/local/mailman/Mailman/MailList.py", line 693, in Load
> dict, e = self.__load(file)
>   File "/usr/local/mailman/Mailman/MailList.py", line 656, in __load
> fp = open(dbfile)
> IOError: [Errno 13] Permission denied:
> '/usr/local/mailman/lists/skunkworks/config.pck'
> 
> So I fumbled around trying to figure it out without success!
> bin/check_perms -f did not help either.


Was this a new list or one that was present during a prior successful
cron/senddigests run?

Could you access the list via the web UI?

What user runs the cron, i.e. the owner of the crontab or the listed
user is a system crontab, and can that user access the config.pck file?
Can that user successfully run cron/senddigests manually?

If the above doesn't give clues, maybe apparmor is involved.

Maybe it was a transient glitch.

In any case, I wouldn't expect re-installing Mailman to correct a
permissions problem if check_perms didn't find anything.

-- 
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
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org


Re: [Mailman-Users] Br0ken Mailman - Ubuntu 18.04.1 LTS

2019-01-29 Thread Odhiambo Washington
On Wed, 30 Jan 2019 at 02:21, Mark Sapiro  wrote:

> On 1/29/19 3:34 AM, Odhiambo Washington wrote:
> > I got an error this morning about some strange permission while run the
> > cron.
> >
> > Cron  [ -x /usr/local/mailman/cron/senddigests ] &&
> > /usr/local/mailman/cron/senddigests:
> >
> > Traceback (most recent call last):
> >   File "/usr/local/mailman/cron/senddigests", line 120, in 
> > main()
> >   File "/usr/local/mailman/cron/senddigests", line 98, in main
> > mlist = MailList.MailList(listname, lock=0)
> >   File "/usr/local/mailman/Mailman/MailList.py", line 133, in __init__
> > self.Load()
> >   File "/usr/local/mailman/Mailman/MailList.py", line 693, in Load
> > dict, e = self.__load(file)
> >   File "/usr/local/mailman/Mailman/MailList.py", line 656, in __load
> > fp = open(dbfile)
> > IOError: [Errno 13] Permission denied:
> > '/usr/local/mailman/lists/skunkworks/config.pck'
> >
> > So I fumbled around trying to figure it out without success!
> > bin/check_perms -f did not help either.
>
>
> Was this a new list or one that was present during a prior successful
> cron/senddigests run?
>

It's an existing list.


>
> Could you access the list via the web UI?
>

After fixing the issues I had with dns.resolver, the list is alive and I
can do everything
via the web UI.
However, the cron errors still persist.


> What user runs the cron, i.e. the owner of the crontab or the listed
> user is a system crontab, and can that user access the config.pck file?
> Can that user successfully run cron/senddigests manually?
>

The contrab file is in /etc/cron.d/ and is owned by root:root like all the
files I see in there.




> If the above doesn't give clues, maybe apparmor is involved.
>

I need to figure out what apparmor is. Heading to Google :)

>
> Maybe it was a transient glitch.
>

It is not, because this morning I have seen permission problems with other
aspects of the cron.


> In any case, I wouldn't expect re-installing Mailman to correct a
> permissions problem if check_perms didn't find anything.
>

That is the strange part - check_perms -f isn't fixing it.

root@lists:/etc/cron.d#  /usr/local/mailman/bin/check_perms
No problems found

-- 
Best regards,
Odhiambo WASHINGTON,
Nairobi,KE
+254 7 3200 0004/+254 7 2274 3223
"Oh, the cruft.", grep ^[^#] :-)
--
Mailman-Users mailing list Mailman-Users@python.org
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org