Accepting request 248225 from home:darix:dovecot

- also needed

OBS-URL: https://build.opensuse.org/request/show/248225
OBS-URL: https://build.opensuse.org/package/show/server:mail/dovecot?expand=0&rev=1
This commit is contained in:
Dominique Leuenberger 2014-09-09 18:02:38 +00:00 committed by Git OBS Bridge
commit a5152a058a
14 changed files with 523 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

28
dovecot-2.0.configfiles Normal file
View File

@ -0,0 +1,28 @@
/etc/dovecot/README
/etc/dovecot/conf.d/10-auth.conf
/etc/dovecot/conf.d/10-director.conf
/etc/dovecot/conf.d/10-logging.conf
/etc/dovecot/conf.d/10-mail.conf
/etc/dovecot/conf.d/10-master.conf
/etc/dovecot/conf.d/10-ssl.conf
/etc/dovecot/conf.d/15-lda.conf
/etc/dovecot/conf.d/20-imap.conf
/etc/dovecot/conf.d/20-lmtp.conf
/etc/dovecot/conf.d/20-pop3.conf
/etc/dovecot/conf.d/90-acl.conf
/etc/dovecot/conf.d/90-plugin.conf
/etc/dovecot/conf.d/90-quota.conf
/etc/dovecot/conf.d/auth-checkpassword.conf.ext
/etc/dovecot/conf.d/auth-deny.conf.ext
/etc/dovecot/conf.d/auth-ldap.conf.ext
/etc/dovecot/conf.d/auth-master.conf.ext
/etc/dovecot/conf.d/auth-passwdfile.conf.ext
/etc/dovecot/conf.d/auth-sql.conf.ext
/etc/dovecot/conf.d/auth-static.conf.ext
/etc/dovecot/conf.d/auth-system.conf.ext
/etc/dovecot/conf.d/auth-vpopmail.conf.ext
/etc/dovecot/dovecot-db.conf.ext
/etc/dovecot/dovecot-dict-sql.conf.ext
/etc/dovecot/dovecot-ldap.conf.ext
/etc/dovecot/dovecot-sql.conf.ext
/etc/dovecot/dovecot.conf

31
dovecot-2.1.configfiles Normal file
View File

@ -0,0 +1,31 @@
/etc/dovecot/README
/etc/dovecot/conf.d/10-auth.conf
/etc/dovecot/conf.d/10-director.conf
/etc/dovecot/conf.d/10-logging.conf
/etc/dovecot/conf.d/10-mail.conf
/etc/dovecot/conf.d/10-master.conf
/etc/dovecot/conf.d/10-ssl.conf
/etc/dovecot/conf.d/15-lda.conf
/etc/dovecot/conf.d/15-mailboxes.conf
/etc/dovecot/conf.d/20-imap.conf
/etc/dovecot/conf.d/20-lmtp.conf
/etc/dovecot/conf.d/20-pop3.conf
/etc/dovecot/conf.d/90-acl.conf
/etc/dovecot/conf.d/90-plugin.conf
/etc/dovecot/conf.d/90-quota.conf
/etc/dovecot/conf.d/auth-checkpassword.conf.ext
/etc/dovecot/conf.d/auth-deny.conf.ext
/etc/dovecot/conf.d/auth-dict.conf.ext
/etc/dovecot/conf.d/auth-ldap.conf.ext
/etc/dovecot/conf.d/auth-master.conf.ext
/etc/dovecot/conf.d/auth-passwdfile.conf.ext
/etc/dovecot/conf.d/auth-sql.conf.ext
/etc/dovecot/conf.d/auth-static.conf.ext
/etc/dovecot/conf.d/auth-system.conf.ext
/etc/dovecot/conf.d/auth-vpopmail.conf.ext
/etc/dovecot/dovecot-db.conf.ext
/etc/dovecot/dovecot-dict-auth.conf.ext
/etc/dovecot/dovecot-dict-sql.conf.ext
/etc/dovecot/dovecot-ldap.conf.ext
/etc/dovecot/dovecot-sql.conf.ext
/etc/dovecot/dovecot.conf

31
dovecot-2.2.configfiles Normal file
View File

@ -0,0 +1,31 @@
/etc/dovecot/README
/etc/dovecot/conf.d/10-auth.conf
/etc/dovecot/conf.d/10-director.conf
/etc/dovecot/conf.d/10-logging.conf
/etc/dovecot/conf.d/10-mail.conf
/etc/dovecot/conf.d/10-master.conf
/etc/dovecot/conf.d/10-ssl.conf
/etc/dovecot/conf.d/11-object-storage.conf
/etc/dovecot/conf.d/15-lda.conf
/etc/dovecot/conf.d/15-mailboxes.conf
/etc/dovecot/conf.d/20-imap.conf
/etc/dovecot/conf.d/20-lmtp.conf
/etc/dovecot/conf.d/20-pop3.conf
/etc/dovecot/conf.d/90-acl.conf
/etc/dovecot/conf.d/90-plugin.conf
/etc/dovecot/conf.d/90-quota.conf
/etc/dovecot/conf.d/auth-checkpassword.conf.ext
/etc/dovecot/conf.d/auth-deny.conf.ext
/etc/dovecot/conf.d/auth-dict.conf.ext
/etc/dovecot/conf.d/auth-ldap.conf.ext
/etc/dovecot/conf.d/auth-master.conf.ext
/etc/dovecot/conf.d/auth-passwdfile.conf.ext
/etc/dovecot/conf.d/auth-sql.conf.ext
/etc/dovecot/conf.d/auth-static.conf.ext
/etc/dovecot/conf.d/auth-system.conf.ext
/etc/dovecot/conf.d/auth-vpopmail.conf.ext
/etc/dovecot/dovecot-dict-auth.conf.ext
/etc/dovecot/dovecot-dict-sql.conf.ext
/etc/dovecot/dovecot-ldap.conf.ext
/etc/dovecot/dovecot-sql.conf.ext
/etc/dovecot/dovecot.conf

17
dovecot-fw Normal file
View File

@ -0,0 +1,17 @@
## Name: Dovecot Server
## Description: Opens ports for the Dovecot Server
# space separated list of allowed TCP ports
TCP="imap imaps pop3 pop3s sieve 4190"
# space separated list of allowed UDP ports
UDP=""
# space separated list of allowed RPC services
RPC=""
# space separated list of allowed IP protocols
IP=""
# space separated list of allowed UDP broadcast ports
BROADCAST=""

44
dovecot.README.SUSE Normal file
View File

@ -0,0 +1,44 @@
SSL support in dovecot:
-----------------------
SSL is disabled pr. default, to enable create an SSL certificate, and modify
the dovecot configuration file accordingly.
The easiest way to generate certificates is editing
"/usr/share/doc/packages/dovecot/dovecot-openssl.cnf"
and running
"/usr/share/doc/packages/dovecot/mkcert.sh"
to create the needed SSL certificate. afterwards set "ssl_disable"
in "/etc/dovecot/dovecot.conf" to "no".
Modules location:
-----------------
Since the libexec dir is /usr/lib(64) when conforming to FHS as SUSE LINUX
does, the modules should go to /usr/lib(64)/dovecot/modules/{imap,pop3}.
Configuration:
--------------
Since SLE12 there is no cyrus-imap support. The new imap server is dovecot.
Changes in autoyast.
<postfix_mda> may have following values: "local" | "procmail"
There is no yast support for dovecot configuration.
If you want to deliver local mails to dovecot follow this steps:
1. Set MAIL_CREATE_CONFIG to "no" in /etc/sysconfig/mail to prohibit yast2 to override your configuration.
2. Set mailbox_command = /usr/lib/dovecot/dovecot-lda -f "$SENDER" -a "$RECIPIENT" in /etc/postfix/main.cf
3. Set mail_location = maildir:~/Maildir or to your prefered value in /etc/dovecot/conf.d/10-mail.conf
4. Set a normal user as alias for root in /etc/aliases
5. Execute following comands:
postalias /etc/aliases
systemctl restart postfix
systemctl enable dovecot
systemctl start dovecot

57
dovecot.changes Normal file
View File

@ -0,0 +1,57 @@
-------------------------------------------------------------------
Mon Sep 8 23:16:05 UTC 2014 - mrueckert@suse.de
- copy the correct file as init script in the non systemd case
- remove %buildroot from %pre script just in case we uncomment that
part at some point
- only have %post in the systemd case
-------------------------------------------------------------------
Mon Sep 8 23:00:14 UTC 2014 - mrueckert@suse.de
- we dont need a dovecot implementation at build time just at
install time. add BuildIgnore to get around the loop.
-------------------------------------------------------------------
Fri Sep 5 15:56:35 UTC 2014 - mrueckert@suse.de
- remove triggers again. when we handle the dovecot update problems
by manually stopping in %pre and manually starting up again in
%postun we dont need them anymore.
-------------------------------------------------------------------
Fri Sep 5 13:03:30 UTC 2014 - mrueckert@suse.de
- as we cant use service_del_preun we should still check if it is
the last package that we install otherwise we kill it
unconditionally
-------------------------------------------------------------------
Fri Sep 5 12:51:40 UTC 2014 - mrueckert@suse.de
- no longer restart the socket activation. this seems to kill the
dovecot.
-------------------------------------------------------------------
Fri Sep 5 11:35:37 UTC 2014 - mrueckert@suse.de
- move ldconfig to the versioned packages
- own the shared var directories.
- kick out the triggerin script as we dont need it.
- restart dovecot also when the module packages are updated
-------------------------------------------------------------------
Fri Sep 5 11:18:40 UTC 2014 - mrueckert@suse.de
- added trigger scripts
-------------------------------------------------------------------
Fri Sep 5 10:59:11 UTC 2014 - mrueckert@suse.de
- make the dovecot implementation a prereq
-------------------------------------------------------------------
Thu Sep 4 13:44:06 UTC 2014 - mrueckert@suse.de
- start an unversioned wrapper package again

94
dovecot.init Normal file
View File

@ -0,0 +1,94 @@
#! /bin/sh
# Copyright (c) 1995-2004 SUSE Linux AG, Nuernberg, Germany.
# 2005-2007 SUSE / Novell Inc.
# All rights reserved.
#
# Author: Mads Martin Joergensen <mmj@suse.de>
# Marcus Rueckert <mrueckert@suse.de>
# Please send feedback to http://www.suse.de/feedback/
#
# /etc/init.d/dovecot
# and its symbolic link
# /usr/sbin/rcdovecot
#
### BEGIN INIT INFO
# Provides: dovecot
# Required-Start: $remote_fs $syslog $network
# Required-Stop: $remote_fs $syslog $network
# Should-Start: $named $time postgresql mysql ldap
# Should-Stop: postgresql mysql ldap
# X-Start-Before: exim postfix
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: Dovecot IMAP/POP3/SASL server
# Description: Dovecot IMAP/POP3/SASL server
### END INIT INFO
. /etc/rc.status
# Reset status of this service
rc_reset
DOVECOT_BIN=/usr/sbin/dovecot
test -x $DOVECOT_BIN || {
echo "$DOVECOT_BIN not installed";
if [ "$1" = "stop" ] ; then
exit 0
else
exit 5
fi
}
case "$1" in
start)
echo -n "Starting dovecot "
startproc $DOVECOT_BIN
rc_status -v
;;
stop)
echo -n "Stopping dovecot "
killproc -TERM $DOVECOT_BIN
rc_status -v
;;
try-restart|condrestart)
$0 status
if test $? = 0; then
$0 restart
else
rc_reset
fi
rc_status
;;
restart)
$0 stop
$0 start
rc_status
;;
force-reload)
# dovecot has support for reloading it's config when
# recieving signal 1 (SIGHUP). There's still some
# issues noticed in the dovecot-TODO though so restart
# for now.
echo -n "Reload service dovecot "
# killproc -HUP $DOVECOT_BIN
# rc_status -v
$0 try-restart
rc_status
;;
reload)
echo -n "Reload service dovecot "
killproc -HUP $DOVECOT_BIN
rc_status -v
;;
status)
echo -n "Checking for service dovecot "
checkproc $DOVECOT_BIN
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
exit 1
;;
esac
rc_exit

6
dovecot.pam Normal file
View File

@ -0,0 +1,6 @@
#%PAM-1.0
auth include common-auth
account include common-account
password include common-password
session include common-session

11
dovecot.service Normal file
View File

@ -0,0 +1,11 @@
[Unit]
Description=Dovecot IMAP/POP3 email server
After=local-fs.target network.target
[Service]
Type=simple
ExecStart=/usr/sbin/dovecot -F
NonBlocking=yes
[Install]
WantedBy=multi-user.target

15
dovecot.socket Normal file
View File

@ -0,0 +1,15 @@
[Unit]
Description=Dovecot IMAP/POP3 email server activation socket
[Socket]
#dovecot expects separate IPv4 and IPv6 sockets
BindIPv6Only=ipv6-only
ListenStream=0.0.0.0:143
ListenStream=[::]:143
ListenStream=0.0.0.0:993
ListenStream=[::]:993
KeepAlive=true
[Install]
WantedBy=sockets.target

162
dovecot.spec Normal file
View File

@ -0,0 +1,162 @@
#
# spec file for package dovecot
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%if 0%{?suse_version} > 1230
%bcond_without systemd
%else
%bcond_with systemd
%endif
Name: dovecot
Version: 2.2
Release: 0
Summary: IMAP and POP3 Server Written Primarily with Security in Mind
License: BSD-3-Clause and LGPL-2.1+ and MIT
Group: Productivity/Networking/Email/Servers
Url: http://www.dovecot.org/
PreReq: dovecot-implementation
Recommends: dovecot22
#!BuildIgnore: dovecot-implementation
%if %{with systemd}
BuildRequires: pkgconfig(systemd)
%{?systemd_requires}
%define has_systemd 1
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
Source0: dovecot-2.0.configfiles
Source1: dovecot-2.1.configfiles
Source2: dovecot-2.2.configfiles
Source3: %{name}.init
Source4: %{name}.pam
Source5: %{name}.README.SUSE
Source6: %{name}-fw
Source7: dovecot.tmpfiles.d
Source8: dovecot.service
Source9: dovecot.socket
%description
Dovecot is an IMAP and POP3 server for Linux and UNIX-like systems,
written primarily with security in mind. Although it is written in C,
it uses several coding techniques to avoid most of the common pitfalls.
Dovecot can work with standard mbox and maildir formats and is fully
compatible with UW-IMAP and Courier IMAP servers as well as mail
clients accessing the mailboxes directly.
This is a wrapper package that will just handle common things for all
versioned dovecot packages.
%prep
%build
%install
for i in $RPM_SOURCE_DIR/*.configfiles ; do
echo "Creating ghost files for '$i'"
for j in $(<$i) ; do
install -D -m 0644 /dev/null %{buildroot}$j
done
done
install -D -m 0644 %{S:5} %{buildroot}%{_datadir}/doc/packages/dovecot/README.SUSE
install -d %{buildroot}%{_sbindir}
# install the init script
%if %{with systemd}
%{__install} -D -m 644 %{S:7} %{buildroot}/usr/lib/tmpfiles.d/dovecot.conf
%{__ln_s} -f %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
install -D -m 0644 %{S:8} %{buildroot}%{_unitdir}/dovecot.service
install -D -m 0644 %{S:9} %{buildroot}%{_unitdir}/dovecot.socket
%else
%{__install} -D -m 0755 %{S:3} %{buildroot}%{_sysconfdir}/init.d/%{name}
%{__ln_s} -f %{_sysconfdir}/init.d/%{name} %{buildroot}%{_sbindir}/rc%{name}
%endif
# install pam config
%{__install} -D -m 0644 %{S:4} %{buildroot}%{_sysconfdir}/pam.d/%{name}
# install firewall services
%{__install} -D -m 644 %{S:6} %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name}
# create /var directories
%{__install} -m 0755 -Dd \
%{buildroot}%{_var}/run/%{name}/login/ \
%{buildroot}%{_var}/lib/%{name}/
%pre
/usr/sbin/groupadd -r %{name} &>/dev/null || :
/usr/sbin/useradd -g %{name} -s /bin/false -r -c "User for Dovecot imapd" -d %{_var}/run/%{name} %{name} &>/dev/null || :
/usr/sbin/useradd -g %{name} -s /bin/false -r -c "User for Dovecot login" -d %{_var}/run/%{name} dovenull &>/dev/null || :
# try to copy the default configuration.
#
# we fail silently if the dovecot-implementation package is not
# installed yet. This allows us to break a little build loop between
# dovecot and dovecotXY.
if [ ! -e /etc/dovecot/dovecot.conf -a -e /usr/share/doc/packages/dovecot/example-config/dovecot.conf ] ; then
# install default config
echo "Did not find a /etc/dovecot/dovecot.conf. copying default configuration"
cp -na %{_docdir}/%{name}/example-config/* %{_sysconfdir}/%{name}/
# the chmod breaks the lda. lets use the more open permissions
#chmod -Rv o= %{_sysconfdir}/%{name}/
fi
%if %{with systemd}
%service_add_pre %{name}.service %{name}.socket
%endif
%preun
%if %{with systemd}
%service_del_preun %{name}.service %{name}.socket
%else
%stop_on_removal %{name}
%endif
%if %{with systemd}
%post
systemd-tmpfiles --create /usr/lib/tmpfiles.d/dovecot.conf || true
%service_add_post %{name}.service %{name}.socket
%endif
%postun
%if %{with systemd}
%service_del_postun %{name}.service
%else
%restart_on_update %{name}
%insserv_cleanup
%endif
%files
%defattr(-,root,root)
%doc %{_datadir}/doc/packages/dovecot/
# conf
%ghost %config(noreplace) /etc/dovecot/
%config(noreplace) %{_sysconfdir}/pam.d/%{name}
%config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name}
%{_sbindir}/rc%{name}
%if %{with systemd}
/usr/lib/tmpfiles.d/dovecot.conf
%{_unitdir}/dovecot.service
%{_unitdir}/dovecot.socket
%else
%{_sysconfdir}/init.d/%{name}
%endif
# setting up permissions
%if ! %{with systemd}
%dir %attr(0755,root,root) %ghost %{_var}/run/%{name}/
%dir %attr(0750,root,%{name}) %ghost %{_var}/run/%{name}/login/
%endif
%dir %attr(0750,root,root) %{_var}/lib/%{name}/
%changelog

3
dovecot.tmpfiles.d Normal file
View File

@ -0,0 +1,3 @@
# Type Path Mode UID GID Age Argument
d /var/run/dovecot/ 0755 root root - -
d /var/run/dovecot/login/ 0750 root dovecot - -