2 # - missing service restart
3 # - check locale settings in %post
5 %bcond_without whoson # build without WHOSON support
6 %bcond_without ldap # build without LDAP support
7 %bcond_without gdbm # build without GDBM support
9 Summary: Secure Mailer for Extreme Performance Demands
10 Summary(pl.UTF-8): Bezpieczny MTA dla Wymagających Ekstremalnej Wydajności
15 Group: Networking/Daemons
16 Source0: ftp://ftp.funet.fi/pub/unix/mail/zmailer/src/%{name}-%{version}.tar.gz
17 # Source0-md5: abe451575234ac5ce79d9b950b150986
18 Source1: %{name}-pl.txt
19 Source2: forms-pl-0.4.tar.gz
20 # Source2-md5: c4ca963cd941e3ac533860d7d3d9f4b1
21 Source3: %{name}.logrotate
22 Patch0: %{name}-config.diff
23 Patch1: %{name}-glibc.patch
24 URL: http://www.zmailer.org/
25 BuildRequires: autoconf
26 BuildRequires: automake
27 BuildRequires: db-devel
29 %{?with_gdbm:BuildRequires: gdbm-devel}
30 BuildRequires: libwrap-devel
31 %{?with_ldap:BuildRequires: openldap-devel >= 2.4.6}
32 BuildRequires: openssl-devel >= 0.9.7d
33 BuildRequires: pam-devel
34 BuildRequires: perl-devel
35 BuildRequires: rpmbuild(macros) >= 1.268
36 %{?with_whoson:BuildRequires: whoson-devel}
37 Requires(post): fileutils
39 Requires(post): net-tools
40 Requires(post): textutils
41 Requires(post,preun): /sbin/chkconfig
42 Requires(postun): /usr/sbin/groupdel
45 Requires: logrotate >= 2.4
47 %{?with_whoson:Requires: whoson >= 1.08}
48 Provides: group(zmailer)
51 Conflicts: logrotate < 3.7-4
53 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56 This is a package that implements an internet message transfer agent
57 called ZMailer. It is intended for gateways or mail servers or other
58 large site environments that have extreme demands on the abilities of
59 the mailer. It was motivated by the problems of the Sendmail design in
60 such situations. Zmailer is one of the mailers able to deal with huge
61 quantities of mail and is more efficient any other mailer, qmail
62 included. It supports IPv6, WHOSON, SSL and TLS protocol.
64 %description -l pl.UTF-8
65 Ten pakiet zawiera implementację agenta transportu wiadomości
66 internetowych o nazwie ZMailer. ZMailer przeznaczony jest dla bramek,
67 serwerów poczty lub innych środowisk wymagających niezwykłych
68 możliwości od mailera. Motywacją dla ZMailera były problemy z
69 Sendmailem w trudnych sytuacjach. ZMailer jest jednym z tych mailerów,
70 które potrafią dać sobie radę z ogromną ilością poczty. Ponadto
71 ZMailer jest bardziej wydajny od innych mailerów włączając w to
72 qmaila. Kolejną zaletą jest wsparcie dla protokołu IPv6, WHOSON, SSL
76 Summary: Static library and header file for zmailer
77 Summary(pl.UTF-8): Plik nagłówkowy i biblioteka statyczna dla zmailera
78 Group: Development/Libraries
79 Requires: %{name} = %{version}-%{release}
82 This is ZMailer's development package. It includes static library and
85 %description devel -l pl.UTF-8
86 To jest pakiet dla developerów. Zawiera plik nagłówkowy i bibliotekę
95 cp -f /usr/share/automake/config.* .
98 --with-zconfig=%{_sysconfdir}/mail/zmailer.conf \
99 --with-postoffice=/var/spool/postoffice \
100 --with-rmailpath=%{_bindir}/rmail \
101 --with-nntpserver=news \
102 --with-system-malloc \
103 --with-mailshare=%{_sysconfdir}/mail \
104 --with-mailbin=%{_libdir}/zmailer \
105 --with-mailvar=%{_sysconfdir}/mail \
107 %{?with_whoson:--with-whoson} \
108 %{?with_ldap:--with-ldap-prefix} \
109 --with-openssl-prexix=%{_prefix} \
110 --with-tcp-wrappers \
112 --with-mailbox=/var/mail
114 # --with-yp-lib='-lyp'
115 # --prefix=%{_libdir}/zmailer \
119 COPTS="%{rpmcflags} -w"
122 rm -rf $RPM_BUILD_ROOT
123 install -d $RPM_BUILD_ROOT%{_mandir}/man{1,3,5,8} \
124 $RPM_BUILD_ROOT%{_sysconfdir}/{cron.d,logrotate.d,rc.d/init.d} \
125 $RPM_BUILD_ROOT{/var/mail,%{_sbindir}} \
126 $RPM_BUILD_ROOT/var/log/archive/mail
130 DESTDIR=$RPM_BUILD_ROOT \
131 MAILVAR=$RPM_BUILD_ROOT%{_sysconfdir}/mail \
132 MAILSHARE=$RPM_BUILD_ROOT%{_sysconfdir}/mail \
133 libdir=$RPM_BUILD_ROOT%{_libdir} \
134 includedir=$RPM_BUILD_ROOT%{_includedir}
136 install contrib/zmailcheck $RPM_BUILD_ROOT%{_libdir}/zmailer/zmailcheck
137 install utils/zmailer.init.sh $RPM_BUILD_ROOT/etc/rc.d/init.d/zmailer
139 > $RPM_BUILD_ROOT%{_sysconfdir}/mail/mailname
142 ln -fs zmailer/sendmail $RPM_BUILD_ROOT%{_libdir}/sendmail
143 ln -fs ../lib/zmailer/vacation.sh $RPM_BUILD_ROOT%{_bindir}/vacation
144 ln -fs ../lib/zmailer/mailq $RPM_BUILD_ROOT%{_bindir}/mailq
145 ln -fs ../lib/zmailer/rmail $RPM_BUILD_ROOT%{_bindir}/rmail
146 ln -fs ../lib/zmailer/newaliases $RPM_BUILD_ROOT%{_bindir}/newaliases
147 ln -fs ../lib/zmailer/zmailer $RPM_BUILD_ROOT%{_sbindir}/zmailer
148 ln -fs ../lib/zmailer/sendmail $RPM_BUILD_ROOT%{_sbindir}/sendmail
150 # Install manual pages
151 %{__make} -C man install \
153 MANDIR=$RPM_BUILD_ROOT%{_mandir}
155 # To avoid conflict with INN
156 mv -f $RPM_BUILD_ROOT%{_mandir}/man8/sm.8zm $RPM_BUILD_ROOT%{_mandir}/man8/sm-zmailer.8zm
159 # Install Polish/English forms
161 cp -f forms/* $RPM_BUILD_ROOT%{_sysconfdir}/mail/forms/proto
162 install vacation.msg $RPM_BUILD_ROOT%{_sysconfdir}/mail
164 # Install proto files
165 cd $RPM_BUILD_ROOT%{_sysconfdir}/mail/proto
166 for x in *; do cp -f $x ..; done
167 cd $RPM_BUILD_ROOT%{_sysconfdir}/mail/forms/proto
168 for x in *; do cp -f $x ..; done
169 cd $RPM_BUILD_ROOT%{_sysconfdir}/mail/db/proto
170 for x in *; do cp -f $x ..; done
171 cd $RPM_BUILD_ROOT%{_sysconfdir}/mail/cf/proto
172 for x in *; do cp -f $x ..; done
173 cd $RPM_BUILD_ROOT%{_sysconfdir}/mail
174 cp -f ./cf/SMTP+UUCP.cf router.cf
178 > $RPM_BUILD_ROOT%{_sysconfdir}/mail/aliases
180 # Remove unnecesary proto and bak files
181 rm -rf `find $RPM_BUILD_ROOT -name proto`
182 rm -rf `find $RPM_BUILD_ROOT -name bak`
184 # Remove other trashes
185 rm -r $RPM_BUILD_ROOT%{_sysconfdir}/mail/guides/
186 rm $RPM_BUILD_ROOT%{perl_archlib}/perllocal.pod
187 rm $RPM_BUILD_ROOT%{perl_sitearch}/auto/ZMailer/mailq/.packlist
188 rm $RPM_BUILD_ROOT%{_sysconfdir}/mail/ChangeLog
189 rm $RPM_BUILD_ROOT%{_prefix}/local/man/man3/ZMailer::mailq.3pm
190 rm $RPM_BUILD_ROOT%{perl_sitelib}/ZMailer/mailq.pm
192 # Install another files
193 cat << EOF > $RPM_BUILD_ROOT/etc/cron.d/zmailer
194 # Resubmit deferred messages
195 28 */1 * * * root ! %{_libdir}/zmailer/zmailer resubmit >/dev/null
196 # Cleanout public and postman directories
197 7 4 * * * root ! %{_libdir}/zmailer/zmailer cleanup >/dev/null
198 # Check if services still work
199 11 6,12,18,0 * * * root ! %{_libdir}/zmailer/zmailcheck
202 install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/zmailer
204 # postoffice tree (as created by proto/post-install.sh):
205 install -d $RPM_BUILD_ROOT/var/spool/postoffice/{deferred,freezer,postman,public}
206 for f1 in A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ; do
207 install -d $RPM_BUILD_ROOT/var/spool/postoffice/{TLSsrvrcache,TLSclntcache,router}/$f1
208 for f2 in A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ; do
209 install -d $RPM_BUILD_ROOT/var/spool/postoffice/{queue,transport}/$f1/$f2
216 rm -rf $RPM_BUILD_ROOT
220 /sbin/chkconfig --add zmailer
222 if [ "$1" = 1 -a -x /bin/hostname ]; then
223 hostname --fqdn > /etc/mail/mailname
226 if [ -f /etc/mail/router.fc ]; then
227 rm -f /etc/mail/router.fc
230 # Gymnastics to convice zmailer to use /etc/mail/aliases
231 # or provide /etc/mail/aliases it if not found.
232 if [ ! -L /etc/mail/db/aliases ]; then
233 if [ -f /etc/mail/aliases ]; then
234 echo "Generating Symlink to use /etc/mail/aliases for aliasing"
235 rm -f /etc/mail/db/aliases || echo "Strange nothing at /etc/mail/db/aliases. Don't worry."
236 # FIXME! check locale here
237 # echo "Dziwnie puste /etc/mail/db/aliases. Nie martw sie."
239 echo "Installing new /etc/mail/aliases from zmailer sample"
240 mv -f /etc/mail/db/aliases /etc/aliases
242 ln -sf ../aliases /etc/mail/db/aliases
245 # Scan for Mandatory entries in /etc/aliases
246 # postoffice MAILER-DAEMON postmast nobody and other users
247 # otherwise bad things (tm) result.
249 if ! grep -q "^hostmaster:" /etc/mail/aliases; then
250 echo "Adding Entry for hostmaster in /etc/mail/aliases"
251 echo "hostmaster: root" >>/etc/mail/aliases
254 for i in postmaster postoffice MAILER-DAEMON postmast nobody webmaster administrator \
255 ftpmaster newsmaster w3cache squid news proxy abuse ircd; do
256 if ! grep -q "^$i:" /etc/mail/aliases; then
257 echo "Adding Entry for $i in /etc/mail/aliases"
258 echo "$i: hostmaster" >>/etc/mail/aliases
263 for x in `hostname --fqdn` `hostname --domain` `hostname --yp`; do
264 if [ -n $x ] && ! grep -q ^$x /etc/mail/db/localnames; then
265 echo "$x `hostname --fqdn`|"
267 done | tr -d '\n' | tr -s '|' '\n' | sort >> /etc/mail/db/localnames
270 %{_libdir}/zmailer/zmailer newdb
271 %{_libdir}/zmailer/policy-builder.sh -n
274 if [ "$1" = "0" ]; then
275 %service zmailer stop
276 /sbin/chkconfig --del zmailer
277 rm -f /var/spool/postoffice/.pid.*
281 %groupadd -g 47 zmailer
282 for u in root petidomo uucp daemon news; do
283 if [ -z "`/bin/id -u $u 2>/dev/null`" ]; then
286 GROUPS=`/bin/id -n -G $u | sed 's/ /,/g'`
287 if [ -z "`echo $GROUPS | grep '\(^\|,\)zmailer\($\|,\)'`" ]; then
288 /usr/sbin/usermod -G "${GROUPS},zmailer" $u 1>&2 || :
293 if [ "$1" = "0" ]; then
298 %defattr(644,root,root,755)
299 %doc ChangeLog Overview README* TODO doc/toplevel-domains
300 %doc doc/manual/FAQ doc/design/zmog.ps zmailer-pl.txt doc/guides
301 %doc utils/usenet/usenet.sh utils/mail2news utils/mailgateway
302 %dir %{_sysconfdir}/mail
303 %config(noreplace) %{_sysconfdir}/mail/cf
304 %config(noreplace) %{_sysconfdir}/mail/forms
305 %config(noreplace) %{_sysconfdir}/mail/fqlists
307 %defattr(644,root,root,3755)
308 %config(noreplace) %{_sysconfdir}/mail/db
310 %defattr(644,root,root,2755)
311 %config(noreplace) %{_sysconfdir}/mail/lists
313 %defattr(644,root,root,755)
314 %config %{_sysconfdir}/mail/*.*
315 %{_sysconfdir}/mail/mailname
316 %config(noreplace) %{_sysconfdir}/mail/aliases
318 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/zmailer
319 %attr(640,root,root) /etc/cron.d/zmailer
321 %attr(754,root,root) /etc/rc.d/init.d/zmailer
323 %attr(755,root,root) %{_bindir}/*
324 %attr(755,root,root) %{_sbindir}/*
325 %attr(755,root,root) %{_libdir}/sendmail
326 %attr(755,root,root) %{_libdir}/zmailer
328 %{_mandir}/man[158]/*
329 %attr(755,root,root) %dir /var/spool/postoffice
330 %attr(750,root,root) %dir /var/spool/postoffice/deferred
331 %attr(750,root,root) %dir /var/spool/postoffice/freezer
332 %attr(750,root,root) %dir /var/spool/postoffice/postman
333 %attr(750,root,root) %dir /var/spool/postoffice/queue
334 %attr(1777,root,root) %dir /var/spool/postoffice/public
335 %attr(1777,root,root) %dir /var/spool/postoffice/router
336 %attr(755,root,root) %dir /var/spool/postoffice/transport
337 %attr(755,root,root) %dir /var/spool/postoffice/transport/*
338 %attr(755,root,root) %dir /var/spool/postoffice/transport/*/*
339 %attr(755,root,root) %dir /var/spool/postoffice/queue/*
340 %attr(755,root,root) %dir /var/spool/postoffice/queue/*/*
341 %attr(700,root,root) %dir /var/spool/postoffice/TLSsrvrcache
342 %attr(700,root,root) %dir /var/spool/postoffice/TLSsrvrcache/*
343 %attr(700,root,root) %dir /var/spool/postoffice/TLSclntcache
344 %attr(700,root,root) %dir /var/spool/postoffice/TLSclntcache/*
345 %attr(750,root,root) %dir /var/log/mail
346 %attr(750,root,root) %dir /var/log/archive/mail
349 %defattr(644,root,root,755)
351 %{_libdir}/libzmailer.a
352 %{_includedir}/zmailer.h