Bug 89710 - mailman doesn't uninstall cleanly when using Postfix w/o sendmail installed
Summary: mailman doesn't uninstall cleanly when using Postfix w/o sendmail installed
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: mailman
Version: 9
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: John Dennis
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2003-04-26 12:53 UTC by Chris Ricker
Modified: 2007-04-18 16:53 UTC (History)
0 users

Clone Of:
Last Closed: 2004-09-08 15:59:11 UTC

Attachments (Terms of Use)

Description Chris Ricker 2003-04-26 12:53:52 UTC
On a system with Postfix only, uninstalling mailman gives the following error:

[kaboom@verdande RPMS]$ sudo rpm -e mailman
grep: /etc/aliases: No such file or directory
[kaboom@verdande RPMS]$

The problem here presumably being that it's /etc/aliases for sendmail, but
/etc/postfix/aliases for Postfix....

Comment 1 Chris Ricker 2003-04-26 13:02:18 UTC
The problem here is that mailman's alias setup isn't at all Postfix-aware. The
spec file does:

if ! grep -q "mailman-owner" /etc/aliases 2> /dev/null ; then
  cat >> /etc/aliases << EOF
# mailman aliases
mailman: postmaster
mailman-owner: mailman
  /usr/bin/newaliases > /dev/null 2>&1 || :

  TMPFILE=`mktemp /etc/aliasesXXXXXX`
  if test -n "$TMPFILE" ; then
    egrep -E -v 'mailman aliases|mailman:|mailman-owner:' /etc/aliases >${TMPFILE}
    mv ${TMPFILE} /etc/aliases
  /usr/bin/newaliases > /dev/null 2>&1 || :

Neither of these work with postfix, due to the different location of the aliases

Comment 2 John Dennis 2003-04-28 16:43:50 UTC
O.K. I think the proper way to deal with this is via "alternatives" which is how
both sendmail and postfix are installed in a RH system. I was planning on doing
something like this, does it seem reasonable to you?

if /usr/sbin/alternatives --display mta | grep "link currently points to" | grep
-q postfix; then
  # use postfix aliases
  if /usr/sbin/alternatives --display mta | grep "link currently points to"
|grep -q sendmail; then
    # use sendmail aliases
    # ignore this step as we don't recoginze the current MTA

Comment 3 Chris Ricker 2003-04-28 16:54:52 UTC

It might be simpler actually to put aliases under alternatives control, though?
Its not usually used that way (for non-conflicting files), but an alternatives
setup where:

* sendmail installs /etc/aliases.sendmail
* postfix installs /etc/postfix/aliases.postfix
* /etc/aliases && /etc/postfix/aliases are symlinks to /etc/alternatives/mta-aliases
* /etc/alternatives/mta-aliases points to whichever file is correct for the
currently configured mta

The main advantage of doing that is that there might be other software / admins
who assume /etc/aliases is the aliases file, regardless of the MTA being used....

Comment 4 Chris Ricker 2003-04-28 17:18:12 UTC
Separately from the above idea (putting aliases under alternatives), for this
particular problem it's probably best to put the aliases in the %post in both
/etc/aliases and /etc/postfix/aliases if those files exist (I presume they're
needed by both MTAs?), and to remove them from both files if they exist in the
%postun, and not worry about alternatives at all.... That way, things will still
Just Work if someone does something like

1. have postfix configured as mta
2. install mailman
3. switch MTAs to sendmail

I'm thinking of something like

if [ -f /etc/aliases ]
echo >> /etc/aliases
if [ -f /etc/postfix/aliases ]
echo >> /etc/postfix/aliases

if [ -f /etc/aliases ]
if [ -f /etc/postfix/aliases ]

Comment 5 John Dennis 2004-09-08 15:59:11 UTC
When fixing bug #125651 I removed the editing of the aliases, see that
bug for an explantion of the reasoning.

I'll confess it's not clear to me what is right or wrong, should the
rpm edit the aliases or not? I've been coming to the conclusion its
hard to get this right for all users and configurations and the
concept of user responsibility needs to apply, we are not at the point
of having rpm be able to handle every aspect of package configuration
and if you've installed AND run mailman AND created lists then you've
done some amount of manual configuration AND should be aware of what
you need to do if after all of that you're going to remove mailman and
shutdown all your lists. I hope thats the right decision ;-)

Comment 6 John Dennis 2004-09-08 16:02:15 UTC
BTW, Thomas Werner now owns both postfix and sendmail. A little while
ago there was a lively discussion of merging the aliases files between
postfix and sendmail. I'm not sure what became of that, but since
Thomas now owns both rpms I think that ball is now in his camp and my
imperfect recollection was he was not an advocate of merging.

Note You need to log in before you can comment on or make changes to this bug.