Bug 89710 - mailman doesn't uninstall cleanly when using Postfix w/o sendmail installed
mailman doesn't uninstall cleanly when using Postfix w/o sendmail installed
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: mailman (Show other bugs)
9
All Linux
medium Severity medium
: ---
: ---
Assigned To: John Dennis
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-04-26 08:53 EDT by Chris Ricker
Modified: 2007-04-18 12:53 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-09-08 11:59:11 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Chris Ricker 2003-04-26 08:53:52 EDT
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 09:02:18 EDT
The problem here is that mailman's alias setup isn't at all Postfix-aware. The
spec file does:

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

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

Neither of these work with postfix, due to the different location of the aliases
file....
Comment 2 John Dennis 2003-04-28 12:43:50 EDT
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
else
  if /usr/sbin/alternatives --display mta | grep "link currently points to"
|grep -q sendmail; then
    # use sendmail aliases
  else
    # ignore this step as we don't recoginze the current MTA
  fi
fi
Comment 3 Chris Ricker 2003-04-28 12:54:52 EDT
Sure....

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 13:18:12 EDT
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

%post
if [ -f /etc/aliases ]
echo >> /etc/aliases
fi
if [ -f /etc/postfix/aliases ]
echo >> /etc/postfix/aliases
fi

%postun
if [ -f /etc/aliases ]
foo
fi
if [ -f /etc/postfix/aliases ]
bar
fi
Comment 5 John Dennis 2004-09-08 11:59:11 EDT
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 12:02:15 EDT
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.