genaliases on Postfix is inefficient and can cause bounces

Bug #266408 reported by Cedders-users
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
GNU Mailman
Fix Released
Medium
Mark Sapiro

Bug Description

We're running Mailman 2.1.5-8sarge5 and Postfix 2.1.5-9 on a mail server
with a few hundred lists. For reasons described on Bug [ 1809697 ], we run
genaliases as a cron job.

While genaliases is running, incoming posts and admin mail to some lists
can bounce, with "550 User unknown in virtual alias table". It appears
that genaliases loops over all lists and calls
MTA.create(mlist, nolock=True, quiet=quiet)
for each list, which in turn calls _update_maps() which runs Postfix's
postmap and postalias commands. Hence for a time while running genaliases
the list of mappings loaded into Postfix is incomplete. The process can
also take over a minute because of this repeated hashing.

Suggested fix (would patch on Bazaar but repository is empty :) -
add "if not nolock:" before
    _update_maps()
in Mailman/MTA/Postfix.py

and call "MTA.create(None, quiet=quiet)" once more before
    os.umask(omask)
in bin/genaliases

[http://sourceforge.net/tracker/index.php?func=detail&aid=1809706&group_id=103&atid=100103]

Revision history for this message
Cedders-users (cedders-users) wrote :

Originator: YES

The issue also appears to be present in 2.1.9.

Revision history for this message
Mark Sapiro (msapiro) wrote :

> and call "MTA.create(None, quiet=quiet)" once more before
> os.umask(omask)
> in bin/genaliases

Has this been tested? It looks like this will be a deadlock because genaliases has the lock at this point and MTA,create tries to obtain it. It seems that things need to be rearranged to

    finally:
        lock.unlock(unconditionally=True)
        MTA.create(None, quiet=quiet)
        os.umask(omask)

Changed in mailman:
assignee: nobody → Mark Sapiro (msapiro)
milestone: 2.1-stable → 2.1.15
status: New → In Progress
Mark Sapiro (msapiro)
Changed in mailman:
status: In Progress → Fix Committed
Revision history for this message
Cedders (cedric-gn) wrote :

Very good. I don't recall testing it, and wonder if it needs further testing with MTAs other than Postfix.

BTW the reference to Bug [ 1809697 ] is now launchpad bug 266407.

Revision history for this message
Mark Sapiro (msapiro) wrote :

It was tested with MTA = 'Manual' and MTA = 'Postfix' (the only supplied MTA modules) before being committed.

Mark Sapiro (msapiro)
Changed in mailman:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.