# # # $Id: indimail-mta.spec.in,v 1.406 2024-07-20 09:26:30+05:30 Cprogrammer Exp mbhangui $ %undefine _missing_build_ids_terminate_build %global _unpackaged_files_terminate_build 1 %if %{defined _project} # define if building on openSUSE build service %global build_on_obs 1 %else %define _project local %global build_on_obs 0 %global _hardened_build 1 %endif %if %{defined nodebug} %global debug_package %{nil} %endif %global qmaildir /var/indimail %global _prefix /usr %global libexecdir /usr/libexec/indimail %global shareddir /usr/share/indimail %global mandir /usr/share/man %global qsysconfdir /etc/indimail %global logdir /var/log/svc %global servicedir /service %global plugindir %{_prefix}/lib/indimail/plugins %global tcpserver_plugin 1 %global see_base For a description of IndiMail visit https://github.com/indimail/indimail-mta %global nodksignatures 0 %global notlsarr 0 %global qcount 5 %global qbase %{qmaildir}/queue %global dkimkeyfn default %if %build_on_obs == 1 %global packager Manvendra Bhangui > %endif %if 0%{?suse_version} %global dist suse %global disttag suse %endif %if 0%{?fedora_version} %global dist %{?dist} %global disttag fedora %endif Summary: A Flexible & Highly Configurable MTA Name: indimail-mta Version: 3.0.9 Release: 1.1%{?dist} ## user/group management # Note: it is not necessary to assign 555 for uid, gid. The package will use any id assigned to username, groupname # at runtime %global uid 555 %global gid 555 %global username indimail %global groupname indimail # Note: 999 indimail-mta does not require any specific values for uids/gids. 999 is just # for rpmlint to shut up and stop complaining Provides: user(%username) = %uid Provides: user(alias) > 999 Provides: user(qmaild) > 999 Provides: user(qmailp) > 999 Provides: user(qmailq) > 999 Provides: user(qmailr) > 999 Provides: user(qmails) > 999 Provides: user(qscand) > 999 Provides: group(%groupname) = %gid Provides: group(qmail) > 999 Provides: group(qscand) > 999 Provides: group(qcerts) > 999 %if %build_on_obs == 0 Requires(pre): shadow-utils Requires(postun): shadow-utils %endif %if %{defined suse_version} || %{defined sles_version} Requires(post): update-alternatives Requires(postun): update-alternatives %endif %if %{defined fedora_version} Requires(post): alternatives Requires(postun): alternatives %endif %if %build_on_obs == 1 License: GPL-3.0+ %else License: GPLv3 %endif %if %{undefined suse_version} && %{undefined sles_version} Group: System Environment/Base %else Group: Productivity/Networking/Email/Servers %endif Source0: http://downloads.sourceforge.net/indimail/%{name}-%{version}.tar.gz Source1: http://downloads.sourceforge.net/indimail/%{name}-rpmlintrc %if %{defined suse_version} && %{defined sles_version} Source2: http://downloads.sourceforge.net/indimail/%{name}-permissions.easy Source3: http://downloads.sourceforge.net/indimail/%{name}-permissions.secure Source4: http://downloads.sourceforge.net/indimail/%{name}-permissions.paranoid %endif URL: https://github.com/indimail/indimail-mta AutoReq: Yes Conflicts: indimail-mini Conflicts: qmta Conflicts: indimail < 2.5 Conflicts: indimail-mta < 2.0 Obsoletes: indimail-mta < 2.0 BuildRequires: gcc gcc-c++ make autoconf automake libtool pkgconfig BuildRequires: sed findutils diffutils gzip coreutils grep BuildRequires: glibc glibc-devel binutils libidn2-devel %if 0%{?rhel_version} != 700 && %{undefined sles_version} && %{undefined suse_version} && %{undefined mgaversion} && %{undefined mageia} BuildRequires: glibc-static %endif BuildRequires: openssl openssl-devel libgsasl-devel BuildRequires: libdkim2-devel libsrs2-devel BuildRequires: libqmail-devel > 1.3 %if %{defined amzn} BuildRequires: mariadb-connector-c-devel %else BuildRequires: mysql-devel %endif ##################################### OBS #################################### %if %build_on_obs == 1 %if %{defined suse_version} && %{defined sles_version} BuildRequires: -post-build-checks #!BuildIgnore: post-build-checks %endif %endif ############################################################################## %if %{defined suse_version} && %{defined sles_version} Requires: permissions BuildRequires: openldap2-devel %else BuildRequires: openldap-devel %endif Requires: /usr/sbin/useradd /usr/sbin/userdel /usr/sbin/groupadd /usr/sbin/groupdel Requires: procps /usr/bin/awk /usr/bin/which Requires: coreutils grep /bin/sh glibc openssl Requires: diffutils sed findutils pkgconfig Requires: libqmail > 1.3 %if 0%{?fedora_version} > 30 || 0%{?centos_version} > 700 || 0%{?rhel_version} > 700 || 0%{?centos_ver} > 7 Requires: policycoreutils %else %if %{defined centos_version} || %{defined rhel_version} Requires: policycoreutils-python %endif %endif %if 0%{?suse_version} && 0%{?suse_version} < 1550 Requires: insserv-compat %endif %if %{undefined suse_version} Requires: initscripts %endif Requires: daemontools >= 1.0 Requires: ucspi-tcp >= 1.0 %define log \ log_it() { \ echo "$(echo ""|tai64n|tai64nlocal)$*" \ } %description indimail-mta provides a MTA that is part of the IndiMail messaging platform. The base is built on the following software code written by Dan J. Bernstein qmail, serialmail, qmailanalog, dotforward, fastforward, mess822 The indimail-mta package provides most features required in a modern MTA missing in qmail and other qmail based distributions. %{see_base} %package -n indimail-mini Summary: QMQP mini client Group: Productivity/Networking/Email/Clients Conflicts: %{name} Conflicts: qmta Conflicts: indimail-mini < 2.0 %if %{defined suse_version} && %{defined sles_version} PreReq: permissions %endif Requires: coreutils /bin/sh glibc openssl procps %if %{defined suse_version} || %{defined sles_version} Requires(post): update-alternatives Requires(postun): update-alternatives %endif %if %{defined fedora_version} Requires(post): alternatives Requires(postun): alternatives %endif %description -n indimail-mini This package contains sendmail, qmail-inject and qmail-qmqpc - Bare minimum programs to have a indimail-mini installation. A indimail-mini installation doesn't have a mail queue. It gives each new message to a central server using QMQP. %{see_base} %package -n qmta Summary: A minimal Mail Transport Agent Group: Productivity/Networking/Email/Clients Conflicts: %{name} Conflicts: indimail-mini %if %{defined suse_version} || %{defined sles_version} PreReq: permissions %endif Requires: coreutils /bin/sh glibc openssl procps %if %{defined suse_version} || %{defined sles_version} Requires(post): update-alternatives Requires(postun): update-alternatives %endif %if %{defined fedora_version} Requires(post): alternatives Requires(postun): alternatives %endif %description -n qmta This package contains the qmta-send mail transport agent, mini-smtpd and bare minimum programs to deliver local and remote mails A qmta installation doesn't have multiple daemons handling a queue. The queue is handled by a single daemon/binary - qmta-send. mini-smtpd is a smtp daemon with bare minimal features %{see_base} %prep %setup -q %build ( echo "---------------- INFORMATION ------------------------" echo target %_target echo target_alias %_target_alias echo target_cpu %_target_cpu echo target_os %_target_os echo target_vendor %_target_vendor echo Building %{name}-%{version}-%{release} Build %{_build} OS %{_os} Dist %dist disttag %disttag libs %{_lib} %{_libdir} echo "------------------------------------------------------" ) > %{name}-rpm.info #### qmail ###################### %{__sed} 's{PREFIX{%{_prefix}{' conf-prefix.in > conf-prefix %{__sed} 's{QMAIL{%{qmaildir}{' conf-qmail.in > conf-qmail %{__sed} 's{SYSCONFDIR{%{qsysconfdir}{' conf-sysconfdir.in > conf-sysconfdir %{__sed} 's{SHAREDDIR{%{shareddir}{' conf-shared.in > conf-shared %{__sed} 's{LIBEXECDIR{%{libexecdir}{' conf-libexec.in > conf-libexec %{__sed} 's{SERVICEDIR{%{servicedir}{' conf-servicedir.in > conf-servicedir %if %notlsarr == 0 echo "-DHASTLSA" > conf-tlsa %else > conf-tlsa %endif %if %{tcpserver_plugin} == 1 echo "-DLOAD_SHARED_OBJECTS" > conf-dlopen %else %{__rm} -f conf-dlopen %endif # create conf-users ( echo "alias" echo "qmaild" echo "qmaill" echo "root" echo "qmailp" echo "qmailq" echo "qmailr" echo "qmails" echo %username echo "qscand" echo echo "The qmail system is heavily partitioned for security; it does almost" echo "nothing as root." echo echo "The first ten lines of this file are the alias user, the daemon user," echo "the log user, the owner of miscellaneous files such as binaries, the" echo "passwd user, the queue user, the remote user, the send user, the" echo "indimail user and the virus scan user." ) > /tmp/conf-users diff /tmp/conf-users conf-users > /dev/null 2>&1 if [ $? -ne 0 ] ; then %{__mv} /tmp/conf-users conf-users else %{__rm} -f /tmp/conf-users fi # create conf-groups ( echo "qmail" echo "nofiles" echo %groupname echo "qscand" echo "qcerts" echo echo "These are the qmail,indimail groups. The second group should not" echo "have access to any files, but it must be usable for processes;" echo "this requirements excludes the \`\`nogroup'' and \`\`nobody''" echo "groups on many systems." ) > /tmp/conf-groups diff /tmp/conf-groups conf-groups > /dev/null 2>&1 if [ $? -ne 0 ] ; then %{__mv} /tmp/conf-groups conf-groups else %{__rm} -f /tmp/conf-groups fi ./catChangeLog doc/ChangeLog > ChangeLog-indimail-mta echo %{__cc} -g %{optflags} -Wall -O2 -Wimplicit -fPIC -fno-strict-aliasing -Wunused -Wcomment -Wchar-subscripts -Wuninitialized -Wshadow -Wcast-align -Wwrite-strings -Wno-discarded-qualifiers -I/usr/include/qmail > conf-cc %if %build_on_obs == 1 > conf-cc-LINUX %endif %if %{defined nodebug} echo %{__cc} -O2 -fPIE -pie -s > conf-ld %else echo %{__cc} -O2 -fPIE -pie > conf-ld %endif %install %{__mkdir_p} %{buildroot}%{_prefix} # rpm macros are complicated. Read https://rpm.org/user_doc/macros.html %if 0%{?build_cflags:1} CFLAGS="%{build_cflags}" %else CFLAGS="%{optflags}" %endif %if 0%{?build_ldflags:1} LDFLAGS="%{build_ldflags} $LDFLAGS" %endif # no static linking for RHEL7 and opensuse, sles versions %if 0%{?rhel_version} == 700 || %{defined sles_version} || %{defined suse_version} || %{defined mgaversion} %{__sed} -i -e 's{^static_option{#static_option{' \ -e 's{^dynamic_option{#dynamic_option{' Makefile.LINUX %endif %{__make} SYSTEM=LINUX %{?_smp_mflags} CC="%{__cc}" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" %{__make} SYSTEM=LINUX %{?_smp_mflags} DESTDIR=%{buildroot} install %{__mkdir_p} %{buildroot}%{shareddir}/doc %{__mkdir_p} %{buildroot}%{libexecdir} %{__mkdir_p} %{buildroot}%{qsysconfdir} #copy files not copied by setup install -m 0644 %{name}-rpm.info %{buildroot}%{qsysconfdir}/%{name}-rpm.info install -m 0644 ChangeLog-indimail-mta %{buildroot}%{shareddir}/doc/ChangeLog-indimail-mta if [ -f qupgrade ] ; then install -m 0755 qupgrade %{buildroot}%{libexecdir}/qupgrade fi if [ -f qlocal_upgrade ] ; then install -m 0755 qlocal_upgrade %{buildroot}%{libexecdir}/qlocal_upgrade fi if [ -f indimail-mta.fc ] ; then install -m 0644 indimail-mta.fc %{buildroot}%{qsysconfdir}/indimail-mta.fc fi if [ -f indimail-mta.te ] ; then install -m 0644 indimail-mta.te %{buildroot}%{qsysconfdir}/indimail-mta.te fi %{__rm} -f ChangeLog %{name}-rpm.info %if %{defined suse_version} || %{defined sles_version} %{__mkdir_p} %{buildroot}%{_sysconfdir}/permissions.d/ install -m 644 %{S:2} %{buildroot}%{_sysconfdir}/permissions.d/%{name}-permissions install -m 644 %{S:3} %{buildroot}%{_sysconfdir}/permissions.d/%{name}-permissions.secure %endif %{__mkdir_p} %{buildroot}%{qsysconfdir}/control/defaultqueue %{__mkdir_p} %{buildroot}%{qsysconfdir}/control/global_vars head -1 conf-split > %{buildroot}%{qsysconfdir}/control/global_vars/CONFSPLIT touch %{buildroot}%{qsysconfdir}/control/defaultqueue/QMAILQUEUE touch %{buildroot}%{qsysconfdir}/control/defaultqueue/QUEUEDIR # remove devel files as we are not building a devel package %{__rm} -rf %{buildroot}%{mandir}/man3 # Create these files so that %%ghost does not complain for i in tcp.smtp tcp.smtp.cdb tcp.qmtp tcp.qmtp.cdb tcp.qmqp \ tcp.qmqp.cdb do if [ ! -f %{buildroot}%{qsysconfdir}/tcp/$i ] ; then touch %{buildroot}%{qsysconfdir}/tcp/$i fi done touch %{buildroot}%{qsysconfdir}/indimail-mta.pp touch %{buildroot}%{qsysconfdir}/indimail-mta.mod ( for i in `cat controlfiles.q` do case "$i" in signatures) echo "%ghost %attr(0644,qscand,qscand) %config(noreplace,missingok) %{qsysconfdir}/control/$i" ;; spamignore) echo "%ghost %attr(0664,root,qmail) %config(noreplace,missingok) %{qsysconfdir}/control/$i" ;; *) echo "%ghost %config(noreplace,missingok) %{qsysconfdir}/control/$i" ;; esac echo $i 1>&3 touch %{buildroot}%{qsysconfdir}/control/$i done for i in rsa dh do for j in 512 1024 2048 4096 do echo "%ghost %attr(0640,indimail,qcerts) %config(noreplace,missingok) %{qsysconfdir}/certs/"$i""$j".pem" echo ../certs/"$i""$j".pem 1>&3 touch %{buildroot}%{qsysconfdir}/certs/"$i""$j".pem done done for i in servercert.cnf servercert.pem servercert.rand do echo "%ghost %attr(0640,indimail,qcerts) %config(noreplace,missingok) %{qsysconfdir}/certs/$i" echo ../certs/$i 1>&3 touch %{buildroot}%{qsysconfdir}/certs/$i done echo "%ghost %attr(0644,root,root) %{qsysconfdir}/resolv.conf" echo ../resolv.conf 1>&3 ) > config_files.list 3>%{buildroot}%{qsysconfdir}/controlfiles.q %if %{undefined suse_version} && %{undefined sles_version} %{__mkdir_p} %{buildroot}%{logdir} for i in deliver.25 greylist.1999 qmqpd.628 qmtpd.209 \ qscanq smtpd.25 smtpd.366 smtpd.465 smtpd.587 \ daned.1998 resolvconf udplogger.3000 slowq-send \ logfifo do %{__mkdir_p} %{buildroot}%{logdir}/$i touch %{buildroot}%{logdir}/$i/current done %endif %if %{undefined nodebug} /bin/chmod -R 755 %{buildroot}%{_prefix}/bin /bin/chmod -R 755 %{buildroot}%{_prefix}/sbin /bin/chmod -R 755 %{buildroot}%{libexecdir} %endif %files -f config_files.list %defattr(-, root, root,-) # # Directories # %dir %attr(0755,root,qmail) %{qmaildir} %{qmaildir}/bin %{qmaildir}/sbin %{qmaildir}/users %{qmaildir}/control %{qmaildir}/libexec # opensuse requres ghost files to be present %if %{undefined suse_version} && %{undefined sles_version} %ghost %dir %attr(0755,qmaill,nofiles) %{logdir} %ghost %dir %attr(0755,qmaill,nofiles) %{logdir}/* %ghost %attr(-,qmaill,nofiles) %{logdir}/*/* %endif %dir %attr(0755,root,root) %{libexecdir} %dir %attr(0755,root,root) %{libexecdir}/qfilters %dir %attr(0755,root,root) %{shareddir} %dir %attr(0755,root,root) %{shareddir}/boot %dir %attr(0755,root,root) %{shareddir}/doc %dir %attr(0755,root,qmail) %{qmaildir}/queue %dir %attr(0750,qscand,qscand) %{qmaildir}/qscanq %dir %attr(0750,qscand,qscand) %{qmaildir}/qscanq/root %dir %attr(0750,qscand,qscand) %{qmaildir}/qscanq/root/scanq %dir %attr(2775,alias,qmail) %{qmaildir}/alias %dir %attr(2775,indimail,qmail) %{qmaildir}/autoturn %dir %attr(2755,root,qmail) %{qsysconfdir} %dir %attr(2775,root,qcerts) %{qsysconfdir}/certs %dir %attr(2775,root,qmail) %{qsysconfdir}/control %dir %attr(2775,indimail,qmail) %{qsysconfdir}/control/cache %dir %attr(2755,root,qcerts) %{qsysconfdir}/control/domainkeys %dir %attr(0755,root,qmail) %{qsysconfdir}/control/defaultqueue %dir %attr(0755,root,qmail) %{qsysconfdir}/control/global_vars %dir %attr(0755,root,root) %{qsysconfdir}/perms.d %dir %attr(0755,root,root) %{qsysconfdir}/perms.d/%{name} %dir %attr(0755,root,root) %{qsysconfdir}/filters.d %dir %attr(2775,root,qmail) %{qsysconfdir}/tcp %dir %attr(2775,root,qmail) %{qsysconfdir}/users %if "%{mandir}" != "/usr/share/man" %dir %attr(0755,root,root) %{mandir} %dir %attr(0755,root,root) %{mandir}/man1 %dir %attr(0755,root,root) %{mandir}/man5 %dir %attr(0755,root,root) %{mandir}/man7 %dir %attr(0755,root,root) %{mandir}/man8 %endif %if "%{_prefix}" != "/usr" %dir %attr(0755,root,root) %{_libdir} %endif %dir %attr(0755,root,root) %{_prefix}/lib/indimail %dir %attr(0755,root,root) %{plugindir} %attr(444,root,root) %config(noreplace) %{qsysconfdir}/controlfiles.q %ghost %config(noreplace,missingok) %{qsysconfdir}/tcp/tcp.smtp %ghost %config(noreplace,missingok) %{qsysconfdir}/tcp/tcp.qmtp %ghost %config(noreplace,missingok) %{qsysconfdir}/tcp/tcp.qmqp # # These files will get removed during uninstallation # %ghost %attr(0644,indimail,indimail) %{qsysconfdir}/tcp/tcp.smtp.cdb %ghost %attr(0644,indimail,indimail) %{qsysconfdir}/tcp/tcp.qmtp.cdb %ghost %attr(0644,indimail,indimail) %{qsysconfdir}/tcp/tcp.qmqp.cdb %ghost %attr(0644,root,root) %{qsysconfdir}/indimail-mta.pp %ghost %attr(0644,root,root) %{qsysconfdir}/indimail-mta.mod %attr(644,root,root) %config(noreplace) %{qsysconfdir}/perms.d/%{name}/* %attr(644,root,root) %config(noreplace) %{qsysconfdir}/indimail-mta.te %attr(644,root,root) %config(noreplace) %{qsysconfdir}/indimail-mta.fc %attr(444,root,root) %config(noreplace) %{qsysconfdir}/indimail-mta.cron %attr(644,root,qmail) %config(noreplace) %{qsysconfdir}/leapsecs.dat %attr(644,root,qmail) %config(noreplace) %{qsysconfdir}/leapsecs.txt %attr(644,root,qmail) %config(noreplace) %{qsysconfdir}/backup.conf %attr(644,root,qmail) %config(noreplace,missingok) %{qsysconfdir}/control/nodnscheck %attr(644,root,qmail) %config(noreplace,missingok) %{qsysconfdir}/control/level2-tlds %attr(644,root,qmail) %config(noreplace,missingok) %{qsysconfdir}/control/level3-tlds %attr(644,root,qmail) %config(noreplace,missingok) %{qsysconfdir}/foxhole_all.cdb %attr(644,root,qmail) %config(noreplace,missingok) %{qsysconfdir}/favicon.base64 %attr(644,root,root) %{qsysconfdir}/%{name}-release %attr(444,root,root) %{qsysconfdir}/%{name}-rpm.info %if %{defined suse_version} || %{defined sles_version} %attr(644,root,root) %config(noreplace,missingok) %{_sysconfdir}/permissions.d/%{name}-permissions %attr(644,root,root) %config(noreplace,missingok) %{_sysconfdir}/permissions.d/%{name}-permissions.secure %endif # # Binaries # %attr(755,root,root) %{_prefix}/bin/queue-fix %attr(755,root,root) %{_prefix}/bin/bouncesaying %attr(755,root,root) %{_prefix}/bin/checkaddr %attr(755,root,root) %{_prefix}/bin/autoresponder %attr(755,root,root) %{_prefix}/bin/822headerfilter %attr(755,root,root) %{_prefix}/bin/checkdomain %attr(755,root,root) %{_prefix}/bin/printmaillist %attr(755,root,root) %{_prefix}/bin/newinclude %attr(755,root,root) %{_prefix}/bin/uacl %attr(755,root,root) %{_prefix}/bin/822print %attr(755,root,root) %{_prefix}/bin/sendmail %attr(755,root,root) %{_prefix}/bin/irmail %attr(755,root,root) %{_prefix}/bin/ifaddr %attr(755,root,root) %{_prefix}/bin/setforward %attr(755,root,root) %{_prefix}/bin/822date %attr(755,root,root) %{_prefix}/bin/iftocc %attr(755,root,root) %{_prefix}/bin/serialqmtp %attr(755,root,root) %{_prefix}/bin/setmaillist %attr(755,root,root) %{_prefix}/bin/qmail-showctl %attr(755,root,root) %{_prefix}/bin/822headerok %attr(755,root,root) %{_prefix}/bin/printass %attr(755,root,root) %{_prefix}/bin/printforward %attr(755,root,root) %{_prefix}/bin/preline %attr(755,root,root) %{_prefix}/bin/822addr %attr(755,root,root) %{_prefix}/bin/822fields %attr(755,root,root) %{_prefix}/bin/ofmipname %attr(755,root,root) %{_prefix}/bin/822bodyfilter %attr(755,root,root) %{_prefix}/bin/serialsmtp %attr(755,root,root) %{_prefix}/bin/predate %attr(755,root,root) %{_prefix}/bin/condredirect %attr(755,root,root) %{_prefix}/bin/fastforward %attr(755,root,root) %{_prefix}/bin/inewaliases %attr(755,root,root) %{_prefix}/bin/qmail-rm %attr(755,root,root) %{_prefix}/bin/dot-forward %attr(755,root,root) %{_prefix}/bin/datemail %attr(755,root,root) %{_prefix}/bin/qbase64 %attr(755,root,root) %{_prefix}/bin/swaks %attr(755,root,root) %{_prefix}/bin/replier %attr(755,root,root) %{_prefix}/bin/822header %attr(755,root,root) %{_prefix}/bin/qmaildirwatch %attr(755,root,root) %{_prefix}/bin/maildirqmtp %attr(755,root,root) %{_prefix}/bin/maildirdeliver %attr(755,root,root) %{_prefix}/bin/mbox2maildir %attr(755,root,root) %{_prefix}/bin/qmaildirmake %attr(755,root,root) %{_prefix}/bin/maildir2mbox %attr(755,root,root) %{_prefix}/bin/condtomaildir %attr(755,root,root) %{_prefix}/bin/maildirsmtp %attr(755,root,root) %{_prefix}/bin/maildirserial %attr(755,root,root) %{_prefix}/bin/maildircmd %attr(755,root,root) %{_prefix}/bin/maildirsize %attr(755,root,root) %{_prefix}/bin/qarf %attr(755,root,root) %{_prefix}/bin/qaes %attr(755,root,root) %{_prefix}/bin/qnotify %attr(755,root,root) %{_prefix}/bin/rrt %attr(755,root,root) %{_prefix}/bin/drate %attr(755,root,root) %{_prefix}/bin/cidr %attr(755,root,root) %{_prefix}/bin/tcp-env %attr(755,root,root) %{_prefix}/bin/rrforward %attr(755,root,root) %{_prefix}/bin/mailsubj %attr(755,root,root) %{_prefix}/bin/822field %attr(755,root,root) %{_prefix}/bin/qcat %attr(755,root,root) %{_prefix}/bin/replier-config %attr(755,root,root) %{_prefix}/bin/forward %attr(755,root,root) %{_prefix}/bin/new-inject %attr(755,root,root) %{_prefix}/bin/filterit %attr(755,root,root) %{_prefix}/bin/filterto %attr(755,root,root) %{_prefix}/bin/822body %attr(755,root,root) %{_prefix}/bin/iftoccfrom %attr(755,root,root) %{_prefix}/bin/qreceipt %attr(755,root,root) %{_prefix}/bin/except %attr(755,root,root) %{_prefix}/bin/dknewkey %attr(755,root,root) %{_prefix}/bin/qmail-inject %attr(755,root,root) %{_prefix}/bin/serialcmd %attr(755,root,root) %{_prefix}/bin/qmail-qread %attr(755,root,root) %{_prefix}/bin/qtop %attr(755,root,root) %{_prefix}/bin/822received %attr(755,root,root) %{_prefix}/bin/qmail-qfilter %attr(755,root,root) %{_prefix}/bin/spfquery %attr(755,root,root) %{_prefix}/bin/srsfilter %attr(0755,root,root) %{_prefix}/bin/udpclient %attr(0755,root,root) %{_prefix}/bin/sslerator %if %notlsarr == 0 %attr(755,root,root) %{_prefix}/bin/qdane %endif %attr(755,root,root) %{_prefix}/sbin/udplogger %attr(751,root,root) %{_prefix}/sbin/greydaemon %attr(751,root,root) %{_prefix}/sbin/qmail-greyd %if %notlsarr == 0 %attr(751,root,root) %{_prefix}/sbin/qmail-daned %endif %attr(755,root,root) %{_prefix}/sbin/qmail-popbull %attr(755,root,root) %{_prefix}/sbin/qmail-poppass %attr(751,root,root) %{_prefix}/sbin/ofmipd %attr(755,root,root) %{_prefix}/sbin/qmail-direct %attr(755,root,root) %{_prefix}/sbin/spawn-filter %attr(755,root,root) %{_prefix}/sbin/qmail-getpw %attr(755,root,root) %{_prefix}/sbin/qmail-local %attr(755,root,root) %{_prefix}/sbin/qmail-remote %attr(755,root,root) %{_prefix}/sbin/rd-remote %attr(755,root,root) %{_prefix}/sbin/qmail-pw2u %attr(755,root,root) %{_prefix}/sbin/cdbtest %attr(755,root,root) %{_prefix}/sbin/cdbstats %attr(755,root,root) %{_prefix}/sbin/cdbdump %attr(755,root,root) %{_prefix}/sbin/cdbget %attr(755,root,root) %{_prefix}/sbin/cdbgetm %attr(755,root,root) %{_prefix}/sbin/cdbmake %attr(755,root,root) %{_prefix}/sbin/qscanq-stdin %attr(755,root,root) %{_prefix}/sbin/plugtest %attr(755,root,root) %{_prefix}/sbin/ldap-checkpwd %attr(711,root,root) %{_prefix}/sbin/svctool %attr(755,root,root) %{_prefix}/sbin/qmail-nullqueue %attr(755,root,root) %{_prefix}/sbin/qmail-multi %attr(755,root,root) %{_prefix}/sbin/qmail-spamfilter %attr(755,root,root) %{_prefix}/sbin/cleanq %attr(755,root,root) %{_prefix}/sbin/qmail-tcpok %attr(755,root,root) %{_prefix}/sbin/qmail-tcpto %attr(755,root,root) %{_prefix}/sbin/qmail-qmqpc %attr(755,root,root) %{_prefix}/sbin/qmail-newu %attr(755,root,root) %{_prefix}/sbin/cdb-database %attr(755,root,root) %{_prefix}/sbin/sql-database %attr(755,root,root) %{_prefix}/sbin/ctrlenv %attr(755,root,root) %{_prefix}/sbin/qmail-cdb %attr(755,root,root) %{_prefix}/sbin/qmail-sql %attr(751,root,root) %{_prefix}/sbin/qmail-smtpd %attr(751,root,root) %{_prefix}/sbin/qmail-qmqpd %attr(751,root,root) %{_prefix}/sbin/qmail-qmtpd %attr(751,root,root) %{_prefix}/sbin/qscheduler %attr(751,root,root) %{_prefix}/sbin/qmonitor %attr(751,root,root) %{_prefix}/sbin/setqload %attr(751,root,root) %{_prefix}/sbin/qmail-start %attr(751,root,root) %{_prefix}/sbin/slowq-start %attr(751,root,root) %{_prefix}/sbin/qmail-lspawn %attr(751,root,root) %{_prefix}/sbin/qmail-rspawn %attr(751,root,root) %{_prefix}/sbin/qmail-clean %attr(751,root,root) %{_prefix}/sbin/qmail-send %attr(751,root,root) %{_prefix}/sbin/slowq-send %attr(751,root,root) %{_prefix}/sbin/qmta-send %attr(751,root,root) %{_prefix}/sbin/mini-smtpd %attr(751,root,root) %{_prefix}/sbin/todo-proc %attr(755,root,root) %{_prefix}/sbin/surblfilter %attr(755,root,root) %{_prefix}/sbin/surblqueue %attr(755,root,root) %{_prefix}/sbin/relaytest %attr(755,root,root) %{_prefix}/sbin/splogger %attr(755,root,root) %{libexecdir}/authcram %attr(755,root,root) %{libexecdir}/columnt %attr(755,root,root) %{libexecdir}/rpmattr %attr(755,root,root) %{libexecdir}/leapsecs %attr(755,root,root) %{libexecdir}/yearcal %attr(755,root,root) %{libexecdir}/nowutc %attr(755,root,root) %{libexecdir}/batv %attr(755,root,root) %{libexecdir}/zsuccesses %attr(755,root,root) %{libexecdir}/deferrals %attr(755,root,root) %{libexecdir}/rsmtprecipients %attr(755,root,root) %{libexecdir}/zrecipients %attr(755,root,root) %{libexecdir}/xsender %attr(755,root,root) %{libexecdir}/rxdelay %attr(755,root,root) %{libexecdir}/zspam %attr(755,root,root) %{libexecdir}/recipients %attr(755,root,root) %{libexecdir}/rsmtprdomains %attr(755,root,root) %{libexecdir}/rsmtpfailures %attr(755,root,root) %{libexecdir}/successes %attr(755,root,root) %{libexecdir}/rspamrdomain %attr(755,root,root) %{libexecdir}/matchup %attr(755,root,root) %{libexecdir}/mlmatchup %attr(755,root,root) %{libexecdir}/smtp-matchup %attr(755,root,root) %{libexecdir}/xqp %attr(755,root,root) %{libexecdir}/zddist %attr(755,root,root) %{libexecdir}/zsenders %attr(755,root,root) %{libexecdir}/senders %attr(755,root,root) %{libexecdir}/suids %attr(755,root,root) %{libexecdir}/zsmtp %attr(755,root,root) %{libexecdir}/zoverall %attr(755,root,root) %{libexecdir}/rhosts %attr(755,root,root) %{libexecdir}/zrhosts %attr(755,root,root) %{libexecdir}/failures %attr(755,root,root) %{libexecdir}/rsmtp %attr(755,root,root) %{libexecdir}/rsmtpsenders %attr(755,root,root) %{libexecdir}/zdeferrals %attr(755,root,root) %{libexecdir}/rspamstat %attr(755,root,root) %{libexecdir}/zsuids %attr(755,root,root) %{libexecdir}/xrecipient %attr(755,root,root) %{libexecdir}/rspamhist %attr(755,root,root) %{libexecdir}/rsmtpsdomains %attr(755,root,root) %{libexecdir}/zfailures %attr(755,root,root) %{libexecdir}/zsendmail %attr(755,root,root) %{libexecdir}/ddist %attr(755,root,root) %{libexecdir}/rspamsdomain %attr(755,root,root) %{libexecdir}/zrxdelay %attr(755,root,root) %{libexecdir}/qupgrade %verify (not md5 size mtime mode) %{libexecdir}/qlocal_upgrade %attr(755,root,root) %{libexecdir}/atrn %attr(755,root,root) %{libexecdir}/etrn %attr(755,root,root) %{libexecdir}/cdbmake-12 %attr(755,root,root) %{libexecdir}/cdbmake-sv %attr(755,root,root) %{libexecdir}/config-fast %attr(755,root,root) %{libexecdir}/hostname %attr(755,root,root) %{libexecdir}/qmailconfig %attr(755,root,root) %{libexecdir}/dnstxt %attr(755,root,root) %{libexecdir}/dnsmxip %attr(755,root,root) %{libexecdir}/dnsfq %attr(755,root,root) %{libexecdir}/dnsptr %attr(755,root,root) %{libexecdir}/dnsip %attr(755,root,root) %{libexecdir}/dnscname %attr(755,root,root) %{libexecdir}/dnsblcheck %if %notlsarr == 0 %attr(755,root,root) %{libexecdir}/dnstlsarr %endif %attr(755,root,root) %{libexecdir}/qsmhook %attr(755,root,root) %{libexecdir}/update_tmprsadh %attr(755,root,root) %{libexecdir}/instcheck.indimail-mta %attr(755,root,root) %{libexecdir}/whois %attr(755,root,root) %{libexecdir}/testzero %attr(755,root,root) %{libexecdir}/ipmeprint %attr(755,root,root) %{libexecdir}/qpq %attr(755,root,root) %{libexecdir}/qfrontend %attr(755,root,root) %{libexecdir}/qfilters/qf-smtp-ratelimit %attr(755,root,root) %{libexecdir}/qfilters/qf-log-subject %attr(755,root,root) %{libexecdir}/test-recipients %attr(755,root,root) %{libexecdir}/make-recipients %docdir %{mandir} %attr(0644,root,root) %{mandir}/man[1,4,5,7,8]/* %attr(0755,root,root) %{shareddir}/boot/binm2 %attr(0755,root,root) %{shareddir}/boot/proc+df %attr(0755,root,root) %{shareddir}/boot/binm1+df %attr(0755,root,root) %{shareddir}/boot/binm3+df %attr(0755,root,root) %{shareddir}/boot/home+df %attr(0755,root,root) %{shareddir}/boot/binm3 %attr(0755,root,root) %{shareddir}/boot/binm1 %attr(0755,root,root) %{shareddir}/boot/proc %attr(0755,root,root) %{shareddir}/boot/home %attr(0755,root,root) %{shareddir}/boot/binm2+df %attr(0644,root,root) %{shareddir}/boot/qmta-send.service %attr(0755,root,root) %{plugindir}/generic.so %attr(0755,root,root) %{plugindir}/smtpd-plugin.so %if %tcpserver_plugin != 0 %attr(0755,root,root) %{plugindir}/qmail_smtpd.so %endif %if %build_on_obs == 0 %license %attr(0644,root,root) %{shareddir}/doc/COPYING-indimail-mta %license %attr(0644,root,root) %{shareddir}/doc/README.licenses %license %attr(0644,root,root) %{shareddir}/doc/LICENSE.qhpsi %else %attr(0644,root,root) %{shareddir}/doc/COPYING-indimail-mta %attr(0644,root,root) %{shareddir}/doc/README.licenses %attr(0644,root,root) %{shareddir}/doc/LICENSE.qhpsi %endif %attr(0644,root,root) %{shareddir}/doc/softwarelicense1-1.html %attr(0644,root,root) %{shareddir}/doc/INSTALL.alias %attr(0644,root,root) %{shareddir}/doc/INSTALL.control %attr(0644,root,root) %{shareddir}/doc/INSTALL.maildir %attr(0644,root,root) %{shareddir}/doc/INSTALL.mbox %attr(0644,root,root) %{shareddir}/doc/INSTALL-MINI %attr(0644,root,root) %{shareddir}/doc/INSTALL.vsm %attr(0644,root,root) %{shareddir}/doc/README.clamav %attr(0644,root,root) %{shareddir}/doc/README.EXTTODO %attr(0644,root,root) %{shareddir}/doc/README.filters %attr(0644,root,root) %{shareddir}/doc/README.greylist %attr(0644,root,root) %{shareddir}/doc/README.indimail-mta %attr(0644,root,root) %{shareddir}/doc/README.qhpsi %attr(0644,root,root) %{shareddir}/doc/README.qregex %attr(0644,root,root) %{shareddir}/doc/README.queue-fix %attr(0644,root,root) %{shareddir}/doc/README.status %attr(0644,root,root) %{shareddir}/doc/README.recipients %attr(0644,root,root) %{shareddir}/doc/README.srs %attr(0644,root,root) %{shareddir}/doc/README.surbl %attr(0644,root,root) %{shareddir}/doc/CREDITS.md %attr(0644,root,root) %{shareddir}/doc/ChangeLog-indimail-mta %attr(0644,root,root) %{shareddir}/doc/FROMISP %attr(0644,root,root) %{shareddir}/doc/TOISP %attr(0644,root,root) %{shareddir}/doc/AUTOTURN %attr(0644,root,root) %{shareddir}/doc/PIC.local2alias %attr(0644,root,root) %{shareddir}/doc/PIC.local2local %attr(0644,root,root) %{shareddir}/doc/PIC.nullclient %attr(0644,root,root) %{shareddir}/doc/PIC.rem2local %attr(0644,root,root) %{shareddir}/doc/PIC.relaybad %attr(0644,root,root) %{shareddir}/doc/PIC.local2ext %attr(0644,root,root) %{shareddir}/doc/PIC.local2virt %attr(0644,root,root) %{shareddir}/doc/PIC.relaygood %attr(0644,root,root) %{shareddir}/doc/PIC.local2rem %if %{defined suse_version} || %{defined sles_version} %verify (not user group mode caps) %attr(6551, qscand, qmail) %{_prefix}/sbin/qhpsi %verify (not user group mode caps) %attr(2551, root, qscand) %{_prefix}/sbin/run-cleanq %verify (not user group mode caps) %attr(2551, root, qmail) %{_prefix}/sbin/qmail-dkim %verify (not user group mode caps) %attr(6551, qmailq, qmail) %{_prefix}/sbin/qmail-queue %verify (not user group mode caps) %attr(4551, qscand, qscand) %{_prefix}/sbin/qscanq %verify (not user group mode caps) %attr(4551, root, root) %{_prefix}/sbin/sys-checkpwd %else %attr(6551,qscand,qmail) %{_prefix}/sbin/qhpsi %attr(2551,root,qscand) %{_prefix}/sbin/run-cleanq %attr(2551,root,qmail) %{_prefix}/sbin/qmail-dkim %attr(6551,qmailq,qmail) %{_prefix}/sbin/qmail-queue %attr(4551,qscand,qscand) %{_prefix}/sbin/qscanq %attr(4551,root,root) %{_prefix}/sbin/sys-checkpwd %endif %files -n indimail-mini %defattr(-, root, root, 0755) # # Directories # %dir %attr(0755,root,qmail) %{qmaildir} %{qmaildir}/bin %{qmaildir}/sbin %{qmaildir}/control %dir %attr(2775,root,qmail) %{qsysconfdir}/control %if "%{mandir}" != "/usr/share/man" %dir %attr(0755,root,root) %{mandir} %dir %attr(0755,root,root) %{mandir}/man1 %dir %attr(0755,root,root) %{mandir}/man5 %dir %attr(0755,root,root) %{mandir}/man8 %endif %dir %attr(755,root,qmail) %{qsysconfdir}/control/defaultqueue %dir %attr(755,root,qmail) %{qsysconfdir}/control/global_vars # %attr(0755,root,root) %{_prefix}/bin/sendmail %attr(0755,root,root) %{_prefix}/bin/qmail-inject %attr(0755,root,root) %{_prefix}/bin/srsfilter %attr(0755,root,root) %{_prefix}/bin/predate %attr(0755,root,root) %{_prefix}/bin/datemail %attr(0755,root,root) %{_prefix}/bin/mailsubj %attr(0755,root,root) %{_prefix}/bin/irmail %attr(0755,root,root) %{_prefix}/bin/qmail-showctl %attr(0755,root,root) %{_prefix}/sbin/qmail-qmqpc %attr(0755,root,root) %{_prefix}/sbin/qmail-direct %attr(0755,root,root) %{_prefix}/sbin/mini-smtpd %ghost %attr(0644,root,qmail) %config(noreplace,missingok) %{qsysconfdir}/control/defaultqueue/QMAILQUEUE %ghost %attr(0644,root,qmail) %config(noreplace,missingok) %{qsysconfdir}/control/global_vars/CONFSPLIT # %attr(0644,root,root) %{mandir}/man1/srsfilter.1.* %attr(0644,root,root) %{mandir}/man1/predate.1.* %attr(0644,root,root) %{mandir}/man1/datemail.1.* %attr(0644,root,root) %{mandir}/man1/mailsubj.1.* # %attr(0644,root,root) %{mandir}/man5/indimail-srs.5.* # %attr(0644,root,root) %{mandir}/man8/qmail-inject.8.* %attr(0644,root,root) %{mandir}/man8/isendmail.8.* %attr(0644,root,root) %{mandir}/man8/qmail-qmqpc.8.* %attr(0644,root,root) %{mandir}/man8/mini-smtpd.8.* %attr(0644,root,root) %{mandir}/man8/qmail-direct.8.* %attr(0644,root,root) %{mandir}/man8/irmail.8.* %attr(0644,root,root) %{mandir}/man8/qmail-showctl.8.* %if %build_on_obs == 0 %license %attr(0644,root,root) %{shareddir}/doc/COPYING-indimail-mta %license %attr(0644,root,root) %{shareddir}/doc/README.licenses %else %attr(0644,root,root) %{shareddir}/doc/COPYING-indimail-mta %attr(0644,root,root) %{shareddir}/doc/README.licenses %endif %attr(0644,root,root) %{shareddir}/doc/softwarelicense1-1.html %attr(0644,root,root) %{shareddir}/doc/INSTALL-MINI %attr(0644,root,root) %{shareddir}/doc/README.indimail-mta %attr(0644,root,root) %{shareddir}/doc/README.srs %attr(0644,root,root) %{shareddir}/doc/CREDITS.md %attr(0644,root,root) %{shareddir}/doc/ChangeLog-indimail-mta # a copy of /var/qmail/control/me, /var/qmail/control/defaultdomain, # and /var/qmail/control/plusdomain from your central server, so that # qmail-inject uses appropriate host names in outgoing mail; and # this host's name in /var/qmail/control/idhost, so that # qmail-inject generates Message-ID without any risk of collision %files -n qmta %defattr(-, root, root, 0755) # # Directories # %dir %attr(0755,root,qmail) %{qmaildir} %{qmaildir}/bin %{qmaildir}/sbin %{qmaildir}/users %{qmaildir}/control %dir %attr(2775,root,qmail) %{qsysconfdir}/control %dir %attr(2775,root,qmail) %{qsysconfdir}/users %if "%{mandir}" != "/usr/share/man" %dir %attr(0755,root,root) %{mandir} %dir %attr(0755,root,root) %{mandir}/man1 %dir %attr(0755,root,root) %{mandir}/man5 %dir %attr(0755,root,root) %{mandir}/man8 %endif %dir %attr(755,root,qmail) %{qsysconfdir}/control/defaultqueue %dir %attr(755,root,qmail) %{qsysconfdir}/control/global_vars # %attr(0755,root,root) %{_prefix}/bin/sendmail %attr(0755,root,root) %{_prefix}/bin/qmail-inject %attr(0755,root,root) %{_prefix}/bin/irmail %attr(0755,root,root) %{_prefix}/bin/filterit %attr(0755,root,root) %{_prefix}/bin/forward %attr(0755,root,root) %{_prefix}/bin/predate %attr(0755,root,root) %{_prefix}/bin/datemail %attr(0755,root,root) %{_prefix}/bin/mailsubj %attr(0755,root,root) %{_prefix}/bin/qmail-showctl %attr(0755,root,root) %{_prefix}/bin/qmaildirmake %attr(0755,root,root) %{_prefix}/bin/maildir2mbox %attr(0755,root,root) %{_prefix}/bin/maildirdeliver %attr(0755,root,root) %{_prefix}/bin/qmaildirwatch %attr(0755,root,root) %{_prefix}/bin/srsfilter %attr(0755,root,root) %{_prefix}/bin/queue-fix %attr(0755,root,root) %{_prefix}/sbin/qmail-qmqpc %attr(0755,root,root) %{_prefix}/sbin/qmail-direct %attr(0751,root,root) %{_prefix}/sbin/qmta-send %attr(0751,root,root) %{_prefix}/sbin/mini-smtpd %attr(0751,root,root) %{_prefix}/sbin/qmail-lspawn %attr(0751,root,root) %{_prefix}/sbin/qmail-local %attr(0751,root,root) %{_prefix}/sbin/qmail-rspawn %attr(0751,root,root) %{_prefix}/sbin/qmail-remote %attr(0751,root,root) %{_prefix}/sbin/qmail-clean %attr(0751,root,root) %{_prefix}/sbin/qmail-tcpok %attr(0751,root,root) %{_prefix}/sbin/qmail-tcpto %ghost %attr(0644,root,qmail) %config(noreplace,missingok) %{qsysconfdir}/control/defaultqueue/QMAILQUEUE %ghost %attr(0644,root,qmail) %config(noreplace,missingok) %{qsysconfdir}/control/defaultqueue/QUEUEDIR %ghost %attr(0644,root,qmail) %config(noreplace,missingok) %{qsysconfdir}/control/global_vars/CONFSPLIT %if %{defined suse_version} || %{defined sles_version} %attr(0644,root,root) %config(noreplace,missingok) %{_sysconfdir}/permissions.d/indimail-mta-permissions %attr(0644,root,root) %config(noreplace,missingok) %{_sysconfdir}/permissions.d/indimail-mta-permissions.secure %endif # %attr(0644,root,root) %{mandir}/man1/forward.1.* %attr(0644,root,root) %{mandir}/man1/predate.1.* %attr(0644,root,root) %{mandir}/man1/datemail.1.* %attr(0644,root,root) %{mandir}/man1/instcheck-indimail-mta.1.* %attr(0644,root,root) %{mandir}/man1/mailsubj.1.* %attr(0644,root,root) %{mandir}/man8/qmail-showctl.8.* %attr(0644,root,root) %{mandir}/man1/qmaildirmake.1.* %attr(0644,root,root) %{mandir}/man1/maildir2mbox.1.* %attr(0644,root,root) %{mandir}/man1/qmaildirwatch.1.* %attr(0644,root,root) %{mandir}/man1/srsfilter.1.* %attr(0644,root,root) %{mandir}/man5/indimail-srs.5.* %attr(0644,root,root) %{mandir}/man8/queue-fix.8.* %attr(0644,root,root) %{mandir}/man8/qmail-qmqpc.8.* %attr(0644,root,root) %{mandir}/man8/qmail-direct.8.* %attr(0644,root,root) %{mandir}/man8/qmta-send.8.* %attr(0644,root,root) %{mandir}/man8/mini-smtpd.8.* %attr(0644,root,root) %{mandir}/man8/qmail-queue.8.* %attr(0644,root,root) %{mandir}/man8/qmail-lspawn.8.* %attr(0644,root,root) %{mandir}/man8/qmail-local.8.* %attr(0644,root,root) %{mandir}/man8/qmail-rspawn.8.* %attr(0644,root,root) %{mandir}/man8/qmail-remote.8.* %attr(0644,root,root) %{mandir}/man8/qmail-clean.8.* %attr(0644,root,root) %{mandir}/man8/qmail-tcpok.8.* %attr(0644,root,root) %{mandir}/man8/qmail-tcpto.8.* %attr(0644,root,root) %{mandir}/man8/qhpsi.8.* %attr(0644,root,root) %{mandir}/man8/isendmail.8.* %attr(0644,root,root) %{mandir}/man8/qmail-inject.8.* %attr(0644,root,root) %{mandir}/man8/irmail.8.* %if %build_on_obs == 0 %license %attr(0644,root,root) %{shareddir}/doc/COPYING-indimail-mta %license %attr(0644,root,root) %{shareddir}/doc/README.licenses %license %attr(0644,root,root) %{shareddir}/doc/LICENSE.qhpsi %else %attr(0644,root,root) %{shareddir}/doc/COPYING-indimail-mta %attr(0644,root,root) %{shareddir}/doc/README.licenses %attr(0644,root,root) %{shareddir}/doc/LICENSE.qhpsi %endif %attr(0644,root,root) %{shareddir}/doc/softwarelicense1-1.html %attr(0644,root,root) %{shareddir}/doc/INSTALL-MINI %attr(0644,root,root) %{shareddir}/doc/README.clamav %attr(0644,root,root) %{shareddir}/doc/README.indimail-mta %attr(0644,root,root) %{shareddir}/doc/README.qhpsi %attr(0644,root,root) %{shareddir}/doc/README.srs %attr(0644,root,root) %{shareddir}/doc/README.queue-fix %attr(0644,root,root) %{shareddir}/doc/CREDITS.md %attr(0644,root,root) %{shareddir}/doc/ChangeLog-indimail-mta # a copy of /var/qmail/control/me, /var/qmail/control/defaultdomain, # and /var/qmail/control/plusdomain from your central server, so that # qmail-inject uses appropriate host names in outgoing mail; and # this host's name in /var/qmail/control/idhost, so that # qmail-inject generates Message-ID without any risk of collision %if %{defined suse_version} || %{defined sles_version} %verify (not user group mode caps) %attr(6551, qscand, qmail) %{_prefix}/sbin/qhpsi %verify (not user group mode caps) %attr(6551, qmailq, qmail) %{_prefix}/sbin/qmail-queue %else %attr(6551,qscand,qmail) %{_prefix}/sbin/qhpsi %attr(6551,qmailq,qmail) %{_prefix}/sbin/qmail-queue %endif # value of argv1 ($1) passed to scriptlets # install erase upgrade reinstall # pretrans 0 - 0 # pre 1 - 2 2 # post 1 - 2 2 # preun - 0 1 - # postun - 0 1 - # posttrans 0 - 0 # The scriptlets in %%pre and %%post are respectively run before and after a package is installed. # The scriptlets %%preun and %%postun are run before and after a package is uninstalled. # The scriptlets %%pretrans and %%posttrans are run at start and end of a transaction. # On upgrade, the scripts are run in the following order: # # 1. pretrans of new package # 2. pre of new package # 3. (package install) # 4. post of new package # 5. preun of old package # 6. (removal of old package) # 7. postun of old package # 8. posttrans of new package ### SCRIPTLET ############################################################################### %verifyscript ID=$(id -u) if [ $ID -ne 0 ] ; then echo "You are not root" 1>&2 exit 1 fi %{_prefix}/sbin/svctool --check-install --servicedir=%{servicedir} \ --qbase=%{qbase} --qcount=%{qcount} --qstart=1 %if %{defined suse_version} || %{defined sles_version} %verify_permissions -e %{_prefix}/sbin/qhpsi %verify_permissions -e %{_prefix}/sbin/run-cleanq %verify_permissions -e %{_prefix}/sbin/qmail-queue %verify_permissions -e %{_prefix}/sbin/qscanq %verify_permissions -e %{_prefix}/sbin/sys-checkpwd %verify_permissions -e %{_prefix}/sbin/qmail-dkim %verify_permissions -e %{qmaildir}/alias/ %verify_permissions -e %{qmaildir}/autoturn/ %verify_permissions -e %{qsysconfdir}/ %verify_permissions -e %{qsysconfdir}/certs/ %verify_permissions -e %{qsysconfdir}/control/ %verify_permissions -e %{qsysconfdir}/control/cache/ %verify_permissions -e %{qsysconfdir}/control/domainkeys/ %verify_permissions -e %{qsysconfdir}/tcp/ %verify_permissions -e %{qsysconfdir}/users/ %endif ### SCRIPTLET ############################################################################### %pretrans %log argv1=$1 ( log_it "===== Start %{name} installation =====" if [ -d /run ] ; then rundir=/run/svscan elif [ -d /var/run ] ; then rundir=/var/run/svscan else rundir=%{servicedir} fi log_it "shutting down %{name} services" for i in greylist.1999 qmail-daned.1998 qmail-qmqpd.628 \ qmail-qmtpd.209 qmail-send.25 qmail-smtpd.25 \ qmail-smtpd.366 qmail-smtpd.465 qmail-smtpd.587 \ slowq-send qscanq udplogger.3000 qmail-logfifo do if [ ! -d %{servicedir}/$i ] ; then continue fi %{_prefix}/bin/svstat %{servicedir}/$i >/dev/null 2>&1 if [ $? -eq 0 ] ; then %{__mkdir_p} ${rundir}/$i touch ${rundir}/$i/.down %{_prefix}/bin/svc -d %{servicedir}/$i fi done if [ -f %{libexecdir}/qupgrade ] ; then log_it "Running Custom Upgrade Script for pretrans" /bin/sh %{libexecdir}/qupgrade pretrans noargs %{version} $* | tai64n | tai64nlocal fi ) >> /var/log/%{name}-setup.log 2>&1 ### SCRIPTLET ############################################################################### %pre %log argv1=$1 if [ -z "$argv1" ] ; then argv1=0 fi # we are doing upgrade if [ $argv1 -eq 2 ] ; then if [ -f %{libexecdir}/qupgrade ] ; then ( log_it "Running Custom Upgrade Script for pre upgrade" /bin/sh %{libexecdir}/qupgrade pre upgrade %{version} $* | tai64n | tai64nlocal ) >> /var/log/%{name}-setup.log 2>&1 fi exit 0 fi # # Create a users and groups. Do not report any problems if they already # exists. # ( nscd_up=`ps -ef |grep nscd |grep -v grep|wc -l` if [ $nscd_up -ge 1 ] ; then if [ -x %{_sysconfdir}/init.d/nscd ] ; then %{_sysconfdir}/init.d/nscd stop elif [ -f %{_sysconfdir}/systemd/system/multi-user.target/nscd.service ] ; then /bin/systemctl stop nscd.service >/dev/null 2>&1 fi fi log_it "Adding indimail-mta users/groups" /usr/bin/getent group %groupname > /dev/null || /usr/sbin/groupadd -r -g %gid %groupname || true if [ $? = 4 ] ; then /usr/sbin/groupadd %groupname fi /usr/bin/getent group nofiles > /dev/null || /usr/sbin/groupadd nofiles || true /usr/bin/getent group qmail > /dev/null || /usr/sbin/groupadd qmail || true /usr/bin/getent group qscand > /dev/null || /usr/sbin/groupadd qscand || true /usr/bin/getent group qcerts > /dev/null || /usr/sbin/groupadd qcerts || true /usr/bin/getent passwd %username > /dev/null || /usr/sbin/useradd -r -g %groupname -u %uid -d %{qmaildir} %username || true if [ $? = 4 ] ; then /usr/sbin/useradd -r -g %groupname -d %{qmaildir} %username fi /usr/bin/getent passwd alias > /dev/null || /usr/sbin/useradd -M -g nofiles -d %{qmaildir}/alias -s /sbin/nologin alias || true /usr/bin/getent passwd qmaild > /dev/null || /usr/sbin/useradd -M -g nofiles -d %{qmaildir} -s /sbin/nologin qmaild -G qcerts || true /usr/bin/getent passwd qmaill > /dev/null || /usr/sbin/useradd -M -g nofiles -d %{logdir} -s /sbin/nologin qmaill || true /usr/bin/getent passwd qmailp > /dev/null || /usr/sbin/useradd -M -g nofiles -d %{qmaildir} -s /sbin/nologin qmailp || true /usr/bin/getent passwd qmailq > /dev/null || /usr/sbin/useradd -M -g qmail -d %{qmaildir} -s /sbin/nologin qmailq || true /usr/bin/getent passwd qmailr > /dev/null || /usr/sbin/useradd -M -g qmail -d %{qmaildir} -s /sbin/nologin qmailr -G qcerts || true /usr/bin/getent passwd qmails > /dev/null || /usr/sbin/useradd -M -g qmail -d %{qmaildir} -s /sbin/nologin qmails -G qcerts || true /usr/bin/getent passwd qscand > /dev/null || /usr/sbin/useradd -M -g qscand -d %{qmaildir}/qscanq -s /sbin/nologin qscand -G qmail,qscand || true for i in %username alias qmaild qmaill qmailp qmailq qmailr qmails qscand do %{__rm} -f /var/spool/mail/$i done if [ $nscd_up -ge 1 ] ; then if [ -x %{_sysconfdir}/init.d/nscd ] ; then %{_sysconfdir}/init.d/nscd start elif [ -f %{_sysconfdir}/systemd/system/multi-user.target/nscd.service ] ; then /bin/systemctl start nscd.service >/dev/null 2>&1 fi fi ) >> /var/log/%{name}-setup.log 2>&1 ### SCRIPTLET ############################################################################### %post %log argv1=$1 if [ -z "$argv1" ] ; then argv1=0 fi if [ $argv1 -eq 2 ] ; then # upgrade ( log_it "doing post upgrade activities" if [ -f %{libexecdir}/qupgrade ] ; then if [ "%{_libdir}" != "/usr/lib64" -a "%{_libdir}" != "/usr/lib" ] ; then /sbin/ldconfig fi log_it "Running Custom Upgrade Script for post upgrade" /bin/sh %{libexecdir}/qupgrade post upgrade %{version} $* | tai64n | tai64nlocal fi # selinux %{_prefix}/sbin/svctool --servicedir=%{servicedir} --config=qselinux | tai64n | tai64nlocal if [ -f %{_sysconfdir}/inittab ] ; then # one of these days, this will disappear /bin/grep "^#SV:" %{_sysconfdir}/inittab |/bin/grep svscan |/bin/grep respawn >/dev/null 2>&1 if [ $? -eq 0 ] ; then %{__sed} -i 's{^#SV:{SV:{' %{_sysconfdir}/inittab fi fi # refresh indimail-mta services svc_list="" for i in clamd greylist.1999 qmail-qmqpd.628 \ qmail-qmtpd.209 qmail-smtpd.25 qmail-smtpd.366 \ qmail-smtpd.465 qmail-smtpd.587 slowq-send \ qmail-daned.1998 qscanq udplogger.3000 \ qmail-logfifo .svscan do if [ -d %{servicedir}/$i ] ; then if [ -z "$svc_list" ] ; then svc_list="%{servicedir}/$i" else svc_list="$svc_list %{servicedir}/$i" fi fi done svc_list="$svc_list %{qsysconfdir}/control/defaultqueue" %{_prefix}/sbin/svctool --servicedir=%{servicedir} --refreshsvc="$svc_list" | tai64n | tai64nlocal log_it "starting indimail-mta services" if [ -d /run ] ; then rundir=/run/svscan elif [ -d /var/run ] ; then rundir=/var/run/svscan else rundir=%{servicedir} fi for i in greylist.1999 qmail-daned.1998 qmail-qmqpd.628 \ qmail-qmtpd.209 qmail-send.25 qmail-smtpd.25 \ qmail-smtpd.366 qmail-smtpd.465 qmail-smtpd.587 \ slowq-send qscanq udplogger.3000 qmail-logfifo do if [ ! -d %{servicedir}/$i ] ; then continue fi %{_prefix}/bin/svok %{servicedir}/$i if [ $? -eq 0 -a -f ${rundir}/$i/.down ] ; then %{__rm} -f ${rundir}/$i/.down %{_prefix}/bin/svc -u %{servicedir}/$i fi done ) >> /var/log//%{name}-setup.log 2>&1 exit 0 fi log_it "Doing Post Install" echo "" echo " 1. Configure %{logdir} for multilog" echo " 2. Configure %{servicedir}" echo " 3. Configure standard catch-all accounts, default qmail configuration" echo " 4. Configure DKIM, Domainkeys signature" echo " 5. Configure QHPSI for inline virus scanning" echo " 6. Configure SMTP services on port in 465 25 587" echo " 7. Configure default queue configuration for sendmail, qmail-inject" echo " 8. Configure ODMR service" echo " 9. Configure greylisting service" echo "10. Configure QMTP service" echo "11. Configure QMQP service" echo "12. Configure udplogger service" echo "13. Configure qscanq/clamd/freshclam service" echo "14. Configure %{qsysconfdir}/control/signatures" echo "15. Configure tcprules database for SMTP, QMTP, QMQP" echo "" if [ ! -d %{logdir} ] ; then log_it "Creating %{logdir}" %{__mkdir_p} %{logdir} fi %{__chown} -R qmaill:nofiles %{logdir} ( %{_prefix}/sbin/svctool --config=qmail --fsync --syncdir \ --postmaster=%{qmaildir}/alias/Maildir/ | tai64n | tai64nlocal if [ %nodksignatures -eq 0 ] ; then if [ -x %{_prefix}/bin/dknewkey ] ; then ver_opt="dkim" sign_opt="dkim" key_bit=$KEYBIT # set KEYBIT in environment variable if [ " $key_bit" = " " ] ; then key_bit=1024 fi %{_prefix}/bin/dknewkey -b $key_bit %{dkimkeyfn} | tai64n | tai64nlocal else ver_opt="none" sign_opt="none" fi else ver_opt="none" sign_opt="none" fi %if %{defined suse_version} || %{defined sles_version} %if 0%{?set_permissions:1} > 0 %set_permissions %{_prefix}/sbin/qhpsi %set_permissions %{_prefix}/sbin/qmail-queue %set_permissions %{_prefix}/sbin/qscanq %set_permissions %{_prefix}/sbin/run-cleanq %set_permissions %{_prefix}/sbin/sys-checkpwd %set_permissions %{_prefix}/sbin/qmail-dkim %set_permissions %{qmaildir}/alias/ %set_permissions %{qmaildir}/autoturn/ %set_permissions %{qsysconfdir}/ %set_permissions %{qsysconfdir}/certs/ %set_permissions %{qsysconfdir}/control/ %set_permissions %{qsysconfdir}/control/cache/ %set_permissions %{qsysconfdir}/control/domainkeys/ %set_permissions %{qsysconfdir}/tcp/ %set_permissions %{qsysconfdir}/users/ %else %run_permissions %endif %endif # SMTP %ifarch x86_64 %global smtp_soft_mem 536870912 %global qmtp_soft_mem 104857600 %global qmqp_soft_mem 104857600 %global send_soft_mem 104857600 %else %global smtp_soft_mem 26214400 %global qmtp_soft_mem 26214400 %global qmqp_soft_mem 26214400 %global send_soft_mem 83886080 %endif # Define QHPSI for inline virus scanning by qmail-queue if [ -f /usr/sbin/clamd -a -f /usr/bin/clamdscan ] ; then have_clamav=1 clamdPrefix="/usr" if [ -d %{_sysconfdir}/clamav ] ; then mysysconfdir=%{_sysconfdir}/clamav elif [ -d %{_sysconfdir}/clamd.d ] ; then mysysconfdir=%{_sysconfdir}/clamd.d elif [ -d %{qsysconfdir} ] ; then mysysconfdir=%{qsysconfdir} else mysysconfdir=%{_sysconfdir} fi qhpsi="/usr/bin/clamdscan %s --config=${mysysconfdir}/scan.conf --fdpass --quiet --no-summary" # let qscand get qmail group for socket permission /usr/sbin/usermod -aG qmail qscand || true else have_clamav=0 fi # SMTP ports for port in 465 25 587 do extra_opt="" if [ $port -eq 465 ] ; then extra_opt="--skipsend --authsmtp --ssl --utf8" extra_opt="$extra_opt --rbl=-rzen.spamhaus.org --rbl=-rdnsbl-1.uceprotect.net" elif [ $port -eq 587 ] ; then extra_opt="--skipsend --forceauthsmtp --secureauth --antispoof --forcetls --utf8" else extra_opt="--remote-authsmtp=login --localfilter --remotefilter" extra_opt="$extra_opt --deliverylimit-count=-1 --deliverylimit-size=-1" extra_opt="$extra_opt --rbl=-rzen.spamhaus.org --rbl=-rdnsbl-1.uceprotect.net" extra_opt="$extra_opt --dmemory=%{send_soft_mem} --setgroups --setuser-priv --utf8" fi %if %{tcpserver_plugin} == 1 extra_opt="$extra_opt --shared-objects=1 --use-dlmopen=1" %endif if [ $have_clamav -eq 1 ] ; then extra_opt="$extra_opt --qhpsi=\"$qhpsi\"" fi eval %{_prefix}/sbin/svctool --smtp=$port --servicedir=%{servicedir} \ --qbase=%{qbase} --qcount=%{qcount} --qstart=1 \ --query-cache --dnscheck --password-cache \ --cntrldir=control --localip=0 --maxdaemons=75 --maxperip=25 --persistdb \ --starttls --memory=%{smtp_soft_mem} \ --chkrecipient --chkrelay --masquerade \ --min-free=52428800 --content-filter --virus-filter \ --dmasquerade --infifo=infifo \ --dkverify=${ver_opt} \ --dksign=${sign_opt} --private_key="%{qsysconfdir}/control/domainkeys/%/%{dkimkeyfn}" \ $extra_opt | tai64n | tai64nlocal done # queue parameters in control/defaultqueue for qmail-inject, sendmail extra_opt="" if [ $have_clamav -eq 1 ] ; then extra_opt="--qhpsi=\"$qhpsi\"" fi eval %{_prefix}/sbin/svctool --queueParam=defaultqueue \ --qbase=%{qbase} --qcount=%{qcount} --qstart=1 \ --min-free=52428800 --virus-filter \ --dkverify="none" --dksign="none" \ $extra_opt | tai64n | tai64nlocal # slowq service %{_prefix}/sbin/svctool --slowq --servicedir=%{servicedir} --qbase=%{qbase} \ --cntrldir=control --todo-proc --persistdb --starttls \ --dmemory=%{send_soft_mem} --min-free=52428800 --dkverify=${ver_opt} \ --dksign=${sign_opt} --private_key=%{qsysconfdir}/control/domainkeys/%/%{dkimkeyfn} \ --remote-authsmtp=login --localfilter --remotefilter \ --deliverylimit-count="-1" --deliverylimit-size="-1" --setgroups --setuser-priv --utf8 | tai64n | tai64nlocal # ODMR service %{_prefix}/sbin/svctool --smtp=366 --odmr --servicedir=%{servicedir} \ --forceauthsmtp --starttls --query-cache --password-cache --skipsend \ --infifo=infifo --memory=%{smtp_soft_mem} | tai64n | tai64nlocal # Greylist daemon %{_prefix}/sbin/svctool --greylist=1999 --servicedir=%{servicedir} --min-resend-min=2 \ --resend-win-hr=24 --timeout-days=30 --context-file=greylist.context \ --hash-size=65535 --save-interval=5 --whitelist=greylist.white | tai64n | tai64nlocal if [ %{notlsarr} -eq 0 ] ; then # qmail-daned tlsa daemon %{_prefix}/sbin/qmail-daned > /dev/null 2>&1 || \ (test $? -ne 100 && %{_prefix}/sbin/svctool \ --tlsa=1998 --servicedir=%{servicedir} \ --timeout-days=30 --context-file=tlsa.context \ --hash-size=65535 --save-interval=5 --whitelist=tlsa.white ) | tai64n | tai64nlocal || \ log_it "Not enabling qmail-daned service" 1>&2 fi # qmail-qmtpd service eval %{_prefix}/sbin/svctool --qmtp=209 --servicedir=%{servicedir} --qbase=%{qbase} \ --qcount=%{qcount} --qstart=1 --cntrldir=control --localip=0 --maxdaemons=75 --maxperip=25 \ --memory=%{qmtp_soft_mem} --min-free=52428800 $extra_opt | tai64n | tai64nlocal # qmail-qmqpd service eval %{_prefix}/sbin/svctool --qmqp=628 --servicedir=%{servicedir} --qbase=%{qbase} \ --qcount=%{qcount} --qstart=1 --cntrldir=control --localip=0 --maxdaemons=75 --maxperip=25 \ --memory=%{qmqp_soft_mem} --min-free=52428800 $extra_opt | tai64n | tai64nlocal touch %{servicedir}/qmail-qmqpd.628/down # virus/spam filtering %{_prefix}/sbin/svctool --qscanq --servicedir=%{servicedir} --scanint=200 | tai64n | tai64nlocal if [ $have_clamav -eq 1 ] ; then %{_prefix}/sbin/svctool --config=clamd | tai64n | tai64nlocal %{_prefix}/sbin/svctool --config=foxhole | tai64n | tai64nlocal # create clamd, freshclam service eval %{_prefix}/sbin/svctool --clamd --servicedir=%{servicedir} --clamdPrefix=$clamdPrefix \ --sysconfdir=${mysysconfdir} | tai64n | tai64nlocal if [ $have_clamav -eq 1 ] ; then log_it "Checking if clamd/freshclam is running" count=`ps -e|grep clamd|wc -l` if [ $count -gt 0 ] ; then log_it "Disabling clamd service" touch %{servicedir}/clamd/down fi count=`ps -e|grep freshclam|wc -l` if [ $count -gt 0 ] ; then log_it "Disabling freshclam service" touch %{servicedir}/freshclam/down fi fi fi %{__cat} < %{qsysconfdir}/control/signatures # Windows executables seen in active virii TVqQAAMAA: TVpQAAIAA # Additional windows executable signatures not yet seen in virii TVpAALQAc TVpyAXkAX TVrmAU4AA TVrhARwAk TVoFAQUAA TVoAAAQAA TVoIARMAA TVouARsAA TVrQAT8AA # .ZIPfile signature seen in SoBig.E and mydoom: #UEsDBBQAA:SoBig.e Virus #UEsDBAoAAA:mydoom Virus # .GIF file found in a previous Microsoft virus making the rounds. R0lGODlhaAA7APcAAP///+rp6puSp6GZrDUjUUc6Zn53mFJMdbGvvVtXh2xre8bF1x8cU4yLprOy:Virus in .gif files # http://www.gossamer-threads.com/lists/qmail/users/114447 UEsDBAoAAQAAAEBHYzCf4kJRDDAAAAAwAAAKAAAAc3ZtaXhlLmV4ZcuI1rOkjfn48VwCkMYHRTfM EOF %{__chown} qscand:qscand %{qsysconfdir}/control/signatures # udplogger service %{_prefix}/sbin/svctool --udplogger=3000 --localip=0 --timeout=10 \ --servicedir=%{servicedir} | tai64n | tai64nlocal # Recreate ld.so links and cache if [ "%{_libdir}" != "/usr/lib64" -a "%{_libdir}" != "/usr/lib" ] ; then if [ -d %{_sysconfdir}/ld.so.conf.d ] ; then echo %{_libdir} > %{_sysconfdir}/ld.so.conf.d/indimail-%{_arch}.conf fi /sbin/ldconfig fi # rebuild cdb for i in smtp qmtp qmqp do for j in `/bin/ls %{qsysconfdir}/tcp/tcp*.$i 2>/dev/null` do t1=`date +'%s' -r $j` if [ -f $j.cdb ] ; then t2=`date +'%s' -r $j.cdb` else t2=0 fi if [ $t1 -gt $t2 ] ; then log_it "Creating CDB $j.cdb" %{_prefix}/bin/tcprules $j.cdb $j.tmp < $j && /bin/chmod 664 $j.cdb \ && chown indimail:indimail $j.cdb fi done done # turn off automatic refresh for services during first time installation svc_list="" for i in clamd greylist.1999 qmail-qmqpd.628 \ qmail-qmtpd.209 qmail-smtpd.25 qmail-smtpd.366 \ qmail-smtpd.465 qmail-smtpd.587 qscanq udplogger.3000 \ qmail-daned.1998 qmail-send.25 slowq-send qmail-logfifo do if [ ! -d %{servicedir}/$i ] ; then continue fi svc_list="$svc_list %{servicedir}/$i" # save variables %{_prefix}/sbin/svctool --servicedir=%{servicedir} --service-name=$i \ --export-variables=%{servicedir}/$i/variables/.variables --force | tai64n | tai64nlocal done svc_list="$svc_list %{qsysconfdir}/control/defaultqueue" %{_prefix}/sbin/svctool --servicedir=%{servicedir} --autorefresh="0 $svc_list" | tai64n | tai64nlocal # selinux %{_prefix}/sbin/svctool --servicedir=%{servicedir} --config=qselinux | tai64n | tai64nlocal log_it "configuring indimail-mta as alternatives" %{_prefix}/sbin/svctool --config=add-alt | tai64n | tai64nlocal if [ -f %{qsysconfdir}/indimail-mta.cron -a -d %{_sysconfdir}/cron.d ] ; then log_it "adding cron entries" %{__cp} %{qsysconfdir}/indimail-mta.cron %{_sysconfdir}/cron.d fi if [ -f %{libexecdir}/qupgrade ] ; then log_it "Running Custom Installation Script for post install" /bin/sh %{libexecdir}/qupgrade post install %{version} $* | tai64n | tai64nlocal fi ) >> /var/log/%{name}-setup.log 2>&1 if [ -f %{_sysconfdir}/init/svscan.conf -o -f %{_sysconfdir}/event.d/svscan ] ; then echo "1. Execute /sbin/initctl emit qmailstart to start services" count=1 elif [ -f %{_sysconfdir}/systemd/system/multi-user.target.wants/svscan.service ] ; then echo "1. Execute /bin/systemctl start svscan to start services" count=1 else if [ -f %{_prefix}/sbin/initsvc ] ; then echo "1. Execute %{_prefix}/sbin/initsvc -on" elif [ -f %{_sysconfdir}/init.d/svscan ] ; then echo "1. Execute %{_sysconfdir}/init.d/svscan start" else echo "1. Execute /sbin/init q to start services" fi count=2 fi default_domain=$(echo $([ -n "$HOSTNAME" ] && echo "$HOSTNAME" || uname -n) | sed 's/^\([^\.]*\)\.\([^\.]*\)\./\2\./') count=`expr $count + 1` echo "$count. Change your default domain in %{qsysconfdir}/control/defaultdomain" count=`expr $count + 1` echo "$count. You can optionally run the following command to verify installation" echo " sudo rpm -V indimail" if [ ! -f %{qsysconfdir}/certs/servercert.pem ] ; then count=`expr $count + 1` echo "$count. You need to create CERTS for SSL/TLS/STARTTLS" echo " Execute the following command to create the certificate" echo " %{_prefix}/sbin/svctool --config=cert --postmaster=postmaster@$default_domain --common_name=$default_domain" fi echo log_it "Look at /var/log/%{name}-setup.log for the installation log" ### SCRIPTLET ############################################################################### %preun %log argv1=$1 ( if [ -z "$argv1" ] ; then argv1=0 fi # we are doing upgrade if [ $argv1 -eq 1 ] ; then ( if [ -f %{libexecdir}/qupgrade ] ; then log_it "Running Custom Un-Installation Script for preun upgrade" /bin/sh %{libexecdir}/qupgrade preun upgrade %{version} "$argv1" | tai64n | tai64nlocal fi ) >> /var/log/%{name}-setup.log 2>&1 exit 0 fi if [ -f %{libexecdir}/qupgrade ] ; then log_it "Running Custom Un-Installation Script for preun pre-uninstall" /bin/sh %{libexecdir}/qupgrade preun uninstall %{version} "$argv1" | tai64n | tai64nlocal fi log_it "shutting down and removing indimail-mta/indimail-mta-log services" for i in qmail-send.25 qmail-smtpd.25 qmail-smtpd.366 \ slowq-send qscanq qmail-smtpd.465 qmail-smtpd.587 \ qmail-qmtpd.209 qmail-qmqpd.628 greylist.1999 \ qmail-daned.1998 resolvconf udplogger.3000 do if [ -d %{servicedir}/$i -o -L %{servicedir}/$i ] ; then touch %{servicedir}/$i/down %{_prefix}/bin/svc -dx %{servicedir}/$i fi if [ -d %{servicedir}/$i/log -o -L %{servicedir}/$i/log ] ; then touch %{servicedir}/$i/log/down %{_prefix}/bin/svc -dx %{servicedir}/$i/log fi if [ -d %{servicedir}/$i -o -L %{servicedir}/$i ] ; then %{__rm} -rf %{servicedir}/$i || true fi done if [ -f %{_sysconfdir}/init.d/sendmail ] ; then if [ -f /sbin/chkconfig ] ; then /sbin/chkconfig --add sendmail fi fi log_it "removing indimail-mta as alternatives" %{_prefix}/sbin/svctool --config=remove-alt | tai64n | tai64nlocal ) >> /var/log/%{name}-setup.log 2>&1 ### SCRIPTLET ############################################################################### %postun %log argv1=$1 if [ -z "$argv1" ] ; then argv1=0 fi # we are doing upgrade if [ $argv1 -eq 1 ] ; then if [ -f %{libexecdir}/qupgrade ] ; then ( log_it "Running Custom Un-Installation Script for postun upgrade" /bin/sh %{libexecdir}/qupgrade postun upgrade %{version} $* | tai64n | tai64nlocal ) >> /var/log/%{name}-setup.log fi if [ "%{_libdir}" != "/usr/lib64" -a "%{_libdir}" != "/usr/lib" ] ; then log_it "recreating ld.so cache" /sbin/ldconfig fi exit 0 fi ( # remove users / groups nscd_up=`ps -ef |grep nscd |grep -v grep|wc -l` if [ $nscd_up -ge 1 ] ; then if [ -x %{_sysconfdir}/init.d/nscd ] ; then %{_sysconfdir}/init.d/nscd stop elif [ -f %{_sysconfdir}/systemd/system/multi-user.target/nscd.service ] ; then /bin/systemctl stop nscd.service >/dev/null 2>&1 fi fi for i in alias qmaild qmailp qmailq qmailr qmails qscand indimail do log_it "Removing user $i" /usr/bin/getent passwd $i > /dev/null && /usr/sbin/userdel $i >/dev/null || true done for i in qmail qscand indimail qcerts do log_it "Removing group $i" /usr/bin/getent group $i > /dev/null && /usr/sbin/groupdel $i >/dev/null || true done if [ $nscd_up -ge 1 ] ; then if [ -x %{_sysconfdir}/init.d/nscd ] ; then %{_sysconfdir}/init.d/nscd start elif [ -f %{_sysconfdir}/systemd/system/multi-user.target/nscd.service ] ; then /bin/systemctl start nscd.service >/dev/null 2>&1 fi fi for i in postmaster mailer-daemon root ham spam register-ham register-spam do %{__rm} -f %{qmaildir}/alias/.qmail-"$i" done %{__rm} -rf %{qmaildir}/alias/Maildir log_it "removing svscan supervised startup services" if [ -f /usr/sbin/clamd -a -f /usr/bin/clamdscan ] ; then for i in clamd freshclam do %{_prefix}/bin/svc -dx %{servicedir}/$i %{servicedir}/$i/log if [ -d %{servicedir}/$i ] ; then %{__rm} -rf %{servicedir}/$i || true elif [ -L %{servicedir}/$i ] ; then %{__rm} -rf %{servicedir}/$i || true fi done fi count=`/bin/ls %{servicedir} 2>/dev/null| /usr/bin/wc -l` if [ $count -eq 0 ] ; then # ignore disabled services %{__rm} -rf %{servicedir} || true fi if [ -d %{_sysconfdir}/cron.d ] ; then log_it "removing cron entries" %{__rm} -f %{_sysconfdir}/cron.d/indimail-mta.cron fi log_it "removing logs" for i in deliver.25 greylist.1999 qmqpd.628 qmtpd.209 \ qscanq smtpd.25 smtpd.366 smtpd.465 smtpd.587 \ daned.1998 resolvconf udplogger.3000 slowq-send \ logfifo do if [ -d ${logdir}/$i ] ; then %{__rm} -fr %{logdir}/$i fi done if [ "%{_libdir}" != "/usr/lib64" -a "%{_libdir}" != "/usr/lib" ] ; then log_it "recreating ld.so cache" /sbin/ldconfig fi #selinux if [ -x /usr/sbin/selinuxenabled ] ; then /usr/sbin/selinuxenabled if [ $? -eq 0 -a -x /usr/sbin/semodule ] ; then log_it "disabling selinux module" /usr/sbin/semodule -r indimail-mta | tai64n | tai64nlocal fi fi if [ -f %{libexecdir}/qupgrade ] ; then log_it "Running Custom Un-Installation Script for postun uninstall" /bin/sh %{libexecdir}/qupgrade postun uninstall %{version} $* | tai64n | tai64nlocal fi ) >> /var/log/%{name}-setup.log 2>&1 ### SCRIPTLET ############################################################################### %posttrans %log argv1=$1 if [ -f %{libexecdir}/qupgrade ] ; then ( log_it "Running Custom Installation Script for posttrans" /bin/sh %{libexecdir}/qupgrade posttrans noargs %{version} $* | tai64n | tai64nlocal ) >> /var/log/%{name}-setup.log 2>&1 fi %verifyscript -n indimail-mini ID=$(id -u) if [ $ID -ne 0 ] ; then echo "You are not root" 1>&2 exit 1 fi %if %{defined suse_version} || %{defined sles_version} %verify_permissions -e %{qsysconfdir}/ %verify_permissions -e %{qsysconfdir}/control/ %endif %pre -n indimail-mini %log argv1=$1 if [ -z "$argv1" ] ; then argv1=0 fi # we are doing upgrade if [ $argv1 -eq 2 ] ; then exit 0 fi ( %{__rm} -f /var/spool/mail/indimail # # Create user/groups indimail. Do not report any problems if it already # exists. # nscd_up=`ps -ef |grep nscd |grep -v grep|wc -l` if [ $nscd_up -ge 1 ] ; then if [ -x %{_sysconfdir}/init.d/nscd ] ; then %{_sysconfdir}/init.d/nscd stop elif [ -f %{_sysconfdir}/systemd/system/multi-user.target/nscd.service ] ; then /bin/systemctl stop nscd.service >/dev/null 2>&1 fi fi log_it "Adding IndiMail users/groups" /usr/bin/getent group indimail > /dev/null || /usr/sbin/groupadd -r -g 555 indimail || true if [ $? = 4 ] ; then /usr/sbin/groupadd indimail fi /usr/bin/getent group qmail > /dev/null || /usr/sbin/groupadd qmail || true /usr/bin/getent passwd indimail > /dev/null || /usr/sbin/useradd -r -g indimail -u 555 -d %{qmaildir} indimail || true if [ $? = 4 ] ; then /usr/sbin/useradd -r -g indimail -d %{qmaildir} indimail fi if [ $nscd_up -ge 1 ] ; then if [ -x %{_sysconfdir}/init.d/nscd ] ; then %{_sysconfdir}/init.d/nscd start elif [ -f %{_sysconfdir}/systemd/system/multi-user.target/nscd.service ] ; then /bin/systemctl start nscd.service >/dev/null 2>&1 fi fi ) >> /var/log/%{name}-setup.log %post -n indimail-mini %log argv1=$1 if [ -z "$argv1" ] ; then argv1=0 fi # we are doing upgrade if [ $argv1 -eq 2 ] ; then exit 0 fi ( %if %{defined suse_version} || %{defined sles_version} %if 0%{?set_permissions:1} > 0 %set_permissions %{qsysconfdir}/control/ %else %run_permissions %endif %endif if [ -f %{_prefix}/sbin/qmail-qmqpc ] ; then %{__mkdir_p} %{qsysconfdir}/control/defaultqueue echo "%{_prefix}/sbin/qmail-qmqpc" > %{qsysconfdir}/control/defaultqueue/QMAILQUEUE fi if [ -f %{_sysconfdir}/init.d/sendmail ] ; then %{_sysconfdir}/init.d/sendmail stop if [ -f /sbin/chkconfig ] ; then /sbin/chkconfig --del sendmail fi fi move="/usr/lib/sendmail" if [ -L /usr/sbin ] ; then link=$(readlink /usr/sbin) if [ ! " $link" = " bin" -a ! " $link" = " /usr/sbin" ] ; then move="$move /usr/sbin/sendmail" fi else move="$move /usr/sbin/sendmail" fi if [ -f %{_sysconfdir}/pam.d/smtp -a ! -L %{_sysconfdir}/pam.d/smtp ] ; then echo "! %{_sysconfdir}/pam.d/smtp is a file, should be a link" 1>&2 %{__mv} %{_sysconfdir}/pam.d/smtp %{_sysconfdir}/pam.d/smtp.old fi for i in mailq newaliases; do if [ -f %{mandir}/man1/$i.1.xz ] ; then ext="xz" else ext="gz" fi if [ -f %{mandir}/man1/$i.1."$ext" -a ! -L %{mandir}/man1/$i.1."$ext" ] ; then echo "! %{mandir}/man1/$i.1.$ext is a file, should be a link" 1>&2 %{__mv} %{mandir}/man1/$i.1."$ext" %{mandir}/man1/$i.old.1."$ext" fi done log_it "configuring indimail-mini as alternatives" if [ -x /usr/sbin/alternatives ] ; then alternatives_cmd=/usr/sbin/alternatives elif [ -x /usr/sbin/update-alternatives ] ; then alternatives_cmd=/usr/sbin/update-alternatives else alternatives_cmd="" fi if [ -n "$alternatives_cmd" ] ; then for i in $move; do if [ -f $i -a ! -L $i ]; then echo "! $i is a file, should be a link" 1>&2 %{__mv} $i $i.old fi done if [ -f %{mandir}/man8/isendmail.8.xz ] ; then ext="xz" else ext="gz" fi $alternatives_cmd --install \ /usr/sbin/sendmail mta %{_prefix}/bin/sendmail 120 \ --slave %{mandir}/man8/sendmail.8."$ext" mta-sendmailman \ %{mandir}/man8/isendmail.8."$ext" \ --slave /usr/lib/sendmail mta-sendmail %{_prefix}/bin/sendmail \ $alternatives_cmd --set mta %{_prefix}/bin/sendmail else for i in $move; do if [ -f $i -a ! -L $i ]; then echo "! $i is a file, should be a link" 1>&2 %{__mv} $i $i.old /bin/ln -s %{_prefix}/bin/sendmail $i elif [ -L $i ];then %{__mv} $i $i.old /bin/ln -s %{_prefix}/bin/sendmail $i elif [ ! -f $i ];then echo "! $i is missing" /bin/ln -s %{_prefix}/bin/sendmail $i fi done fi # a copy of following control files from your central server # /etc/indimail/control/me # /etc/indimail/control/defaultdomain, # /etc/indimail/control/plusdomain # so that qmail-inject uses appropriate host names in outgoing mail; and # this host's name in /etc/indimail/control/idhost, so that qmail-inject # generates Message-ID without any risk of collision if [ ! -f %{qsysconfdir}/control/idhost ] ; then default_host=$([ -n "$HOSTNAME" ] && echo "$HOSTNAME" || uname -n) echo $default_host > %{qsysconfdir}/control/idhost fi if [ "%{_libdir}" != "/usr/lib64" -a "%{_libdir}" != "/usr/lib" ] ; then log_it "recreating ld.so cache" /sbin/ldconfig fi ) >> /var/log/%{name}-setup.log %postun -n indimail-mini %log argv1=$1 if [ -z "$argv1" ] ; then argv1=0 fi # we are doing upgrade if [ $argv1 -eq 1 ] ; then ( if [ -f %{libexecdir}/qupgrade ] ; then log_it "Running Custom Un-Installation Script for postun upgrade" /bin/sh %{libexecdir}/qupgrade postun upgrade %{version} $* | tai64n | tai64nlocal fi ) >> /var/log/%{name}-setup.log if [ "%{_libdir}" != "/usr/lib64" -a "%{_libdir}" != "/usr/lib" ] ; then log_it "recreating ld.so cache" /sbin/ldconfig fi exit 0 fi ( log_it "removing indimail-mini as alternatives" if [ -x /usr/sbin/alternatives ] ; then alternatives_cmd=/usr/sbin/alternatives elif [ -x /usr/sbin/update-alternatives ] ; then alternatives_cmd=/usr/sbin/update-alternatives else alternatives_cmd="" fi if [ -n $alternatives_cmd ] ; then $alternatives_cmd --remove mta %{_prefix}/bin/sendmail $alternatives_cmd --auto mta for i in /usr/lib/sendmail /usr/sbin/sendmail %{_sysconfdir}/pam.d/smtp; do if [ -f $i.old -o -L $i.old ]; then log_it "restoring $i" %{__mv} $i.old $i fi done else if [ -f %{_sysconfdir}/init.d/sendmail ] ; then if [ -f /sbin/chkconfig ] ; then /sbin/chkconfig --add sendmail echo "to start sendmail, issue" echo "%{_sysconfdir}/init.d/sendmail start" fi fi fi for i in /usr/lib/sendmail /usr/sbin/sendmail %{_sysconfdir}/pam.d/smtp; do if [ -f $i.old -o -L $i.old ]; then log_it "restoring $i" %{__mv} $i.old $i fi done for i in mailq newaliases; do if [ -f %{mandir}/man1/$i.old.1.xz ] ; then ext="xz" else ext="gz" fi if [ -f %{mandir}/man1/$i.old.1."$ext" ] ; then log_it "restoring %{mandir}/man1/$i.1.$ext" %{__mv} %{mandir}/man1/$i.old.1."$ext" %{mandir}/man1/$i.1."$ext" fi done if [ "%{_libdir}" != "/usr/lib64" -a "%{_libdir}" != "/usr/lib" ] ; then log_it "recreating ld.so cache" /sbin/ldconfig fi log_it "removing user indimail" /usr/bin/getent passwd indimail > /dev/null && /usr/sbin/userdel indimail >/dev/null || true for i in indimail qmail ; do log_it "removing group $i" /usr/bin/getent group $i > /dev/null && /usr/sbin/groupdel $i >/dev/null || true done if [ $nscd_up -ge 1 ] ; then if [ -x %{_sysconfdir}/init.d/nscd ] ; then %{_sysconfdir}/init.d/nscd start elif [ -f %{_sysconfdir}/systemd/system/multi-user.target/nscd.service ] ; then /bin/systemctl start nscd.service >/dev/null 2>&1 fi fi for i in idhost defaulthost defaultdomain plusdomain do %{__rm} -f %{qsysconfdir}/control/$i || true done rmdir --ignore-fail-on-non-empty %{qsysconfdir} 2>/dev/null || true %if "%{_prefix}" != "/usr" for i in bin sbin share/indimail do rmdir --ignore-fail-on-non-empty %{_prefix}/$i 2>/dev/null || true done rmdir --ignore-fail-on-non-empty %{_prefix} 2>/dev/null || true %endif ) >> /var/log/%{name}-setup.log %verifyscript -n qmta ID=$(id -u) if [ $ID -ne 0 ] ; then echo "You are not root" 1>&2 exit 1 fi %if %{defined suse_version} || %{defined sles_version} %verify_permissions -e %{_prefix}/sbin/qhpsi %verify_permissions -e %{_prefix}/sbin/qmail-queue %verify_permissions -e %{qsysconfdir}/ %verify_permissions -e %{qsysconfdir}/control/ %verify_permissions -e %{qsysconfdir}/users/ %endif %pretrans -n qmta %log %log if [ -d /run ] ; then rundir=/run/qmta else rundir=/var/run/qmta fi log_it "Giving qmta-send exactly 5 seconds to exit nicely" count=$(ps -ef|grep qmta-send|grep -v grep|wc -l) if [ $count -gt 0 ] ; then mkdir -p $rundir touch $rundir/.qmta-send.down else %{__rm} -f $rundir/.qmta-send.down fi if test -f %{_sysconfdir}/systemd/system/multi-user.target.wants/qmta-send.service then /bin/systemctl stop qmta-send >/dev/null 2>&1 elif test -x %{_sysconfdir}/init.d/qmta-send then %{_sysconfdir}/init.d/qmta-send stop fi sleep 5 %pre -n qmta %log argv1=$1 if [ -z "$argv1" ] ; then argv1=0 fi # we are doing upgrade if [ $argv1 -eq 2 ] ; then ( if [ -d /run ] ; then rundir=/run/qmta else rundir=/var/run/qmta fi mkdir -p $rundir log_it "checking if system boot scripts need upgrade" if [ -x /bin/systemctl -a -d /lib/systemd/system ] ; then cmp -s %{shareddir}/boot/qmta-send.service /lib/systemd/system/qmta-send.service >/dev/null 2>&1 if [ $? -ne 0 ] ; then %{__cp} %{shareddir}/boot/qmta-send.service /lib/systemd/system/qmta-send.service /bin/systemctl daemon-reload fi elif [ -x /bin/systemctl -a -d /usr/lib/systemd/system ] ; then cmp -s %{shareddir}/boot/qmta-send.service /usr/lib/systemd/system/qmta-send.service >/dev/null 2>&1 if [ $? -ne 0 ] ; then %{__cp} %{shareddir}/boot/qmta-send.service /usr/lib/systemd/system/qmta-send.service /bin/systemctl daemon-reload fi fi # restart svscan service if we find $rundir/.qmta-send.down if [ -f $rundir/.qmta-send.down ] ; then %{__rm} -f $rundir/.qmta-send.down log_it "Starting qmta-send" if test -f %{_sysconfdir}/systemd/system/multi-user.target.wants/qmta-send.service then /bin/systemctl start qmta-send >/dev/null 2>&1 fi fi ) >> /var/log/qmta-setup.log 2>&1 exit 0 fi ( # # Create user/groups. Do not report any problems if it already # exists. # nscd_up=`ps -ef |grep nscd |grep -v grep|wc -l` if [ $nscd_up -ge 1 ] ; then if [ -x %{_sysconfdir}/init.d/nscd ] ; then %{_sysconfdir}/init.d/nscd stop elif [ -f %{_sysconfdir}/systemd/system/multi-user.target/nscd.service ] ; then /bin/systemctl stop nscd.service >/dev/null 2>&1 fi fi log_it "Adding IndiMail users/groups" /usr/bin/getent group indimail > /dev/null || /usr/sbin/groupadd -r -g 555 indimail || true if [ $? = 4 ] ; then /usr/sbin/groupadd indimail fi /usr/bin/getent group nofiles > /dev/null || /usr/sbin/groupadd nofiles || true /usr/bin/getent group qmail > /dev/null || /usr/sbin/groupadd qmail || true /usr/bin/getent group qscand > /dev/null || /usr/sbin/groupadd qscand || true /usr/bin/getent passwd indimail > /dev/null || /usr/sbin/useradd -r -g indimail -u 555 -d %{qmaildir} indimail || true if [ $? = 4 ] ; then /usr/sbin/useradd -r -g indimail -d %{qmaildir} indimail fi /usr/bin/getent passwd alias > /dev/null || /usr/sbin/useradd -M -g nofiles -d %{qmaildir}/alias -s /sbin/nologin alias || true /usr/bin/getent passwd qmailq > /dev/null || /usr/sbin/useradd -M -g qmail -d %{qmaildir} -s /sbin/nologin qmailq || true /usr/bin/getent passwd qmailr > /dev/null || /usr/sbin/useradd -M -g qmail -d %{qmaildir} -s /sbin/nologin qmailr || true /usr/bin/getent passwd qmails > /dev/null || /usr/sbin/useradd -M -g qmail -d %{qmaildir} -s /sbin/nologin qmails || true /usr/bin/getent passwd qscand > /dev/null || /usr/sbin/useradd -M -g qscand -d %{qmaildir}/qscanq -G qmail,qscand -s /sbin/nologin qscand || true if [ $nscd_up -ge 1 ] ; then if [ -x %{_sysconfdir}/init.d/nscd ] ; then %{_sysconfdir}/init.d/nscd start elif [ -f %{_sysconfdir}/systemd/system/multi-user.target/nscd.service ] ; then /bin/systemctl start nscd.service >/dev/null 2>&1 fi fi ) >> /var/log/%{name}-setup.log %post -n qmta %log argv1=$1 if [ -z "$argv1" ] ; then argv1=0 fi if [ $argv1 -eq 2 ] ; then # upgrade exit 0 fi ( %if %{defined suse_version} || %{defined sles_version} %if 0%{?set_permissions:1} > 0 %set_permissions %{_prefix}/sbin/qhpsi %set_permissions %{_prefix}/sbin/qmail-queue %set_permissions %{qsysconfdir}/control/ %set_permissions %{qsysconfdir}/users/ %else %run_permissions %endif %endif if [ ! -f %{qsysconfdir}/control/idhost ] ; then default_host=$([ -n "$HOSTNAME" ] && echo "$HOSTNAME" || uname -n) echo $default_host > %{qsysconfdir}/control/idhost fi if [ ! -f %{qsysconfdir}/control/defaultqueue/QMAILQUEUE ] ; then %{__mkdir_p} %{qsysconfdir}/control/defaultqueue echo "%{_prefix}/sbin/qmail-queue" > %{qsysconfdir}/control/defaultqueue/QMAILQUEUE fi if [ ! -d%{qmaildir}/queue/qmta ] ; then queue-fix -m %{qmaildir}/queue/qmta fi if [ ! -f %{qsysconfdir}/control/defaultqueue/QUEUEDIR ] ; then %{__mkdir_p} %{qsysconfdir}/control/defaultqueue echo %{qmaildir}/queue/qmta > %{qsysconfdir}/control/defaultqueue/QUEUEDIR fi if [ -f %{_sysconfdir}/init.d/sendmail ] ; then %{_sysconfdir}/init.d/sendmail stop if [ -f /sbin/chkconfig ] ; then /sbin/chkconfig --del sendmail fi fi move="/usr/lib/sendmail" if [ -L /usr/sbin ] ; then link=$(readlink /usr/sbin) if [ ! " $link" = " bin" -a ! " $link" = " /usr/sbin" ] ; then move="$move /usr/sbin/sendmail" fi else move="$move /usr/sbin/sendmail" fi log_it "configuring qmta as alternatives" if [ -x /usr/sbin/alternatives ] ; then alternatives_cmd=/usr/sbin/alternatives elif [ -x /usr/sbin/update-alternatives ] ; then alternatives_cmd=/usr/sbin/update-alternatives else alternatives_cmd="" fi if [ -n "$alternatives_cmd" ] ; then for i in $move; do if [ -f $i -a ! -L $i ]; then echo "! $i is a file, should be a link" 1>&2 %{__mv} $i $i.old fi done for i in mailq newaliases; do if [ -f %{mandir}/man1/$i.1.xz ] ; then ext="xz" else ext="gz" fi if [ -f %{mandir}/man1/$i.1."$ext" -a ! -L %{mandir}/man1/$i.1."$ext" ] ; then echo "! %{mandir}/man1/$i.1.$ext is a file, should be a link" 1>&2 %{__mv} %{mandir}/man1/$i.1."$ext" %{mandir}/man1/$i.old.1."$ext" fi done if [ -f %{_sysconfdir}/pam.d/smtp -a ! -L %{_sysconfdir}/pam.d/smtp ] ; then echo "! %{_sysconfdir}/pam.d/smtp is a file, should be a link" 1>&2 %{__mv} %{_sysconfdir}/pam.d/smtp %{_sysconfdir}/pam.d/smtp.old fi if [ -f %{mandir}/man8/isendmail.8.xz ] ; then ext="xz" else ext="gz" fi $alternatives_cmd --install \ /usr/sbin/sendmail mta %{_prefix}/bin/sendmail 120 \ --slave %{mandir}/man8/sendmail.8."$ext" mta-sendmailman \ %{mandir}/man8/isendmail.8."$ext" \ --slave /usr/lib/sendmail mta-sendmail %{_prefix}/bin/sendmail \ --slave /usr/bin/rmail mta-rmail %{_prefix}/bin/irmail $alternatives_cmd --set mta %{_prefix}/bin/sendmail else for i in $move; do if [ -f $i -a ! -L $i ]; then echo "! $i is a file, should be a link" 1>&2 %{__mv} $i $i.old /bin/ln -s %{_prefix}/bin/sendmail $i elif [ -L $i ];then %{__mv} $i $i.old /bin/ln -s %{_prefix}/bin/sendmail $i elif [ ! -f $i ];then echo "! $i is missing" /bin/ln -s %{_prefix}/bin/sendmail $i fi done if [ -f %{_sysconfdir}/pam.d/smtp -a ! -L %{_sysconfdir}/pam.d/smtp ] ; then echo "! %{_sysconfdir}/pam.d/smtp is a file, should be a link" 1>&2 %{__mv} %{_sysconfdir}/pam.d/smtp %{_sysconfdir}/pam.d/smtp.old /bin/ln -s %{_sysconfdir}/pam.d/pam.multi %{_sysconfdir}/pam.d/smtp fi for i in mailq newaliases; do if [ -f %{mandir}/man1/$i.1.xz ] ; then ext="xz" else ext="gz" fi if [ -f %{mandir}/man1/$i.1."$ext" -a ! -L %{mandir}/man1/$i.1."$ext" ] ; then echo "! %{mandir}/man1/$i.1.$ext is a file, should be a link" 1>&2 %{__mv} %{mandir}/man1/$i.1."$ext" %{mandir}/man1/$i.old.1."$ext" fi done fi ) >> /var/log/%{name}-setup.log %preun -n qmta %log argv1=$1 ( if [ -z "$argv1" ] ; then argv1=0 fi # we are doing upgrade if [ $argv1 -eq 1 ] ; then exit 0 fi log_it "Giving qmta-send exactly 5 seconds to exit nicely" if test -f %{_sysconfdir}/systemd/system/multi-user.target.wants/qmta-send.service then /bin/systemctl stop qmta-send >/dev/null 2>&1 fi sleep 5 ) >> /var/log/qmta-setup.log 2>&1 %postun -n qmta %log argv1=$1 if [ -z "$argv1" ] ; then argv1=0 fi # we are doing upgrade if [ $argv1 -eq 1 ] ; then ( if [ -f %{libexecdir}/qupgrade ] ; then log_it "Running Custom Un-Installation Script for postun upgrade" /bin/sh %{libexecdir}/qupgrade postun upgrade %{version} $* | tai64n | tai64nlocal fi ) >> /var/log/%{name}-setup.log if [ "%{_libdir}" != "/usr/lib64" -a "%{_libdir}" != "/usr/lib" ] ; then log_it "recreating ld.so cache" /sbin/ldconfig fi exit 0 fi ( log_it "removing qmta as alternatives" if [ -x /usr/sbin/alternatives ] ; then alternatives_cmd=/usr/sbin/alternatives elif [ -x /usr/sbin/update-alternatives ] ; then alternatives_cmd=/usr/sbin/update-alternatives else alternatives_cmd="" fi if [ -n $alternatives_cmd ] ; then $alternatives_cmd --remove mta %{_prefix}/bin/sendmail $alternatives_cmd --auto mta for i in /usr/lib/sendmail /usr/sbin/sendmail %{_sysconfdir}/pam.d/smtp; do if [ -f $i.old -o -L $i.old ]; then log_it "restoring $i" %{__mv} $i.old $i fi done else if [ -f %{_sysconfdir}/init.d/sendmail ] ; then if [ -f /sbin/chkconfig ] ; then /sbin/chkconfig --add sendmail echo "to start sendmail, issue" echo "%{_sysconfdir}/init.d/sendmail start" fi fi fi for i in /usr/lib/sendmail /usr/sbin/sendmail %{_sysconfdir}/pam.d/smtp; do if [ -f $i.old -o -L $i.old ]; then log_it "restoring $i" %{__mv} $i.old $i fi done for i in mailq newaliases; do if [ -f %{mandir}/man1/$i.old.1.xz ] ; then ext="xz" else ext="gz" fi if [ -f %{mandir}/man1/$i.old.1."$ext" ] ; then log_it "restoring %{mandir}/man1/$i.1.$ext" %{__mv} %{mandir}/man1/$i.old.1."$ext" %{mandir}/man1/$i.1."$ext" fi done if [ "%{_libdir}" != "/usr/lib64" -a "%{_libdir}" != "/usr/lib" ] ; then log_it "recreating ld.so cache" /sbin/ldconfig fi for i in indimail alias qmailq qmailr qmails qscand; do log_it "removing user $i" /usr/bin/getent passwd $i > /dev/null && /usr/sbin/userdel $i >/dev/null || true done for i in indimail nofiles qmail qscand; do log_it "removing group $i" /usr/bin/getent group $i > /dev/null && /usr/sbin/groupdel $i >/dev/null || true done if [ $nscd_up -ge 1 ] ; then if [ -x %{_sysconfdir}/init.d/nscd ] ; then %{_sysconfdir}/init.d/nscd start elif [ -f %{_sysconfdir}/systemd/system/multi-user.target/nscd.service ] ; then /bin/systemctl start nscd.service >/dev/null 2>&1 fi fi for i in idhost defaulthost defaultdomain plusdomain do %{__rm} -f %{qsysconfdir}/control/$i || true done %if "%{_prefix}" != "/usr" for i in bin sbin libexecdir/indimail lib/indimail share/indimail do %{__rm} -rf %{_prefix}/$i || true done rmdir --ignore-fail-on-non-empty %{_prefix} 2>/dev/null || true %endif rmdir --ignore-fail-on-non-empty %{qsysconfdir} 2>/dev/null || true ) >> /var/log/%{name}-setup.log # fix changelog for openSUSE buildservice %changelog * Tue Dec 24 2024 03:33:29 +0000 Manvendra Bhangui 3.0.9-1.1%{?dist} Release 3.0.9-1.1 Start 08/08/2024 End XX/XX/XXXX - svctool: fixed mariadb db creation for mariadb 11.x on archlinux - queue-fix.c: bug - tcpto buffer size was unitialized - svctool: fixed uid/gid for qmail-poppass to run under qmaild:indimail - svctool: fix STARTTLS issue for imap port 143, pop3 port 110 permission reading servercert.pem. Run with qcerts gid - qmail-poppass.c: ensure qmail-poppass runs with qmaild:indimail privileges - qscheduler: prevent restart of qmail-send on receipt of SIGTERM - svctool: umount resolv.conf only when UNSHARE variable is set and /etc/indimail/resolv.conf exists - smtpd.c: fixed spf error message display in err_spf() - smtpd.c: display command name in err_unimpl()