courier rpm

Zenon Panoussis <[email protected]> Sun, 18 Aug 2024 00:30:58 +0300
Newsgroups gmane.mail.imap.courier.general
Message-ID <[email protected]>
Hi

Having built and installed the 1.3.11-101 rpm, I got a working
courier except for LDAP aliases. Receiving mail fails with

authldaplib: refuse to authenticate alias@domain: uid=0, gid=0 (zero uid or gid not permitted)

I've had this once before, twenty years ago. I don't remember
how I solved it then, but I do remember that it was a lot of
pain.

Anyway, troubleshooting now from scratch, I realise there is no
courierldapaliasd, although courier-ldap is installed:

# rpm -ql courier-ldap
/usr/lib/courier/share/courierwebadmin/admin-15ldap.html
/usr/lib/courier/share/courierwebadmin/admin-15ldap.pl
/usr/lib/courier/share/courierwebadmin/admin-15ldapa.html
/usr/lib/courier/share/courierwebadmin/admin-15ldapa.pl
/usr/share/man/man8/courierldapaliasd.8.gz

The binary in /usr/lib/courier/sbin/ is not there. And there
is no ldapaliasrc.dist either. I found the latter in the rpm
buildroot, but it's not packaged.

Adding "BuildRequires: openldap-devel" to the courier-ldap
package section of courier.spec produced and packaged
courierldapaliasd. Reinstalling the new courier-ldap rpm, as
well as courier and courier-maildrop for good measure, fixed
the uid=0 problem. It did not fix the missing ldapaliasrc.dist.

***

A completely separate problem with the current src.rpm is
that it fails to build in mock because too tight permissions
prevent strip from doing its job. This patch fixes that:

--- courier.spec.orig   2024-08-17 21:08:10.688000000 +0000
+++ courier.spec        2024-08-17 21:07:33.825000000 +0000
@@ -673,6 +673,13 @@
  %{__ln_s} `realpath --relative-to /etc/cron.monthly -m %{_sbindir}/mkdhparams` $RPM_BUILD_ROOT/etc/cron.monthly/courier-mkdhparams
  echo "/etc/cron.monthly/courier-mkdhparams" >>filelist

+## Loosen up permissions in BUILDROOT bindirs to prevent strip
+## "unable to copy file -- permission denied" in mock.
+chmod -R a+rw %{buildroot}/usr/lib/courier/libexec/courier
+chmod -R a+rw %{buildroot}/usr/lib/courier/sbin
+chmod -R a+rw %{buildroot}/usr/lib/courier/bin
+chmod -R a+rw %{buildroot}/var/www/cgi-bin
+
  #
  # Make up some /etc/profile.d scripts
  #

Loosening up permissions at this stage doesn't matter, because
they are set again as they should be in %files.

***

Yet another oddity that I noticed while rebuilding the rpm,
is that it installed courier in the build environment:

# mock -r alma+epel-9-x86_64 --define "debug_package %{nil}" \
   --define "mailuser courier" --define "mailgroup courier" \
   --define 'notice_option --with-notice=unicode' \
   /home/zenon/rpmbuild/SRPMS/courier-1.3.11-101.el9.src.rpm
<snip>
Installing:
  courier-authlib-devel                                 x86_64                0.72.3-101.el9                               localrepo                 48 k
  courier-unicode-devel                                 x86_64                2.3.0-1.el9                                  localrepo                227 k
  expect                                                x86_64                5.45.4-16.el9                                appstream                245 k
  gcc-c++                                               x86_64                11.4.1-3.el9.alma.1                          appstream                 13 M
  gdbm-devel                                            x86_64                1:1.19-4.el9                                 crb                       58 k
  ghostscript                                           x86_64                9.54.0-16.el9_4                              appstream                 36 k
  glibc-langpack-en                                     x86_64                2.34-100.el9_4.2.alma.2                      baseos                   552 k
  gnupg2                                                x86_64                2.3.3-4.el9                                  baseos                   2.5 M
  gnutls-devel                                          x86_64                3.8.3-4.el9_4                                appstream                2.2 M
  gnutls-utils                                          x86_64                3.8.3-4.el9_4                                appstream                287 k
  groff                                                 x86_64                1.22.4-10.el9                                appstream                1.2 M
  hunspell                                              x86_64                1.7.0-11.el9                                 appstream                322 k
  libgcrypt-devel                                       x86_64                1.10.0-10.el9_2                              appstream                143 k
  libidn2-devel                                         x86_64                2.3.0-7.el9                                  appstream                 56 k
  mailcap                                               noarch                2.1.49-5.el9                                 baseos                    32 k
  make                                                  x86_64                1:4.3-8.el9                                  baseos                   530 k
  mgetty-sendfax                                        x86_64                1.2.1-19.el9                                 localrepo                146 k
  netpbm-progs                                          x86_64                10.95.00-2.el9                               appstream                2.3 M
  openldap-devel                                        x86_64                2.6.6-3.el9                                  appstream                684 k
  pam-devel                                             x86_64                1.5.1-19.el9                                 appstream                140 k
  pcre2-devel                                           x86_64                10.40-5.el9                                  appstream                471 k
  perl                                                  x86_64                4:5.32.1-481.el9                             appstream                 11 k
  perl-ExtUtils-Embed                                   noarch                1.35-481.el9                                 appstream                 16 k
  procps-ng                                             x86_64                3.3.17-14.el9                                baseos                   332 k
  systemd-rpm-macros                                    noarch                252-32.el9_4.6                               baseos                    69 k
  wget                                                  x86_64                1.21.1-7.el9                                 appstream                772 k
Installing dependencies:
  acl                                                   x86_64                2.3.1-4.el9                                  baseos                    69 k
  adobe-mappings-cmap                                   noarch                20171205-12.el9                              appstream                1.9 M
  adobe-mappings-cmap-deprecated                        noarch                20171205-12.el9                              appstream                106 k
  adobe-mappings-pdf                                    noarch                20180407-10.el9                              appstream                637 k
  annobin                                               x86_64                12.31-2.el9                                  appstream                1.0 M
  avahi-libs                                            x86_64                0.8-20.el9                                   baseos                    67 k
  courier                                               x86_64                1.3.11-101.el9                               localrepo                1.2 M
  courier-authlib                                       x86_64                0.72.3-101.el9                               localrepo                156 k
  courier-authlib-config-courier-courier                x86_64                0.72.3-101.el9                               localrepo                7.1 k
  courier-unicode
<snip>

I happened to have an earlier courier in my local repo before
I started with 1.3.11-101, so this self-dependency didn't create
a problem for me. But it will for anyone trying to build a courier
rpm for the first time. I didn't check where the circularity came
from.

Note: if some very sharp eye catches mgetty-sendfax on this el9
and wonders wtf, it is not a specfile miss. In this aspect the
specfile works exactly as intended, but I commented out an %if,
%else and %endif in the fax section.
,
Cheers,

Z


-- 
Слава Україні!
Путлер хуйло!


_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users