2 # - make sid-milter support:
3 # http://sourceforge.net/projects/sid-milter/
4 # http://www.sendmail.net/
5 # - fix re-entrancy of install
9 %bcond_without ldap # without LDAP support
10 %bcond_without tls # without TLS (SSL) support
11 %bcond_with pgsql # with PostgreSQL support (bluelabs)
13 Summary: A widely used Mail Transport Agent (MTA)
14 Summary(de.UTF-8): sendmail-Mail-Übertragungsagent
15 Summary(es.UTF-8): Sendmail - agente de transporte de mail
16 Summary(fr.UTF-8): Agent de transport de courrier sendmail
17 Summary(ko.UTF-8): SMTP_AUTH와 TLS를 지원하는 Mail 전송 프로그램(MTA)
18 Summary(pl.UTF-8): Sendmail - serwer poczty elektronicznej
19 Summary(pt_BR.UTF-8): Sendmail - agente de transporte de mail
20 Summary(ru.UTF-8): Почтовый транспортный агент sendmail
21 Summary(tr.UTF-8): Elektronik posta hizmetleri sunucusu
22 Summary(uk.UTF-8): Поштовий транспортний агент sendmail
27 Group: Networking/Daemons/SMTP
28 Source0: ftp://ftp.sendmail.org/pub/sendmail/%{name}.%{version}.tar.gz
29 # Source0-md5: cd3c3f7b2db60c362f07eecbebd99bf4
31 Source2: %{name}.sysconfig
32 Source3: %{name}.aliases
33 # From http://doc.phpauction.org/sendmail/examples/
34 Source4: %{name}-examples.tar.bz2
35 # Source4-md5: d00d817cd456a947a7fc6c04072a7d68
36 Source5: %{name}-etc-mail-Makefile
38 Source7: %{name}-config.m4
40 Source9: %{name}.access
41 Source10: %{name}.mailertable
42 Source11: %{name}.virtusertable
43 Source12: %{name}.domaintable
44 Source13: %{name}-smtp.pamd
45 Patch0: %{name}-makemapman.patch
46 Patch1: %{name}-smrsh-paths.patch
47 Patch2: %{name}-rmail.patch
48 Patch3: %{name}-os-paths.patch
49 Patch4: %{name}-m4path.patch
50 Patch5: %{name}-redirect.patch
51 Patch6: %{name}-hprescan-dos.patch
52 Patch7: %{name}-cyrus.patch
53 # https://blue-labs.org/software/sm-pgsql/sendmail.php
54 # https://blue-labs.org/software/sm-pgsql/bluelabs-smpgsql-8.14.3.patch.bz2
55 Patch8: bluelabs-smpgsql-8.14.3.patch
56 URL: http://www.sendmail.org/
57 BuildRequires: cyrus-sasl-devel >= 2.1.21
58 BuildRequires: db-devel >= 5.0
59 BuildRequires: libnsl-devel
62 %{?with_ldap:BuildRequires: openldap-devel >= 2.3.0}
63 %{?with_tls:BuildRequires: openssl-devel >= 0.9.8}
64 %{?with_pgsql:BuildRequires: postgresql-devel >= 8.1}
65 BuildRequires: rpmbuild(macros) >= 1.310
66 BuildRequires: sed >= 4.0
68 BuildRequires: sparc32
71 Requires(post): textutils
72 Requires(post,preun): /sbin/chkconfig
73 Requires(post,preun): rc-scripts >= 0.4.0.20
74 Requires(postun): /usr/sbin/groupdel
75 Requires(postun): /usr/sbin/userdel
76 Requires(pre): /bin/id
77 Requires(pre): /usr/bin/getgid
78 Requires(pre): /usr/sbin/groupadd
79 Requires(pre): /usr/sbin/useradd
80 Requires: db >= 4.1.25
82 Requires: pam >= 0.79.0
84 Provides: group(smmsp)
87 Obsoletes: sendmail-cf
88 Obsoletes: sendmail-doc
90 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
92 %define _sysconfdir /etc/mail
93 %define specflags -fPIC
96 The Sendmail program is a very widely used Mail Transport Agent (MTA).
97 MTAs send mail from one machine to another. Sendmail is not a client
98 program, which you use to read your e-mail. Sendmail is a
99 behind-the-scenes program which actually moves your e-mail over
100 networks or the Internet to where you want it to go.
102 %description -l de.UTF-8
103 Sendmail überträgt Mails zwischen Rechnern. Es implementiert eine
104 allgemeine Mail-Routing-Funktion über das Netzwerk mit Aliasing und
105 Weiterleiten von Nachrichten, automatischem Routing an
106 Netzwerk-Gateways und flexible Konfiguration. Wenn Sie E-Mails über
107 das Internet senden und empfangen möchten, brauchen Sie sendmail.
109 %description -l es.UTF-8
110 sendmail es un agente de transporte de correo electrónico, que mueve
111 mensajes entre máquinas. Implementa facilidades de internetwork y
112 rutado, caracterizando cambio de nombres (aliases) y envío a nuevas
113 direcciones ( forwarding ), rutado automático para gateways de la red
114 y configuración flexible. Necesitarás del sendmail si deseas enviar y
115 recibir mensajes a través de la Internet.
117 %description -l fr.UTF-8
118 Sendmail est un agent de transport de courrier, qui est le programme
119 transférent le courrier d'une machine à l'autre. Sendmail implémente
120 une facilité générale de routage de courrier entre les réseaux, permet
121 l'"aliasing" et le "forwarding", un routage automatique sur les
122 passerelles du réseau, et une configuration flexible.
124 %description -l ko.UTF-8
125 Sendamil은 매우 널리 사용되는 Mail 전송 프로그램이다(MTA). Mail 전송
126 프로그램들(MTA)은 어떠한 machine에서 다른 machine으로 메일을 보내며
127 Sendmail은 e-mail을 읽기위해 사용하는 client program은 아니다.
128 Sendamil은 원하는 곳으로 Internet이나 Network를 통해 e-mail을 보내는
129 역할을 하는 backgrond에서 작업을 하는 프로그램이다.
131 %description -l pl.UTF-8
132 Sendmail jest programem umożliwiającym wymianę poczty elektronicznej
133 między komputerami w sieci (MTA). Zajmuje się przekazywaniem poczty
134 elektronicznej między bramkami pocztowymi i dostarczaniem przesyłek na
135 konta docelowe. Bardzo dobrze obsługuje aliasy pocztowe a jego
136 dodatkowym atutem jest prosta konfiguracja. Dzięki rozbudowanym
137 możliwościom konfiguracyjnym jest w stanie dostarczać przesyłki za
138 pośrednictwem protokołów: SMTP, ESMTP, UUCP, X.400 i innych.
140 %description -l pt_BR.UTF-8
141 O sendmail é um agente de transporte de correio eletrônico, que move
142 mensagens entre máquinas. Ele implementa facilidades de internetwork e
143 roteamento, caracterizando troca de nomes (aliases) e remessa a novos
144 endereços ( forwarding ), roteamento automático para gateways da rede
145 e configuração flexível.
147 %description -l ru.UTF-8
148 Sendmail - это Mail Transport Agent, программа пересылающая почту с
149 машины на машину. Sendmail предоставляет стандартные средства
150 межсетевой маршрутизации почты, aliasing, forwarding, автоматическую
151 маршрутизацию для сетевых шлюзов и гибкий механизм конфигурации.
153 %description -l tr.UTF-8
154 Sendmail, bir mektubu bir makineden diğerine taşır. Pek çok davranışı
155 ayarlanabilir. Internet üzerinden mektup almak veya göndermek
156 istiyorsanız bu pakete gereksiniminiz olacaktır.
158 %description -l uk.UTF-8
159 Sendmail - це Mail Transport Agent, програма що пересилає пошту з
160 машини на машину. Sendmail надає стандартні засоби міжмережевої
161 маршрутизації пошти, aliasing, forwarding, автоматичну маршрутизацію
162 для мережевих шлюзів та гнучкий механізм маршрутизації.
164 %package -n libmilter-devel
165 Summary: Header files and static libmilter library
166 Summary(pl.UTF-8): Pliki nagłówkowe i statyczna biblioteka libmilter
167 Group: Development/Libraries
168 Provides: sendmail-devel
169 Obsoletes: sendmail-devel
171 %description -n libmilter-devel
172 Header files and static libmilter library.
174 %description -n libmilter-devel -l pl.UTF-8
175 Pliki nagłówkowe i statyczna biblioteka libmilter.
187 %{?with_pgsql:%patch8 -p1}
189 sed -e 's|@@PATH@@|\.\.|' < %{SOURCE6} > cf/cf/pld.mc
191 cp -p %{SOURCE7} config.m4
194 echo "define(\`confLIBSEARCHPATH', \`/%{_lib} %{_prefix}/%{_lib}')" >> config.m4
195 echo "define(\`confCC', \`%{__cc}')" >> config.m4
196 %ifarch sparc sparc64
197 echo "define(\`confOPTIMIZE', \`%{rpmcflags} -DUSE_VENDOR_CF_PATH=1 -DSM_CONF_SEM=0 -DNETINET6')" >> config.m4
199 echo "define(\`confOPTIMIZE', \`%{rpmcflags} -DUSE_VENDOR_CF_PATH=1 -DNETINET6')" >> config.m4
201 echo "define(\`confLDOPTS', \`%{rpmldflags}')" >> config.m4
203 echo "APPENDDEF(\`confMAPDEF', \`-DLDAPMAP')" >> config.m4
204 echo "APPENDDEF(\`confLIBS', \`-lldap -llber')" >> config.m4
207 echo "APPENDDEF(\`confMAPDEF', \`-DPGSQLMAP')" >> config.m4
208 echo "APPENDDEF(\`confLIBS', \`-lpq -lresolv -lcrypto')" >> config.m4
211 echo "APPENDDEF(\`confENVDEF', \`-DSTARTTLS')" >> config.m4
212 echo "APPENDDEF(\`confENVDEF', \`-D_FFR_TLS_1')" >> config.m4
213 echo "APPENDDEF(\`confLIBS', \`-lssl -lcrypto')" >> config.m4
215 echo "APPENDDEF(\`confENVDEF', \`-DHASFLOCK')" >> config.m4
218 %define Build sparc32 sh Build
220 %define Build sh Build
223 cd sendmail && %{Build} -f ../config.m4
224 cd ../mailstats && %{Build} -f ../config.m4
225 cd ../rmail && %{Build} -f ../config.m4
226 cd ../makemap && %{Build} -f ../config.m4
227 cd ../praliases && %{Build} -f ../config.m4
228 cd ../smrsh && %{Build} -f ../config.m4
229 cd ../libmilter && %{Build} -f ../config.m4
234 rm -rf $RPM_BUILD_ROOT
235 install -d $RPM_BUILD_ROOT%{_mandir}/man{1,5,8} \
236 $RPM_BUILD_ROOT/etc/{rc.d/init.d,pam.d,monit,sysconfig,sasl,smrsh,security} \
237 $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},/usr/lib} \
238 $RPM_BUILD_ROOT{%{_datadir}/sendmail-cf,%{_libdir}} \
239 $RPM_BUILD_ROOT/var/{log,spool/mqueue} \
240 $RPM_BUILD_ROOT{%{_sysconfdir},%{_includedir}}
242 OBJDIR=obj.$(uname -s).$(uname -r).$(\
250 SMINSTOPT="DESTDIR=$RPM_BUILD_ROOT SBINOWN=$IDNU SBINGRP=$IDNG \
251 UBINOWN=$IDNU UBINGRP=$IDNG MANOWN=$IDNU MANGRP=$IDNG \
252 CFOWN=$IDNU CFGRP=$IDNG MSPQOWN=$IDNU GBINGRP=$IDNG GBINOWN=$IDNU \
253 BINOWN=$IDNU BINGRP=$IDNG LIBOWN=$IDNU LIBGRP=$IDNG INCOWN=$IDNU INCGRP=$IDNG"
255 %{__make} -C $OBJDIR/sendmail install \
257 %{__make} -C $OBJDIR/mailstats install \
259 %{__make} -C $OBJDIR/praliases install \
261 %{__make} -C $OBJDIR/rmail force-install \
263 %{__make} -C $OBJDIR/makemap install \
265 %{__make} -C $OBJDIR/smrsh install \
267 %{__make} -C $OBJDIR/libmilter install \
271 ln -sf %{_sbindir}/makemap $RPM_BUILD_ROOT%{_bindir}/makemap
273 # install the cf files
275 %{__rm} cf/{Build,Makefile}
276 find . -name '*~' -o -name '*.orig' | xargs -r %{__rm}
277 cp -a * $RPM_BUILD_ROOT%{_datadir}/sendmail-cf
281 cp -p cf/cf/pld.cf $RPM_BUILD_ROOT%{_sysconfdir}/sendmail.cf
282 sed -e 's|@@PATH@@|%{_datadir}/sendmail-cf|' < %{SOURCE6} \
283 > $RPM_BUILD_ROOT%{_sysconfdir}/sendmail.mc
285 # submit.mc (submit.cf is installed automatically)
286 cp -p cf/cf/submit.mc $RPM_BUILD_ROOT%{_sysconfdir}
288 echo "# local-host-names - include all aliases for your machine here." \
289 > $RPM_BUILD_ROOT%{_sysconfdir}/local-host-names
291 ln -sf %{_sbindir}/sendmail $RPM_BUILD_ROOT/usr/lib/sendmail
294 for f in hoststat mailq newaliases purgestat; do
295 ln -sf %{_sbindir}/sendmail $RPM_BUILD_ROOT%{_bindir}/${f}
298 for map in virtusertable access domaintable mailertable; do
299 touch $RPM_BUILD_ROOT%{_sysconfdir}/${map}
300 $RPM_BUILD_ROOT%{_sbindir}/makemap -C $RPM_BUILD_ROOT%{_sysconfdir}/sendmail.cf hash \
301 $RPM_BUILD_ROOT%{_sysconfdir}/${map}.db < $RPM_BUILD_ROOT%{_sysconfdir}/${map}
304 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/aliases
305 $RPM_BUILD_ROOT%{_sbindir}/makemap -C $RPM_BUILD_ROOT%{_sysconfdir}/sendmail.cf hash \
306 $RPM_BUILD_ROOT%{_sysconfdir}/aliases.db < %{SOURCE3}
308 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/sendmail
309 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/sendmail
310 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/Makefile
311 cp -p %{SOURCE8} $RPM_BUILD_ROOT/etc/sasl/Sendmail.conf
312 cp -p %{SOURCE13} $RPM_BUILD_ROOT/etc/pam.d/smtp
313 cp -p %{SOURCE9} $RPM_BUILD_ROOT%{_sysconfdir}/access
314 cp -p %{SOURCE10} $RPM_BUILD_ROOT%{_sysconfdir}/mailertable
315 cp -p %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/virtusertable
316 cp -p %{SOURCE12} $RPM_BUILD_ROOT%{_sysconfdir}/domaintable
318 touch $RPM_BUILD_ROOT/etc/security/blacklist.smtp
320 %{__mv} smrsh/README README.smrsh
321 %{__mv} cf/README README.cf
322 %{__mv} doc/op/op.me .
324 bzip2 -dc %{SOURCE4} | tar xf -
326 %{__rm} $RPM_BUILD_ROOT%{_datadir}/sendmail-cf{,/cf}/README
328 %{__rm} $RPM_BUILD_ROOT%{_datadir}/sendmail-cf/cf/cs-{hpux*,osf1,solaris*,sunos*,ultrix*}.mc
329 %{__rm} $RPM_BUILD_ROOT%{_datadir}/sendmail-cf/cf/generic-{bsd*,hpux*,mpeix,nextstep*,osf1,solaris,sunos*,ultrix*}.{cf,mc}
330 %{__rm} $RPM_BUILD_ROOT%{_datadir}/sendmail-cf/cf/s2k-{osf1,ultrix*}.mc
331 %{__rm} $RPM_BUILD_ROOT%{_datadir}/sendmail-cf/ostype/{a-ux,aix*,altos,amdahl-uts,bsd*,darwin,dgux,domainos,dragonfly,dynix*,freebsd*,gnu,hpux*,irix*,isc*,maxion,mklinux,mpeix,nextstep,openbsd,osf1,powerux,ptx2,qnx,riscos*,sco*,sinix,solaris*,sunos*,svr4,ultrix*,unicos*,unixware*,unknown,uxpds}.m4
333 %{__rm} $RPM_BUILD_ROOT%{_datadir}/sendmail-cf/cf/{chez.cs,huginn.cs,knecht,mail.cs,mail.eecs,mailspool.cs,python.cs,ucbarpa,ucbvax,vangogh.cs}.mc
334 %{__rm} $RPM_BUILD_ROOT%{_datadir}/sendmail-cf/domain/{Berkeley.EDU,CS.Berkeley.EDU,EECS.Berkeley.EDU,S2K.Berkeley.EDU,berkeley-only}.m4
335 %{__rm} $RPM_BUILD_ROOT%{_datadir}/sendmail-cf/hack/cssubdomain.m4
337 %{__rm} $RPM_BUILD_ROOT%{_datadir}/sendmail-cf/cf/*.cf
338 # MIB (package as mibs-*?)
339 %{__rm} $RPM_BUILD_ROOT%{_datadir}/sendmail-cf/sendmail.schema
341 # for perl-Sendmail-Milter
342 install $OBJDIR/libsm/libsm.a $OBJDIR/libsmutil/libsmutil.a \
343 $RPM_BUILD_ROOT%{_libdir}
346 rm -rf $RPM_BUILD_ROOT
349 %groupadd -g 25 smmsp
350 %useradd -u 25 -d /var/spool/clientqueue -s /bin/false -c "Sendmail Message Submission Program" -g smmsp smmsp
355 # Convert old format to new
357 if [ -f /etc/mail/deny ] ; then
358 cat /etc/mail/deny | \
359 awk 'BEGIN{ print "# Entries from obsoleted /etc/mail/deny"} \
360 {print $1" REJECT"}' >> /etc/mail/access
361 mv -f /etc/mail/deny /etc/mail/deny.rpmorig
363 for oldfile in relay_allow ip_allow name_allow ; do
364 if [ -f /etc/mail/$oldfile ] ; then
365 cat /etc/mail/$oldfile | \
366 awk "BEGIN { print \"# Entries from obsoleted /etc/mail/$oldfile\" ;} \
367 { print $1\" RELAY\" }" >> /etc/mail/access
368 mv -f /etc/mail/$oldfile /etc/mail/$oldfile.rpmorig
373 # Oops, these files moved
375 if [ -f /etc/sendmail.cw ] ; then
376 cat /etc/sendmail.cw | \
377 awk 'BEGIN { print "# Entries from obsoleted /etc/sendmail.cw" ;} \
378 { print $1 }' >> /etc/mail/local-host-names
379 mv -f /etc/sendmail.cw /etc/sendmail.cw.rpmorig
382 # Rebuild maps (next reboot will rebuild also)
384 { /usr/bin/newaliases
385 for map in virtusertable access domaintable mailertable; do
386 if [ -f /etc/mail/${map} ] ; then
387 /usr/bin/makemap hash /etc/mail/${map} < /etc/mail/${map}
393 /sbin/chkconfig --add sendmail
394 %service sendmail restart "sendmail daemon"
397 if [ "$1" = "0" ]; then
398 %service sendmail stop
399 /sbin/chkconfig --del sendmail
403 if [ "$1" = "0" ]; then
408 # removal of compatibility links
409 %triggerpostun -- sendmail < 8.10.1
410 /sbin/chkconfig --add sendmail
413 %defattr(644,root,root,755)
414 %doc FAQ KNOWNBUGS README* op.me RELEASE_NOTES examples/
415 %attr(755,root,root) %{_sbindir}/mailstats
416 %attr(755,root,root) %{_sbindir}/praliases
417 %attr(755,root,root) %{_bindir}/hoststat
418 %attr(755,root,root) %{_bindir}/purgestat
419 %attr(755,root,root) %{_bindir}/rmail
420 %attr(755,root,root) %{_bindir}/makemap
421 %attr(755,root,root) %{_sbindir}/makemap
422 %attr(2755,root,smmsp) %{_sbindir}/sendmail
423 %attr(755,root,root) %{_bindir}/newaliases
424 %attr(755,root,root) %{_bindir}/mailq
425 %attr(755,root,root) %{_sbindir}/smrsh
428 %{_mandir}/man1/mailq.1*
429 %{_mandir}/man1/newaliases.1*
430 %{_mandir}/man5/aliases.5*
431 %{_mandir}/man8/mailstats.8*
432 %{_mandir}/man8/makemap.8*
433 %{_mandir}/man8/praliases.8*
434 %{_mandir}/man8/rmail.8*
435 %{_mandir}/man8/sendmail.8*
436 %{_mandir}/man8/smrsh.8*
441 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/sendmail.cf
442 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/sendmail.mc
443 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/submit.cf
444 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/submit.mc
445 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/local-host-names
446 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/aliases
447 %attr(644,root,mail) %ghost %{_sysconfdir}/aliases.db
448 %attr(770,root,smmsp) %dir /var/spool/clientmqueue
449 %attr(750,root,mail) %dir /var/spool/mqueue
451 %config %{_sysconfdir}/Makefile
452 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/access
453 %ghost %{_sysconfdir}/access.db
454 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/domaintable
455 %ghost %{_sysconfdir}/domaintable.db
456 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mailertable
457 %ghost %{_sysconfdir}/mailertable.db
458 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/virtusertable
459 %ghost %{_sysconfdir}/virtusertable.db
460 %config(noreplace) %{_sysconfdir}/helpfile
462 %attr(754,root,root) /etc/rc.d/init.d/sendmail
463 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/sendmail
464 %config(noreplace) %verify(not md5 mtime size) /etc/sasl/Sendmail.conf
465 %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/smtp
466 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.smtp
468 %dir %{_datadir}/sendmail-cf
469 %dir %{_datadir}/sendmail-cf/cf
470 %{_datadir}/sendmail-cf/cf/clientproto.mc
471 %{_datadir}/sendmail-cf/cf/cyrusproto.mc
472 %{_datadir}/sendmail-cf/cf/generic-linux.mc
473 %{_datadir}/sendmail-cf/cf/pld.mc
474 %{_datadir}/sendmail-cf/cf/submit.mc
475 %{_datadir}/sendmail-cf/cf/tcpproto.mc
476 %{_datadir}/sendmail-cf/cf/uucpproto.mc
477 %dir %{_datadir}/sendmail-cf/domain
478 %{_datadir}/sendmail-cf/domain/generic.m4
479 %{_datadir}/sendmail-cf/feature
480 %{_datadir}/sendmail-cf/hack
481 %{_datadir}/sendmail-cf/m4
482 %{_datadir}/sendmail-cf/mailer
483 %dir %{_datadir}/sendmail-cf/ostype
484 %{_datadir}/sendmail-cf/ostype/linux.m4
485 %dir %{_datadir}/sendmail-cf/sh
486 %{_datadir}/sendmail-cf/sh/makeinfo.sh
487 %{_datadir}/sendmail-cf/siteconfig
489 %files -n libmilter-devel
490 %defattr(644,root,root,755)
491 %{_libdir}/libmilter.a
493 %{_libdir}/libsmutil.a
494 %{_includedir}/libmilter