Edgewall Software

Version 1 (modified by cavallini@…, 7 years ago) ( diff )

How to use Mailman as a source of authentication

Kudos to Christopher Gabriel for his original idea: http://www.cgabriel.org/2009/09/21/ldap-e-la-disperazione/

Mailman can be used as a source of authentication for Trac. This is super handy, as it allows to have a single signon between the two.

Here is how it works:

  • an Apache macro (please install mod_macro and mod_python, and add www-data to the group list)
/etc/apache2/macros

<Macro PrivateProjectMailman $name $list>
        <Location /svn/$name>
                AuthName "$name"
                AuthType Basic
                PythonPath "sys.path+['/etc/apache2/']"
                PythonAuthenHandler mailauth
                PythonOption MailmanList $list
                AuthUserFile /dev/null
                AuthBasicAuthoritative Off
                require valid-user
        </Location>

        <Location "/$name">
                AuthName "$name"
                AuthType Basic
                PythonPath "sys.path+['/etc/apache2/']"
                PythonAuthenHandler mailauth
                PythonOption MailmanList $list
                AuthUserFile /dev/null
                AuthBasicAuthoritative Off
                require valid-user
        </Location>

</Macro>


<Macro PublicProjectMailman $name $list>
        <Location /svn/$name>
                <LimitExcept GET PROPFIND OPTIONS REPORT>
                AuthName "$name"
                AuthType Basic
                PythonPath "sys.path+['/etc/apache2/']"
                PythonAuthenHandler mailauth
                PythonOption MailmanList $list
                AuthUserFile /dev/null
                AuthBasicAuthoritative Off
                require valid-user
                </LimitExcept>
        </Location>

        <Location "/$name/login">
                AuthName "$name"
                AuthType Basic
                PythonPath "sys.path+['/etc/apache2/']"
                PythonAuthenHandler mailauth
                PythonOption MailmanList $list
                AuthUserFile /dev/null
                AuthBasicAuthoritative Off
                require valid-user
        </Location>

</Macro> 
  • then, in the relative VirtualHost
Use PrivateProjectMailman progetto-x lista-progetto-x

or

Use PublicProjectMailman progetto-x lista-progetto-x

And you are done.

Note: See TracWiki for help on using the wiki.