SHA256
1
0
forked from pool/courier-imap

- update to 5.0.14

* Fix packaging problem with a faulty courier-unicode dependency
- update to 5.0.13
  * Fixes a crash caused by a malformed DNS query/response
- move SSL cache files to /var/cache/courier-imap/ and put (open)SUSE
  specific changes to configuration files in a patch file (instead of
  sed scripts)
  + courier-imap-config.patch
- remove obsolete SysV init files
  - courier-imap.init
  - courier-imap-ssl.init
  - courier-pop.init
  - courier-pop-ssl.init

OBS-URL: https://build.opensuse.org/package/show/server:mail/courier-imap?expand=0&rev=95
This commit is contained in:
Arjen de Korte 2021-03-02 09:13:52 +00:00 committed by Git OBS Bridge
parent 0575e7b8ac
commit f82021a9bc
11 changed files with 136 additions and 617 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:dd210f27f7d034721802f4d07a5b8f69aa875a86589211fabe87fd91df5073de
size 3359074

Binary file not shown.

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:671a6a64c2d46e515097979b4488b8284d0260eabdff56ff81ef66cf1f6169c3
size 3359363

Binary file not shown.

84
courier-imap-config.patch Normal file
View File

@ -0,0 +1,84 @@
diff -purN libs/imap/imapd.dist.in libs/imap/imapd.dist.in
--- libs/imap/imapd.dist.in 2021-03-01 13:29:08.000000000 +0100
+++ libs/imap/imapd.dist.in 2021-03-02 08:28:34.862607943 +0100
@@ -21,7 +21,7 @@
#
# ADDRESS=127.0.0.1
-ADDRESS=0
+ADDRESS=127.0.0.1
##NAME: PORT:1
#
@@ -57,7 +57,7 @@ MAXDAEMONS=40
#
# Maximum number of connections to accept from the same IP address
-MAXPERIP=4
+MAXPERIP=20
##NAME: PIDFILE:0
#
@@ -480,7 +480,7 @@ HEADERFROM=X-IMAP-Sender
# The default setting is going to be NO, so you'll have to manually flip
# it to yes.
-IMAPDSTART=NO
+IMAPDSTART=YES
##NAME: MAILDIRPATH:0
#
diff -purN libs/imap/imapd-ssl.dist.in libs/imap/imapd-ssl.dist.in
--- libs/imap/imapd-ssl.dist.in 2021-03-01 13:29:07.000000000 +0100
+++ libs/imap/imapd-ssl.dist.in 2021-03-02 08:30:10.370603684 +0100
@@ -72,7 +72,7 @@ SSLLOGGEROPTS="-name=imapd-ssl"
#
# Whether or not to start IMAP over SSL on simap port:
-IMAPDSSLSTART=NO
+IMAPDSSLSTART=YES
##NAME: IMAPDSTARTTLS:0
#
@@ -313,7 +313,7 @@ TLS_VERIFYPEER=NONE
# automatically created, TLS_CACHESIZE bytes long, and used as a cache
# buffer.
-TLS_CACHEFILE=@localstatedir@/couriersslpop3cache
+TLS_CACHEFILE=@localstatedir@/cache/courier/sslpop3cache
TLS_CACHESIZE=524288
##NAME: MAILDIRPATH:0
diff -purN libs/imap/pop3d.dist.in libs/imap/pop3d.dist.in
--- libs/imap/pop3d.dist.in 2021-03-01 13:29:08.000000000 +0100
+++ libs/imap/pop3d.dist.in 2021-03-02 08:31:18.846600632 +0100
@@ -146,7 +146,7 @@ LOGGEROPTS="-name=pop3d"
# with enough platforms so that people get annoyed with having to flip it to
# YES every time.
-POP3DSTART=NO
+POP3DSTART=YES
##NAME: POP3_LOG_DELETIONS:0
#
diff -purN libs/imap/pop3d-ssl.dist.in libs/imap/pop3d-ssl.dist.in
--- libs/imap/pop3d-ssl.dist.in 2021-03-01 13:29:07.000000000 +0100
+++ libs/imap/pop3d-ssl.dist.in 2021-03-02 08:32:03.754598629 +0100
@@ -61,7 +61,7 @@ SSLLOGGEROPTS="-name=pop3d-ssl"
#
# Whether or not to start POP3 over SSL on spop3 port:
-POP3DSSLSTART=NO
+POP3DSSLSTART=YES
##NAME: POP3_STARTTLS:0
#
@@ -310,7 +310,7 @@ TLS_VERIFYPEER=NONE
# problems with SSL clients. Disable SSL caching by commenting out the
# following settings:
-TLS_CACHEFILE=@localstatedir@/couriersslimapcache
+TLS_CACHEFILE=@localstatedir@/cache/courier/sslimapcache
TLS_CACHESIZE=524288
##NAME: MAILDIRPATH:0

View File

@ -1,146 +0,0 @@
#! /bin/sh
# Copyright (c) 2005 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All rights reserved.
#
# Author: Thorsten Kukuk <feedback@suse.de>
#
# /etc/init.d/courier-imap-ssl
#
### BEGIN INIT INFO
# Provides: courier-imap-ssl
# Required-Start: $syslog $remote_fs courier-authdaemon
# Should-Start:
# Required-Stop: $syslog $remote_fs
# Should-Stop:
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: Courier-IMAP server for SSL connections
# Description: Start the Courier-IMAP server, which is an
# IMAP server for Maildir mailboxes. This
# version only accepts SSL connections.
### END INIT INFO
# Check for missing binaries (stale symlinks should not happen)
IMAP_BIN=/usr/sbin/imapd
test -x $IMAP_BIN || exit 5
. /etc/rc.status
# Read configuration
TLS_CACHEFILE=""
. /etc/courier/imapd
. /etc/courier/imapd-ssl
test "$MAILDIRPATH" == "" && MAILDIRPATH=Maildir
test "$PIDFILE" == "" && PIDFILE=/var/run/imapd.pid
test "$SSLPIDFILE" == "" && SSLPIDFILE=/var/run/imapd-ssl.pid
LOCKFILE=${SSLPIDFILE}.lock
# Reset status of this service
rc_reset
# our version of check_proc
#IN: $PIDFILE $LOCKFILE
check_proc(){
# check for process
ps auxw | grep -v grep | grep $1 >/dev/null
RET=$?
if [ $RET = "1" ]; then
if [ -f $1 ]; then
ERR=1
elif [ -f $2 ]; then
ERR=2
else
ERR=3
fi
else
ERR=$RET
fi
STATUS=$ERR
return $STATUS
}
case "$1" in
start)
/etc/init.d/courier-authdaemon status > /dev/null || /etc/init.d/courier-authdaemon start
echo -n "Starting Courier-IMAP (SSL)"
if test ! -f $TLS_CERTFILE
then
echo -n " generating-SSL-certificate..."
/usr/sbin/mkimapdcert >/dev/null 2>&1
fi
if test "$TLS_CACHEFILE" != ""
then
rm -f $TLS_CACHEFILE
fi
umask $IMAP_UMASK
ulimit -v $IMAP_ULIMITD
/usr/bin/env - /bin/sh -c " set -a ;
. /etc/courier/imapd ; \
. /etc/courier/imapd-ssl ; \
IMAP_TLS=1; export IMAP_TLS; \
PROXY_HOSTNAME=$PROXY_HOSTNAME ; \
/usr/sbin/courierlogger -pid=$SSLPIDFILE -start $SSLLOGGEROPTS \
/usr/lib/courier-imap/couriertcpd -address=$SSLADDRESS \
-maxprocs=$MAXDAEMONS -maxperip=$MAXPERIP $TCPDOPTS \
$SSLPORT $COURIERTLS -server -tcpd /usr/sbin/imaplogin \
$IMAP_BIN ${MAILDIRPATH}"
# Remember status and be verbose
rc_status -v
;;
stop)
echo -n "Shutting down Courier-IMAP (SSL)"
/usr/sbin/courierlogger -pid=$SSLPIDFILE -stop
# Remember status and be verbose
rc_status -v
rm -f $SSLPIDFILE{,.lock}
;;
try-restart)
$0 status >/dev/null && $0 restart
# Remember status
rc_status
;;
restart)
$0 stop
$0 start
# Remember status
rc_status
;;
force-reload)
echo -n "Reload Courier-IMAP (SSL)"
$0 stop && $0 start
# Remember status
rc_status
;;
reload)
echo -n "Reload Courier-IMAP (SSL)"
rc_failed 3
# Remember status and be verbose
rc_status -v
;;
status)
echo -n "Checking for Courier-IMAP (SSL)"
## Check status with checkproc(8), if process is running
## checkproc will return with exit status 0.
# Status has a slightly different for the status command:
# 0 - service running
# 1 - service dead, but /var/run/ pid file exists
# 2 - service dead, but /var/lock/ lock file exists
# 3 - service not running
check_proc "$SSLPIDFILE" "$LOCKFILE"
# Remeber status and be verbose
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
exit 1
;;
esac
rc_exit

View File

@ -1,3 +1,22 @@
-------------------------------------------------------------------
Tue Mar 2 07:36:29 UTC 2021 - Arjen de Korte <suse+build@de-korte.org>
- update to 5.0.14
* Fix packaging problem with a faulty courier-unicode dependency
- update to 5.0.13
* Fixes a crash caused by a malformed DNS query/response
- move SSL cache files to /var/cache/courier-imap/ and put (open)SUSE
specific changes to configuration files in a patch file (instead of
sed scripts)
+ courier-imap-config.patch
- remove obsolete SysV init files
- courier-imap.init
- courier-imap-ssl.init
- courier-pop.init
- courier-pop-ssl.init
-------------------------------------------------------------------
Wed Feb 10 08:53:30 UTC 2021 - Arjen de Korte <suse+build@de-korte.org>

View File

@ -1,134 +0,0 @@
#! /bin/sh
# Copyright (c) 2005 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All rights reserved.
#
# Author: Thorsten Kukuk <feedback@suse.de>
#
# /etc/init.d/courier-imap
#
### BEGIN INIT INFO
# Provides: courier-imap
# Required-Start: $syslog $remote_fs courier-authdaemon
# Should-Start:
# Required-Stop: $syslog $remote_fs
# Should-Stop:
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: Courier-IMAP server
# Description: Start the Courier-IMAP server, which is an
# IMAP server for Maildir mailboxes.
### END INIT INFO
# Check for missing binaries (stale symlinks should not happen)
IMAP_BIN=/usr/sbin/imapd
test -x $IMAP_BIN || exit 5
. /etc/rc.status
# Read configuration
. /etc/courier/imapd
test "$MAILDIRPATH" == "" && MAILDIRPATH=Maildir
test "$PIDFILE" == "" && PIDFILE=/var/run/imapd.pid
LOCKFILE=${PIDFILE}.lock
# Reset status of this service
rc_reset
# our version of check_proc
#IN: $PIDFILE $LOCKFILE
check_proc(){
# check for process
ps auxw | grep -v grep | grep $1 >/dev/null
RET=$?
if [ $RET = "1" ]; then
if [ -f $1 ]; then
ERR=1
elif [ -f $2 ]; then
ERR=2
else
ERR=3
fi
else
ERR=$RET
fi
STATUS=$ERR
return $STATUS
}
case "$1" in
start)
/etc/init.d/courier-authdaemon status > /dev/null || /etc/init.d/courier-authdaemon start
echo -n "Starting Courier-IMAP "
umask $IMAP_UMASK
ulimit -v $IMAP_ULIMITD
/usr/bin/env - /bin/sh -c " set -a ;
. /etc/courier/imapd ; \
grep IMAPDSTARTTLS=NO /etc/courier/imapd-ssl &>/dev/null || . /etc/courier/imapd-ssl ; \
IMAP_STARTTLS=$IMAPDSTARTTLS ; export IMAP_STARTTLS ; \
PROXY_HOSTNAME=$PROXY_HOSTNAME ; \
TLS_PROTOCOL=$TLS_STARTTLS_PROTOCOL ; \
/usr/sbin/courierlogger -pid=$PIDFILE -start $LOGGEROPTS \
/usr/lib/courier-imap/couriertcpd -address=$ADDRESS \
-maxprocs=$MAXDAEMONS -maxperip=$MAXPERIP $TCPDOPTS \
$PORT /usr/sbin/imaplogin \
$IMAP_BIN ${MAILDIRPATH}"
# Remember status and be verbose
rc_status -v
;;
stop)
echo -n "Shutting down Courier-IMAP "
/usr/sbin/courierlogger -pid=$PIDFILE -stop
# Remember status and be verbose
rc_status -v
rm -f $PIDFILE{,.lock}
;;
try-restart)
$0 status >/dev/null && $0 restart
# Remember status
rc_status
;;
restart)
$0 stop
$0 start
# Remember status
rc_status
;;
force-reload)
echo -n "Reload Courier-IMAP "
$0 stop && $0 start
# Remember status
rc_status
;;
reload)
echo -n "Reload Courier-IMAP "
rc_failed 3
# Remember status and be verbose
rc_status -v
;;
status)
echo -n "Checking for Courier-IMAP "
## Check status with checkproc(8), if process is running
## checkproc will return with exit status 0.
# Status has a slightly different for the status command:
# 0 - service running
# 1 - service dead, but /var/run/ pid file exists
# 2 - service dead, but /var/lock/ lock file exists
# 3 - service not running
check_proc "$PIDFILE" "$LOCKFILE"
# Remember status and be verbose
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
exit 1
;;
esac
rc_exit

View File

@ -17,7 +17,7 @@
Name: courier-imap
Version: 5.0.12
Version: 5.0.14
Release: 0
Summary: An IMAP and POP3 Server for Maildir MTAs
License: GPL-3.0-or-later
@ -27,12 +27,8 @@ Source0: https://downloads.sourceforge.net/project/courier/imap/%{version
Source1: https://downloads.sourceforge.net/project/courier/imap/%{version}/%{name}-%{version}.tar.bz2.sig
Source2: pop3.pamd
Source3: imap.pamd
# Keyring downloaded from https://www.courier-mta.org/KEYS.bin#/%{name}.keyring
# Keyring downloaded from https://www.courier-mta.org/KEYS.bin#/%%{name}.keyring
Source4: %{name}.keyring
Source11: courier-imap.init
Source12: courier-imap-ssl.init
Source13: courier-pop.init
Source14: courier-pop-ssl.init
Source15: courier-imap.service
Source16: courier-imap-ssl.service
Source17: courier-imap-gencert.service
@ -44,6 +40,8 @@ Patch2: %{name}-ulimit_conf.patch
### Patch for upstream:
## fixes typo in Makefile.am
Patch3: %{name}-Makefile.patch
# Apply (open)SUSE specific changes to configuration
Patch4: %{name}-config.patch
BuildRequires: audit-libs
BuildRequires: courier-authlib-devel >= 0.71
BuildRequires: courier-unicode-devel >= 2.1
@ -97,10 +95,11 @@ version. If you install this version, you must remove it if you later
install the entire Courier server.
%prep
%setup -q
%patch0
%patch2
%patch3
%autosetup -p0
# For %%doc macro
mv libs/imap/README{,.imap}
mv libs/maildir/README.sharedfolders{.txt,}
mv libs/maildir/README.maildirquota{.txt,}
%build
%configure \
@ -118,7 +117,7 @@ install the entire Courier server.
--with-certdb=%{_sysconfdir}/ssl/certs \
--with-certsdir=%{_sysconfdir}/ssl/private \
--enable-workarounds-for-imap-client-bugs
make %{?_smp_mflags}
%make_build
%install
%make_install
@ -127,38 +126,21 @@ mv %{buildroot}%{_bindir}/{couriertls,imapd,pop3d} %{buildroot}%{_sbindir}/
# Rename imapd.8 to courier-imapd.8
mv %{buildroot}%{_mandir}/man8/imapd.8 %{buildroot}%{_mandir}/man8/%{name}d.8
# Install PAM config files
install -D -m 644 $RPM_SOURCE_DIR/pop3.pamd %{buildroot}%{_sysconfdir}/pam.d/pop3
install -D -m 644 $RPM_SOURCE_DIR/imap.pamd %{buildroot}%{_sysconfdir}/pam.d/imap
install -D -m 644 %{S:2} %{buildroot}%{_sysconfdir}/pam.d/pop3
install -D -m 644 %{S:3} %{buildroot}%{_sysconfdir}/pam.d/imap
# Install init scripts
for i in imap imap-ssl imap-gencert pop pop-ssl pop-gencert; do
ln -s -f service %{buildroot}%{_sbindir}/rccourier-$i
done
# Install service files
for j in imap imap-ssl imap-gencert pop pop-ssl pop-gencert; do
install -D -m 0644 $RPM_SOURCE_DIR/courier-$j.service %{buildroot}/%{_unitdir}/courier-$j.service
done
install -d -m 0755 %{buildroot}%{_unitdir}
install -m 0644 %{S:15} %{S:16} %{S:17} %{S:18} %{S:19} %{S:20} %{buildroot}%{_unitdir}
# Remove original init scripts, will not work longer
rm %{buildroot}%{_prefix}/lib/%{name}/imapd.rc
rm %{buildroot}%{_prefix}/lib/%{name}/imapd-ssl.rc
rm %{buildroot}%{_prefix}/lib/%{name}/pop3d.rc
rm %{buildroot}%{_prefix}/lib/%{name}/pop3d-ssl.rc
#
# Fix imapd.dist
#
sed -i -e 's/^IMAPDSTART=.*/IMAPDSTART=YES/' %{buildroot}%{_sysconfdir}/courier/imapd.dist
sed -i -e 's/^ADDRESS=.*/ADDRESS=127.0.0.1/' %{buildroot}%{_sysconfdir}/courier/imapd.dist
sed -i -e 's/^MAXPERIP=.*/MAXPERIP=20/' %{buildroot}%{_sysconfdir}/courier/imapd.dist
sed -i -e 's/^IMAPDSSLSTART=.*/IMAPDSSLSTART=YES/' %{buildroot}%{_sysconfdir}/courier/imapd-ssl.dist
#sed -i -e 's/^#\ \+\(TLS_CIPHER_LIST=.*\)/\1/' %{buildroot}%{_sysconfdir}/courier/imapd-ssl.dist
sed -i -e 's/^POP3DSTART=.*/POP3DSTART=YES/' %{buildroot}%{_sysconfdir}/courier/pop3d.dist
sed -i -e 's/^POP3DSSLSTART=.*/POP3DSSLSTART=YES/' %{buildroot}%{_sysconfdir}/courier/pop3d-ssl.dist
#sed -i -e 's/^#\ \+\(TLS_CIPHER_LIST=.*\)/\1/' %{buildroot}%{_sysconfdir}/courier/pop3d-ssl.dist
# For %doc macro
install -m 0644 libs/imap/ChangeLog ChangeLog
install -m 0644 libs/imap/README README.imap
install -m 0644 libs/imap/README.proxy README.proxy
install -m 0644 libs/maildir/README.maildirquota.txt README.maildirquota
install -m 0644 libs/maildir/README.sharedfolders.txt README.sharedfolders
install -D -m 0755 sysconftool %{buildroot}%{_datadir}/%{name}/sysconftool
chmod 755 %{buildroot}%{_datadir}/%{name}/sysconftool
cat >%{buildroot}%{_datadir}/%{name}/configlist <<EOF
@ -167,44 +149,32 @@ cat >%{buildroot}%{_datadir}/%{name}/configlist <<EOF
%{_sysconfdir}/courier/pop3d.dist
%{_sysconfdir}/courier/pop3d-ssl.dist
EOF
# SSL state cache directory
install -d %{buildroot}%{_localstatedir}/cache/%{name}/
%pre
for i in imap imap-ssl imap-gencert pop pop-ssl pop-gencert; do
%service_add_pre courier-$i.service
done
%service_add_pre courier-imap-gencert.service courier-imap-ssl.service courier-imap.service
%service_add_pre courier-pop-gencert.service courier-pop-ssl.service courier-pop.service
%preun
for i in imap imap-ssl imap-gencert pop pop-ssl pop-gencert; do
%service_del_preun courier-$i.service
done
if [ "$1" = "0" ]; then
rm -f %{_localstatedir}/couriersslcache
rm -f %{_localstatedir}/imapd.pid
rm -f %{_localstatedir}/imapd-ssl.pid
rm -f %{_localstatedir}/imapd.pid.lock
rm -f %{_localstatedir}/imapd-ssl.pid.lock
rm -f %{_localstatedir}/pop3d.pid
rm -f %{_localstatedir}/pop3d-ssl.pid
rm -f %{_localstatedir}/pop3d.pid.lock
rm -f %{_localstatedir}/pop3d-ssl.pid.lock
fi
%service_del_preun courier-imap-gencert.service courier-imap-ssl.service courier-imap.service
%service_del_preun courier-pop-gencert.service courier-pop-ssl.service courier-pop.service
%post
%{_datadir}/%{name}/sysconftool `cat %{_datadir}/%{name}/configlist` >/dev/null
for i in imap imap-ssl imap-gencert pop pop-ssl pop-gencert; do
%service_add_post courier-$i.service
done
%service_add_post courier-imap-gencert.service courier-imap-ssl.service courier-imap.service
%service_add_post courier-pop-gencert.service courier-pop-ssl.service courier-pop.service
%postun
for i in imap imap-ssl imap-gencert pop pop-ssl pop-gencert; do
%service_del_postun courier-$i.service
done
%service_del_postun courier-imap-gencert.service courier-imap-ssl.service courier-imap.service
%service_del_postun courier-pop-gencert.service courier-pop-ssl.service courier-pop.service
%files
%defattr(-,root,root,755)
%license COPYING*
%doc AUTHORS libs/imap/ChangeLog libs/imap/BUGS README README.imap README.maildirquota README.proxy
%doc README.sharedfolders
%doc AUTHORS README
%doc libs/imap/ChangeLog libs/imap/BUGS libs/imap/README.imap libs/imap/README.proxy
%doc libs/maildir/README.sharedfolders libs/maildir/README.maildirquota
%config %attr(644,root,root) %{_sysconfdir}/pam.d/imap
%config %attr(644,root,root) %{_sysconfdir}/pam.d/pop3
%dir %{_sysconfdir}/courier
@ -223,5 +193,8 @@ done
%{_sbindir}/*
%{_mandir}/man?/*
%{_unitdir}/courier-*.service
%dir %attr(750,root,root) %{_localstatedir}/cache/%{name}/
%ghost %{_localstatedir}/cache/%{name}/sslpop3cache
%ghost %{_localstatedir}/cache/%{name}/sslimapcache
%changelog

View File

@ -1,145 +0,0 @@
#! /bin/sh
# Copyright (c) 2005 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All rights reserved.
#
# Author: Thorsten Kukuk <feedback@suse.de>
#
# /etc/init.d/courier-pop-ssl
#
### BEGIN INIT INFO
# Provides: courier-pop-ssl
# Required-Start: $syslog $remote_fs courier-authdaemon
# Should-Start:
# Required-Stop: $syslog $remote_fs
# Should-Stop:
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: Courier-POP3 server for SSL connections
# Description: Start the Courier-POP3 server, which is an
# POP3 server for Maildir mailboxes. This
# version only accepts SSL connections.
### END INIT INFO
# Check for missing binaries (stale symlinks should not happen)
POP3_BIN=/usr/sbin/pop3d
test -x $POP3_BIN || exit 5
. /etc/rc.status
# Read configuration
TLS_CACHEFILE=""
. /etc/courier/pop3d
. /etc/courier/pop3d-ssl
test "$MAILDIRPATH" == "" && MAILDIRPATH=Maildir
test "$PIDFILE" == "" && PIDFILE=/var/run/pop3d.pid
test "$SSLPIDFILE" == "" && PIDFILE=/var/run/pop3d-ssl.pid
LOCKFILE=${SSLPIDFILE}.lock
# Reset status of this service
rc_reset
# our version of check_proc
#IN: $PIDFILE $LOCKFILE
check_proc(){
# check for process
ps auxw | grep -v grep | grep $1 >/dev/null
RET=$?
if [ $RET = "1" ]; then
if [ -f $1 ]; then
ERR=1
elif [ -f $2 ]; then
ERR=2
else
ERR=3
fi
else
ERR=$RET
fi
STATUS=$ERR
return $STATUS
}
case "$1" in
start)
/etc/init.d/courier-authdaemon status > /dev/null || /etc/init.d/courier-authdaemon start
echo -n "Starting Courier-POP3 (SSL)"
if test ! -f $TLS_CERTFILE
then
echo -n " generating-SSL-certificate..."
/usr/sbin/mkpop3dcert >/dev/null 2>&1
fi
if test "$TLS_CACHEFILE" != ""
then
rm -f $TLS_CACHEFILE
fi
ulimit -v $POP3_ULIMITD
/usr/bin/env - /bin/sh -c " set -a ;
. /etc/courier/pop3d ; \
. /etc/courier/pop3d-ssl ; \
POP3_TLS=1; POP3_STARTTLS=NO; POP3_TLS_REQUIRED=0; \
PROXY_HOSTNAME=$PROXY_HOSTNAME ; \
/usr/sbin/courierlogger -pid=$SSLPIDFILE -start $SSLLOGGEROPTS \
/usr/lib/courier-imap/couriertcpd -address=$SSLADDRESS \
-maxprocs=$MAXDAEMONS -maxperip=$MAXPERIP $TCPDOPTS \
$SSLPORT $COURIERTLS -server -tcpd /usr/sbin/pop3login \
$POP3_BIN ${MAILDIRPATH}"
# Remember status and be verbose
rc_status -v
;;
stop)
echo -n "Shutting down Courier-POP3 (SSL)"
/usr/sbin/courierlogger -pid=$SSLPIDFILE -stop
# Remember status and be verbose
rc_status -v
rm -f $SSLPIDFILE{,.lock}
;;
try-restart)
$0 status >/dev/null && $0 restart
# Remeber status
rc_status
;;
restart)
$0 stop
$0 start
# Remeber status
rc_status
;;
force-reload)
echo -n "Reload Courier-POP3 (SSL)"
$0 stop && $0 start
# Remeber status
rc_status
;;
reload)
echo -n "Reload Courier-POP3 (SSL)"
rc_failed 3
# Remember status and be verbose
rc_status -v
;;
status)
echo -n "Checking for Courier-POP3 (SSL)"
## Check status with checkproc(8), if process is running
## checkproc will return with exit status 0.
# Status has a slightly different for the status command:
# 0 - service running
# 1 - service dead, but /var/run/ pid file exists
# 2 - service dead, but /var/lock/ lock file exists
# 3 - service not running
check_proc "$SSLPIDFILE" "$LOCKFILE"
#Remeber status and be verbose
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
exit 1
;;
esac
rc_exit

View File

@ -1,132 +0,0 @@
#! /bin/sh
# Copyright (c) 2005 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All rights reserved.
#
# Author: Thorsten Kukuk <feedback@suse.de>
#
# /etc/init.d/courier-pop
#
### BEGIN INIT INFO
# Provides: courier-pop
# Required-Start: $syslog $remote_fs courier-authdaemon
# Should-Start:
# Required-Stop: $syslog $remote_fs
# Should-Stop:
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: Courier-POP3 server
# Description: Start the Courier-POP3 server, which is an
# POP3 server for Maildir mailboxes.
### END INIT INFO
# Check for missing binaries (stale symlinks should not happen)
POP3_BIN=/usr/sbin/pop3d
test -x $POP3_BIN || exit 5
. /etc/rc.status
# Read configuration
. /etc/courier/pop3d
test "$MAILDIRPATH" == "" && MAILDIRPATH=Maildir
test "$PIDFILE" == "" && PIDFILE=/var/run/pop3d.pid
LOCKFILE=${PIDFILE}.lock
# Reset status of this service
rc_reset
# our version of check_proc
#IN: $PIDFILE $LOCKFILE
check_proc(){
# check for process
ps auxw | grep -v grep | grep $1 >/dev/null
RET=$?
if [ $RET = "1" ]; then
if [ -f $1 ]; then
ERR=1
elif [ -f $2 ]; then
ERR=2
else
ERR=3
fi
else
ERR=$RET
fi
STATUS=$ERR
return $STATUS
}
case "$1" in
start)
/etc/init.d/courier-authdaemon status > /dev/null || /etc/init.d/courier-authdaemon start
echo -n "Starting Courier-POP3 "
/usr/bin/env - /bin/sh -c " set -a ;
. /etc/courier/pop3d ; \
grep POP3_STARTTLS=NO /etc/courier/pop3d-ssl &>/dev/null || . /etc/courier/pop3d-ssl ; \
POP3_STARTTLS=$POP3_STARTTLS ; export POP3_STARTTLS ; \
PROXY_HOSTNAME=$PROXY_HOSTNAME ; \
TLS_PROTOCOL=$TLS_STARTTLS_PROTOCOL ; \
/usr/sbin/courierlogger -pid=$PIDFILE -start $LOGGEROPTS \
/usr/lib/courier-imap/couriertcpd -address=$ADDRESS \
-maxprocs=$MAXDAEMONS -maxperip=$MAXPERIP $TCPDOPTS \
$PORT /usr/sbin/pop3login \
$POP3_BIN ${MAILDIRPATH}"
# Remember status and be verbose
rc_status -v
;;
stop)
echo -n "Shutting down Courier-POP3 "
/usr/sbin/courierlogger -pid=$PIDFILE -stop
# Remember status and be verbose
rc_status -v
rm -f $PIDFILE{,.lock}
;;
try-restart)
$0 status >/dev/null && $0 restart
# Remember status
rc_status
;;
restart)
$0 stop
$0 start
# Remember status
rc_status
;;
force-reload)
echo -n "Reload Courier-POP3 "
$0 stop && $0 start
# Remember status
rc_status
;;
reload)
echo -n "Reload Courier-POP3 "
rc_failed 3
# Remember status and be verbose
rc_status -v
;;
status)
echo -n "Checking for Courier-POP3 "
## Check status with checkproc(8), if process is running
## checkproc will return with exit status 0.
# Status has a slightly different for the status command:
# 0 - service running
# 1 - service dead, but /var/run/ pid file exists
# 2 - service dead, but /var/lock/ lock file exists
# 3 - service not running
check_proc "$PIDFILE" "$LOCKFILE"
#Remeber status and be verbose
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
exit 1
;;
esac
rc_exit