#
# 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: 2
+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: 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)
%define apachedir /home/services/httpd
-%define _prefix /usr/lib/courier
+%define _datadir %{_prefix}/share/courier
%define _mandir /usr/share/man
+%define _libdir %{_prefix}/%{_lib}/courier
+%define _libexecdir %{_libdir}
%define _localstatedir /var/spool/courier
%define _sysconfdir /etc/courier
%define initdir /etc/rc.d/init.d
Summary: Courier Integrated POP3 server
Summary(pl): Zintegrowany serwer POP3 do Couriera
Group: Networking/Daemons
-Requires: %{name} = %{version}
+Requires: %{name} = %{version}-%{release}
Requires(post): openssl-tools >= 0.9.7c
%description pop3d
Summary: Courier Integrated IMAP server
Summary(pl): Zintegrowany serwer IMAP do Couriera
Group: Networking/Daemons
-Requires: %{name} = %{version}
+Requires: %{name} = %{version}-%{release}
Requires(post): openssl-tools >= 0.9.7c
Obsoletes: courier-imap
Obsoletes: courier-imap-common
Summary: Courier Integrated HTTP (webmail) server
Summary(pl): Zintegrowany serwer poczty przez HTTP (webmail) do Couriera
Group: Networking/Daemons
-Requires: %{name} = %{version}
+Requires: %{name} = %{version}-%{release}
Requires: %{_cgibindir}
Requires: %{_documentrootdir}
Summary: Courier Integrated Mailing List Manager
Summary(pl): Zintegrowany zarz±dca list dyskusyjnych do Couriera
Group: Applications/Mail
-Requires: %{name} = %{version}
+Requires: %{name} = %{version}-%{release}
%description mlm
This package installs couriermlm - a mailing list manager for the
Summary: Courier Integrated mail filter
Summary(pl): Zintegrowany filtr poczty do Couriera
Group: Applications/Mail
-Requires: %{name} = %{version}
+Requires: %{name} = %{version}-%{release}
%description maildrop
This package installs Courier mail server's integrated mail filter.
Summary: Courier mail server authenticated ESMTP module
Summary(pl): Modu³ uwierzytelniania ESMTP (SMTP AUTH) do Couriera
Group: Networking/Daemons
-Requires: %{name} = %{version}
+Requires: %{name} = %{version}-%{release}
%description smtpauth
Authenticated ESMTP allows remote users to authenticate themselves and
Courier.
%package authldap
-Summary: LDAP authentication daemon for Courier mail server
-Summary(pl): Demon autentykacji LDAP do Couriera
-Group: Networking/Daemons
-PreReq: %{name} = %{version}
+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}
+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}
+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.
%patch0 -p1
%{!?with_fam:%patch1 -p1}
%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
%build
# we don't want fax module
rm -rf courier/module.fax
+cp -f /usr/share/automake/config.sub webmail
cd rootcerts
-rm -f missing
%{__libtoolize}
%{__aclocal}
%{__autoconf}
%{__automake}
cd ..
-rm -f missing
+cd authlib
+%{__aclocal}
+%{__autoconf}
+%{__automake}
+cd ..
+
%{__libtoolize}
%{__aclocal}
%{__autoconf}
%{__automake}
+
+cd courier
+%{__aclocal}
+%{__autoconf}
+ln -s ../ltmain.sh .
+%{__automake}
+cd ..
+
%configure \
--localstatedir=%{_localstatedir} \
--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 /lib/security/pam_unix.so shadow nullok
-account required /lib/security/pam_unix.so
-session required /lib/security/pam_unix.so
+auth required pam_unix.so shadow nullok
+account required pam_unix.so
+session required pam_unix.so
EOF
done
endif
EOF
-#
# sendmail soft links
-#
-
-install -d $RPM_BUILD_ROOT/usr/sbin
-install -d $RPM_BUILD_ROOT/usr/lib
-
-ln -sf %{_bindir}/sendmail $RPM_BUILD_ROOT/usr/sbin/sendmail
-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
Now courier will refuse to accept SMTP messages except to localhost
add hosts to /etc/courier/esmtpacceptmailfor.dir/esmtpacceptmailfor
-run /usr/lib/courier/sbin/makeacceptmailfor
+run makeacceptmailfor
Add hosts to /etc/courier/locals you want to accept mail for
-run /usr/lib/courier/sbin/makealiases
+run makealiases
Enter user, who should receive mail for root, mailer-daemon and postmaster
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
- %{_prefix}/lib/courier/sqwebmaild start
+ %{_libdir}/courier/sqwebmaild start
fi
%preun webmail
if ps -A |grep -q sqwebmaild; then
- %{_prefix}/lib/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(644,daemon,daemon) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/courierd
%attr(640,daemon,daemon) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/aliases/system
%attr(644,root,root) %{_sysconfdir}/quotawarnmsg.example
-%dir %{_prefix}
-%dir %{_bindir}
-%dir %{_sbindir}
%dir %{_libdir}
%dir %{_libdir}/courier
%dir %{_datadir}
%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
-/usr/lib/sendmail
-/usr/sbin/sendmail
+%attr(755,root,root) /usr/lib/sendmail
%files pop3d
%defattr(644,root,root,755)
%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*