#
# Conditional build:
-%bcond_with fam # with fam support
+%bcond_with fam # with fam support
#
Summary: Courier mail server
Summary(pl): Serwer poczty Courier
Name: courier
-Version: 0.44.2
-Release: 4
+Version: 0.45.1
+Release: 0.9
License: GPL
Group: Networking/Daemons
Source0: http://dl.sourceforge.net/courier/%{name}-%{version}.tar.bz2
-# Source0-md5: 8c607c70a692d8f8ccb769a3f96d2f28
+# Source0-md5: 449b03a7d61e2174ad7dc65e4ddf57c6
Patch0: %{name}-openssl-path.patch
Patch1: %{name}-withoutfam.patch
Patch2: %{name}-maildir.patch
Patch3: %{name}-no_res_query.patch
+Patch4: %{name}-sendmail_dir.patch
+Patch5: %{name}-start_scripts.patch
URL: http://www.courier-mta.org/
BuildRequires: autoconf
BuildRequires: automake
Requires(post): openssl-tools >= 0.9.7c
%{?with_fam:Requires: fam}
Provides: smtpdaemon
-Obsoletes: smtpdaemon
Obsoletes: exim
Obsoletes: masqmail
+Obsoletes: nullmailer
Obsoletes: omta
Obsoletes: qmail
Obsoletes: sendmail
Obsoletes: sendmail-cf
Obsoletes: sendmail-doc
Obsoletes: smail
+Obsoletes: smtpdaemon
+Obsoletes: ssmtp
Obsoletes: zmailer
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
Courier.
%package authldap
-Summary: LDAP authentication daemon for Courier mail server
-Summary(pl): Demon autentykacji LDAP do Couriera
-Group: Networking/Daemons
-PreReq: %{name} = %{version}-%{release}
+Summary: LDAP authentication daemon for Courier mail server
+Summary(pl): Demon autentykacji LDAP do Couriera
+Group: Networking/Daemons
+PreReq: %{name} = %{version}-%{release}
%description authldap
This package provides LDAP authentication for Courier.
Ten pakiet pozwala na korzystanie z autentykacji LDAP w Courierze.
%package authmysql
-Summary: MySQL authentication daemon for Courier mail server
-Summary(pl): Demon autentykacji MySQL do Couriera
-Group: Networking/Daemons
-PreReq: %{name} = %{version}-%{release}
+Summary: MySQL authentication daemon for Courier mail server
+Summary(pl): Demon autentykacji MySQL do Couriera
+Group: Networking/Daemons
+PreReq: %{name} = %{version}-%{release}
%description authmysql
This package provides MySQL authentication for Courier.
Ten pakiet pozwala na korzystanie z autentykacji MySQL w Courierze.
%package authpgsql
-Summary: PostgreSQL authentication daemon for Courier mail server
-Summary(pl): Demon autentykacji PostgreSQL do Couriera
-Group: Networking/Daemons
-PreReq: %{name} = %{version}-%{release}
+Summary: PostgreSQL authentication daemon for Courier mail server
+Summary(pl): Demon autentykacji PostgreSQL do Couriera
+Group: Networking/Daemons
+PreReq: %{name} = %{version}-%{release}
%description authpgsql
This package provides PostgreSQL authentication for Courier.
%{!?with_fam:%patch1 -p1}
%patch2 -p1
%patch3 -p1
+%patch4 -p1
+%patch5 -p1
%build
# we don't want fax module
--sysconfdir=%{_sysconfdir} \
--mandir=%{_mandir} \
--enable-imageurl=%{_imageurl} \
- --with-db=db
+ --with-db=db \
+ --with-mailer=%{_sbindir}/sendmail
%{__make}
%{__make} check
%install
rm -rf $RPM_BUILD_ROOT
umask 022
-install -d -p $RPM_BUILD_ROOT{%{_prefix},/etc/{cron.hourly,pam.d},%{initdir}} \
+install -d -p $RPM_BUILD_ROOT{%{_prefix}/lib,/etc/{cron.hourly,pam.d},%{initdir}} \
$RPM_BUILD_ROOT{%{_cgibindir},%{_documentrootdir}} \
$RPM_BUILD_ROOT{%{_sysconfdir}/userdb,%{_localstatedir}{/calendar,/tmp/broken}} \
$RPM_BUILD_ROOT/etc/cron.hourly
do
cat > $RPM_BUILD_ROOT/etc/pam.d/$X <<EOF
#%PAM-1.0
-auth required pam_unix.so shadow nullok
-account required pam_unix.so
-session required pam_unix.so
+auth required pam_unix.so shadow nullok
+account required pam_unix.so
+session required pam_unix.so
EOF
done
EOF
# sendmail soft links
-
-ln -sf %{_bindir}/sendmail $RPM_BUILD_ROOT/usr/lib/sendmail
+ln -sf %{_sbindir}/sendmail $RPM_BUILD_ROOT/usr/lib/sendmail
# This link by default is missing
ln -sf %{_datadir}/esmtpd-ssl $RPM_BUILD_ROOT%{_sbindir}/esmtpd-ssl
rm -rf $RPM_BUILD_ROOT
%post
+if [ "$1" = "1" ]; then
/sbin/chkconfig --add courier
-%{_sbindir}/makealiases 2>/dev/null || true
-%{_sbindir}/makesmtpaccess 2>/dev/null || true
-
-# If we do not have a certificate, make one up.
-if [ ! -f %{_datadir}/esmtpd.pem ]; then
- %{_sbindir}/mkesmtpdcert
-fi
cat <<EOF
into /etc/courier/aliases/system
EOF
+fi
+
+if [ -e /var/lock/subsys/courier ]; then
+ %{initdir}/courier restart
+fi
%preun
if [ "$1" = "0" ]; then
+ if [ -e /var/lock/subsys/courier ]; then
%{initdir}/courier stop
+ fi
/sbin/chkconfig --del courier
fi
%post imapd
-# If we do not have a certificate, make one up.
-if [ ! -f %{_datadir}/imapd.pem ]; then
- %{_sbindir}/mkimapdcert
+if [ -e %{_localstatedir}/tmp/imapd.pid ]; then
+ %{_sbindir}/imapd stop
+ %{_sbindir}/imapd start
+fi
+if [ -e %{_localstatedir}/tmp/imapd-ssl.pid ]; then
+ %{_sbindir}/imapd-ssl stop
+ %{_sbindir}/imapd-ssl start
fi
-%{_sbindir}/imapd stop
-%{_sbindir}/imapd start
-%{_sbindir}/imapd-ssl stop
-%{_sbindir}/imapd-ssl start
%preun imapd
if [ "$1" = "0" ]; then
+ if [ -e %{_localstatedir}/tmp/imapd.pid ]; then
%{_sbindir}/imapd stop
+ fi
+ if [ -e %{_localstatedir}/tmp/imapd-ssl.pid ]; then
%{_sbindir}/imapd-ssl stop
+ fi
fi
%post pop3d
-# If we do not have a certificate, make one up.
-if [ ! -f %{_datadir}/pop3d.pem ]; then
- %{_sbindir}/mkpop3dcert
+if [ -e %{_localstatedir}/tmp/pop3d.pid ]; then
+ %{_sbindir}/pop3d stop
+ %{_sbindir}/pop3d start
+fi
+if [ -e %{_localstatedir}/tmp/pop3d-ssl.pid ]; then
+ %{_sbindir}/pop3d-ssl stop
+ %{_sbindir}/pop3d-ssl start
fi
-%{_sbindir}/pop3d stop
-%{_sbindir}/pop3d start
%preun pop3d
if [ "$1" = "0" ]; then
+ if [ -e %{_localstatedir}/tmp/pop3d.pid ]; then
%{_sbindir}/pop3d stop
+ fi
+ if [ -e %{_localstatedir}/tmp/pop3d-ssl.pid ]; then
+ %{_sbindir}/pop3d-ssl stop
+ fi
fi
%post webmail
if ps -A |grep -q authdaemond; then
- %{_libdir}/courier/sqwebmaild start
+ %{_libdir}/courier/sqwebmaild start
fi
%preun webmail
if ps -A |grep -q sqwebmaild; then
- %{_libdir}/courier/sqwebmaild stop
+ %{_libdir}/courier/sqwebmaild stop
fi
%post smtpauth
-%{_sbindir}/esmtpd stop
-%{_sbindir}/esmtpd start
+if [ -e %{_localstatedir}/tmp/esmtpd.pid ]; then
+ %{_sbindir}/esmtpd stop
+ %{_sbindir}/esmtpd start
+fi
+if [ -e %{_localstatedir}/tmp/esmtpd-ssl.pid ]; then
+ %{_sbindir}/esmtpd-ssl stop
+ %{_sbindir}/esmtpd-ssl start
+fi
+if [ "$1" = "1" ]; then
echo
echo Remember to enable auth in esmtp config files
echo
+fi
%postun smtpauth
if [ "$1" = "0" ]; then
+ if [ -e %{_localstatedir}/tmp/esmtpd.pid ]; then
%{_sbindir}/esmtpd stop
%{_sbindir}/esmtpd start
+ fi
+ if [ -e %{_localstatedir}/tmp/esmtpd-ssl.pid ]; then
+ %{_sbindir}/esmtpd-ssl stop
+ %{_sbindir}/esmtpd-ssl start
+ fi
fi
%post authldap
if ps -A |grep -q authdaemond; then
- %{_libdir}/authlib/authdaemond stop
- %{_libdir}/authlib/authdaemond start
+ %{_libdir}/authlib/authdaemond stop
+ %{_libdir}/authlib/authdaemond start
fi
%postun authldap
if [ -x %{_libdir}/authlib/authdaemond ]; then
- if ps -A |grep -q authdaemond; then
- %{_libdir}/authlib/authdaemond stop;
- %{_libdir}/authlib/authdaemond start;
- fi
+ if ps -A |grep -q authdaemond; then
+ %{_libdir}/authlib/authdaemond stop;
+ %{_libdir}/authlib/authdaemond start;
+ fi
fi
%post authmysql
if ps -A |grep -q authdaemond; then
- %{_libdir}/authlib/authdaemond stop
- %{_libdir}/authlib/authdaemond start
+ %{_libdir}/authlib/authdaemond stop
+ %{_libdir}/authlib/authdaemond start
fi
%postun authmysql
if [ -x %{_libdir}/authlib/authdaemond ]; then
- if ps -A |grep -q authdaemond; then
- %{_libdir}/authlib/authdaemond stop;
- %{_libdir}/authlib/authdaemond start;
- fi
+ if ps -A |grep -q authdaemond; then
+ %{_libdir}/authlib/authdaemond stop;
+ %{_libdir}/authlib/authdaemond start;
+ fi
fi
%post authpgsql
if ps -A |grep -q authdaemond; then
- %{_libdir}/authlib/authdaemond stop
- %{_libdir}/authlib/authdaemond start
+ %{_libdir}/authlib/authdaemond stop
+ %{_libdir}/authlib/authdaemond start
fi
%postun authpgsql
if [ -x %{_libdir}/authlib/authdaemond ]; then
- if ps -A |grep -q authdaemond; then
- %{_libdir}/authlib/authdaemond stop;
- %{_libdir}/authlib/authdaemond start;
- fi
+ if ps -A |grep -q authdaemond; then
+ %{_libdir}/authlib/authdaemond stop;
+ %{_libdir}/authlib/authdaemond start;
+ fi
fi
%files
%defattr(644,root,root,755)
-%doc AUTHORS BENCHMARKS NEWS README TODO htmldoc/*
+%doc AUTHORS BENCHMARKS ChangeLog NEWS README TODO htmldoc/*
%{_mandir}/man1/sendmail.1*
%{_mandir}/man1/preline.1*
%{_mandir}/man1/maildirmake.1*
%attr(2755,root,daemon) %{_bindir}/mailq
%attr(755,root,root) %{_bindir}/maildirmake
%attr(755,root,root) %{_bindir}/maildirkw
-%attr(4755,root,root) %{_bindir}/sendmail
+%attr(4755,root,root) %{_sbindir}/sendmail
%attr(4755,root,root) %{_bindir}/rmail
%attr(755,root,root) %{_bindir}/lockmail
%attr(755,root,root) %{_bindir}/deliverquota
%attr(700,daemon,daemon) %dir %{_sysconfdir}/userdb
%attr(755,daemon,daemon) %dir %{_localstatedir}/calendar
%attr(755,daemon,daemon) %dir %{_localstatedir}/tmp/broken
-%attr(4755,root,root) %{_bindir}/sendmail
%attr(755,root,root) /usr/lib/sendmail
%files pop3d
%attr(755,root,root) %{_datadir}/sqwebmail/sendit.sh
%attr(755,root,root) %{_datadir}/sqwebmail/ldapsearch
%attr(755,root,root) %{_libdir}/%{name}/sqwebmaild
-%dir %{_libdir}/%{name}/webmail/
+%dir %{_libdir}/%{name}/webmail
%attr(755,root,root) %{_libdir}/%{name}/webmail/webadmin
%attr(755,root,root) %{_libdir}/%{name}/webmail/webmail
%attr(700, bin, bin) %dir %{_localstatedir}/webmail-logincache
%{_mandir}/man1/refor*
%{_mandir}/man5/maildrop*
%attr(644,daemon,daemon) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/maildrop
-%attr(755,root,root) %{_bindir}/reformail
-%attr(755,root,root) %{_bindir}/reformime
%attr(4755,root,root) %{_bindir}/maildrop
+%attr(755,root,root) %{_bindir}/reformail
+%attr(755,root,root) %{_bindir}/reformime
%files mlm
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/courier/modules/esmtp/authend
%files authldap
-%{_mandir}/man7/authldap.7*
+%defattr(644,root,root,755)
+%doc authlib/README.ldap
%attr(755,root,root) %{_libdir}/authlib/authdaemond.ldap
%attr(660,daemon,daemon) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authldaprc
+%{_mandir}/man7/authldap.7*
%files authmysql
-%{_mandir}/man7/authmysql.7*
+%defattr(644,root,root,755)
+%doc authlib/README.authmysql.html authlib/README.authmysql.myownquery
%attr(755,root,root) %{_libdir}/authlib/authdaemond.mysql
%attr(660,daemon,daemon) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authmysqlrc
+%{_mandir}/man7/authmysql.7*
%files authpgsql
-%{_mandir}/man7/authpgsql.7*
+%defattr(644,root,root,755)
+%doc authlib/README.authpostgres.html
%attr(755,root,root) %{_libdir}/authlib/authdaemond.pgsql
%attr(660,daemon,daemon) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/authpgsqlrc
+%{_mandir}/man7/authpgsql.7*