[Mailman-Users] postalias error

Todd Freedom_Lover at pobox.com
Wed Mar 17 17:36:25 CET 2004

Hash: SHA1

Shaun T. Erickson wrote:
> I had been using postfix-to-mailman.py, as I initially set up mailman, 
> so I could skip the hassle of dealing with the aliases until I got 
> everything else working (which I did).
> This morning, I ripped that out, and follwed the directions in the 
> README.POSTFIX file, and got my existing two lists working just fine 
> (again).
> Then I went to create a new list, via my browser, and I got this:
> Traceback (most recent call last):
>   File "/usr/local/mailman/scripts/driver", line 87, in run_main
>     main()
>   File "/usr/local/mailman/Mailman/Cgi/create.py", line 55, in main
>     process_request(doc, cgidata)
>   File "/usr/local/mailman/Mailman/Cgi/create.py", line 226, in 
> process_request
>     sys.modules[modname].create(mlist, cgi=1)
>   File "/usr/local/mailman/Mailman/MTA/Postfix.py", line 232, in create
>     _update_maps()
>   File "/usr/local/mailman/Mailman/MTA/Postfix.py", line 53, in 
> _update_maps
>     raise RuntimeError, msg % (acmd, status, errstr)
> RuntimeError: command failed: /usr/local/sbin/postalias 
> /usr/local/mailman/data/aliases (status: 1, Operation not permitted)
> I am able, as root, to run postalias on the aliases file, just fine. The 
> files owner and group are both mailman, as the readme specified.
> -rw-rw----  1 mailman  mailman   2792 Mar 17 10:51 aliases
> -rw-r-----  1 mailman  mailman  49152 Mar 17 10:56 aliases.db

The FAQ is your friend:

    6.9. I get a "RuntimeError: command failed: /usr/sbin/postalias"
    when creating lists and Postfix is my MTA


You want to make aliases.db group writable.

I wish that check_perms would catch this and that README.POSTFIX would
mention the importance of the file being group writable.  It bites
enough people to warrant it I think.

I made a patch against CVS about two months ago to do both of these
things and posted it here, but it didn't get picked up and I don't
think I got around to sending it to the mailman-developers list.  In
case it's helpful, I'll attach it again.

- -- 
Todd        OpenPGP -> KeyID: 0xD654075A | URL: www.pobox.com/~tmz/pgp
Those who dream by day are cognizant of many things that escape those
who dream only at night.
    -- Edgar Allan Poe

Version: GnuPG v1.2.4 (GNU/Linux)
Comment: When crypto is outlawed bayl bhgynjf jvyy unir cevinpl.

-------------- next part --------------
RCS file: /cvsroot/mailman/mailman/README.POSTFIX,v
retrieving revision 2.17
diff -u -r2.17 README.POSTFIX
--- README.POSTFIX	14 Sep 2003 04:58:35 -0000	2.17
+++ README.POSTFIX	15 Jan 2004 04:02:23 -0000
@@ -76,11 +76,12 @@
       % bin/genaliases
       Make sure that the owner of the data/aliases and data/aliases.db
-      file is `mailman' and that the group owner for those files is
-      `mailman'.  E.g.:
+      file is `mailman', that the group owner for those files is
+      `mailman', and that both files are group writable.  E.g.:
       % su
       % chown mailman:mailman data/aliases*
+      % chmod g+w data/aliases*
     - Hack your Postfix's main.cf file to include the following path
       in your alias_maps variable:
Index: Mailman/MTA/Postfix.py
RCS file: /cvsroot/mailman/mailman/Mailman/MTA/Postfix.py,v
retrieving revision 2.22
diff -u -r2.22 Postfix.py
--- Mailman/MTA/Postfix.py	14 Sep 2003 04:41:32 -0000	2.22
+++ Mailman/MTA/Postfix.py	15 Jan 2004 04:02:23 -0000
@@ -339,12 +339,21 @@
                 owner = pwd.getpwuid(stat[ST_UID])[0]
             except KeyError:
                 owner = 'uid %d' % stat[ST_UID]
-            print _('%(dbfile)s owned by %(owner)s (must be owned by %(user)s')
+            print _('%(dbfile)s owned by %(owner)s (must be owned by %(user)s'),
             state.ERRORS += 1
             if state.FIX:
                 print _('(fixing)')
                 uid = pwd.getpwnam(user)[2]
                 gid = grp.getgrnam(mm_cfg.MAILMAN_GROUP)[2]
                 os.chown(dbfile, uid, gid)
+            else:
+                print
+        if stat and (stat[ST_MODE] & targetmode) <> targetmode:
+            state.ERRORS += 1
+            octmode = oct(stat[ST_MODE])
+            print _('%(dbfile)s permissions must be 066x (got %(octmode)s)'),
+            if state.FIX:
+                print _('(fixing)')
+                os.chmod(dbfile, stat[ST_MODE] | targetmode)

More information about the Mailman-Users mailing list