Name: qmail Version: 1.03+patches Release: 18_compeng Group: Networking/Daemons URL: http://www.qmail.org/ Copyright: Check with djb@koobera.math.uic.edu Packager: Bruce Guenter , Blair Lowe Source0: http://cr.yp.to/qmail/qmail-1.03.tar.gz Source1: qmail-rhinit.tar.gz Source2: dot.qmail-msglog Source3: syncdir.c Source4: cron.hourly Source5: http://cr.yp.to/checkpassword/checkpassword-0.90.tar.gz Patch0: qmail-1.03-msglog.patch Patch1: qmail-1.03-condredirect.patch Patch2: qmail-1.03-showctl.patch Patch3: qmail-1.03-bind-interface.patch Patch4: http://www.qmail.org/big-todo.103.patch Patch5: qmail-1.03-install-path-big-todo.patch Patch6: qmail-1.03-autouidgid.patch Patch7: qmail-1.03-syncdir.patch Patch8: qmail-1.03-pop3d-stat.patch Patch9: qmail-1.03-queuevar.patch Patch10: qmail-1.03-big-dns.patch Patch11: big-concurrency.patch Patch12: qmail-1.03-qmtpc.patch Summary: Qmail Mail Transfer Agent Provides: MTA Provides: smtpdaemon Provides: pop3daemon Provides: qmtpdaemon Provides: qmqpdaemon Conflicts: sendmail Conflicts: qmail-cyclog Obsoletes: qmail-utils Obsoletes: qmail-pop3d Obsoletes: qmail-qmqpd Obsoletes: qmail-qmtpd Obsoletes: qmail-smtpd BuildRoot: /tmp/qmail-root Requires: initscripts Requires: net-tools Requires: sh-utils Requires: shadow-utils Requires: supervise-scripts >= 3.2 Requires: ucspi-unix Requires: ucspi-tcp >= 0.86-1 %description Qmail is a small, fast, secure replacement for the sendmail package, which is the program that actually receives, routes, and delivers electronic mail. *** Note: Be sure and read the documentation as there are some small but very significant differences between sendmail and qmail and the programs that interact with them. The source for this RPM can be found at: http://em.ca/~bruceg/qmail+patches/ This package includes a local-domain daemon used to provide non-privileged users access to the results from the mailq command. %prep %setup -n qmail-1.03 %patch0 -p1 %patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 %patch5 -p1 %patch6 -p1 %patch7 -p1 %patch8 -p1 %patch9 -p1 %patch10 -p1 %patch11 -p1 %patch12 -p1 fds=`ulimit -n` let spawnlimit='(fds-6)/2' echo $spawnlimit >conf-spawn tar -xzf %{SOURCE1} for source in cron.hourly dot.qmail-msglog syncdir.c; do cp $RPM_SOURCE_DIR/$source . done tar -xzf %{SOURCE5} %build make compile makelib ./compile syncdir.c ./makelib libsyncdir.a syncdir.o make it man pushd qmail-rhinit make "CFLAGS=$RPM_OPT_FLAGS" "LDFLAGS=-s" all popd pushd checkpassword-0.90 make popd %install export PATH="/sbin:/usr/sbin:/bin:/usr/bin" #add_user() { useradd -d "$3" -g "$2" -M -r -s /bin/true "$1" || true; } #add_group() { groupadd -r "$1" || true; } install_file() { source="$1" dest="$2" shift 2 install "$@" "$source" $RPM_BUILD_ROOT/"$dest" } # BL - Not the way we want to do this. NEVER build RPM's as root user (unless you have to ;)! #add_group qmail #add_group nofiles #add_user alias nofiles /etc/qmail/alias #add_user qmaild nofiles /var/qmail #add_user qmaill nofiles /var/qmail #add_user qmailp nofiles /var/qmail #add_user qmailq qmail /var/qmail #add_user qmailr qmail /var/qmail #add_user qmails qmail /var/qmail #add_user qmaillog qmail /var/log # if buildroot is not "/" then remove it to clean up before install [ "%{buildroot}" != "/" ] && rm -rf %{buildroot} mkdir -p $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT%{_bindir} install -d $RPM_BUILD_ROOT%{_mandir} install -d $RPM_BUILD_ROOT_sbindir} pushd $RPM_BUILD_ROOT install -d bin install -d etc/cron.hourly install -d etc/qmail/alias install -d etc/qmail install -d etc/qmail/control install -d etc/qmail/owners install -d etc/qmail/users install -d etc/tcpcontrol install -d usr/lib install -d var/qmail #install -d -o qmaillog -g qmail var/log/{qmail,qmtpd,smtpd,pop3d,qmqpd} ln -s ../../etc/qmail/alias var/qmail/alias ln -s ../../etc/qmail/control var/qmail/control ln -s ../../etc/qmail/owners var/qmail/owners ln -s ../../etc/qmail/users var/qmail/users ln -s ../..%{_bindir} var/qmail/bin ln -s ../..%{_mandir} var/qmail/man popd # BL replace uid dependent make-owners for install only. # this is a quick hack to allow rpm build without root. #With the files rpm command, this script may not be required at all on rpm installs (check?) cat ./make-owners | grep -v chown | grep -v chgrp > ./make-owners-for-install chmod 700 make-owners-for-install # Build the user and group files, required for qmail-hier ./make-owners-for-install . # INSTALL IT ./install $RPM_BUILD_ROOT/var/qmail # CHECK IT ./instcheck $RPM_BUILD_ROOT/var/qmail # Remove preformatted man pages rm -rf $RPM_BUILD_ROOT/var/qmail/man/cat* rm $RPM_BUILD_ROOT/var/qmail/man # Fix for sendmail add-ons pushd $RPM_BUILD_ROOT/usr # this may be built in a tmp area, so make sure that sbin exists. if [ ! -d sbin ]; then mkdir sbin fi mv bin/sendmail sbin/sendmail ln -s ../sbin/sendmail lib/sendmail popd # Install some extra configuration programs install ipmeprint $RPM_BUILD_ROOT%{_bindir} pushd qmail-rhinit make PREFIX=$RPM_BUILD_ROOT bindir=%{_bindir} mandir=%{_mandir} install popd pushd checkpassword-0.90 echo $RPM_BUILD_ROOT >conf-home rm -f auto_home.c auto_home.o make setup check popd # Install extra shell scripts install_file cron.hourly etc/cron.hourly/qmail -m 755 install_file dot.qmail-msglog etc/qmail/alias/.qmail-msglog pushd $RPM_BUILD_ROOT/etc/qmail/alias echo '&root' >.qmail-postmaster echo '&root' >.qmail-mailer-daemon touch .qmail-root chmod 644 .qmail* popd pushd $RPM_BUILD_ROOT/etc/qmail/control touch defaultdomain locals me plusdomain rcpthosts chmod 644 defaultdomain locals me plusdomain rcpthosts popd pushd $RPM_BUILD_ROOT/etc/qmail/users touch append assign cdb include exclude mailnames subusers chmod 644 * popd cp make-owners-for-install $RPM_BUILD_ROOT%{_bindir} $RPM_BUILD_ROOT%{_bindir}/make-owners-for-install $RPM_BUILD_ROOT/etc/qmail echo ./Maildir/ >$RPM_BUILD_ROOT/etc/qmail/control/aliasempty # rebuild the sym-links under /var/qmail pushd $RPM_BUILD_ROOT/var/qmail rm -f alias control users owners bin man ln -s /etc/qmail/alias alias ln -s /etc/qmail/control control ln -s /etc/qmail/owners owners ln -s /etc/qmail/users users ln -s %{_bindir} bin ln -s %{_mandir} man rm -rf boot rm -rf doc ln -s %{_docdir}/qmail-$RPM_PACKAGE_VERSION doc popd mkdir -p $RPM_BUILD_ROOT/etc/init.d/ # Add init script for rh7.2 cat > $RPM_BUILD_ROOT/etc/init.d/qmail < (add chkconfig) # Larry Doolittle # derived from skeleton by Miquel van Smoorenburg, # # # Source function library. . /etc/init.d/functions # See how we were called. case "\$1" in start) touch /var/lock/subsys/qmail env - PATH="/var/qmail/bin:\$PATH" \ csh -cf 'qmail-start ./Mailbox splogger qmail &' # should limit RLIMIT_AS here, but bash apparently doesn't # know that exists. For now it is hacked into qmail-smtpd. # 0.5M data should be plenty, resists DOS attacks tcpserver -u 1911 -g 2081 0 smtp /var/qmail/bin/qmail-smtpd & echo \$! >/var/lock/subsys/qmail-smtpd ;; stop) killall qmail-send kill \`cat /var/lock/subsys/qmail-smtpd\` rm -f /var/lock/subsys/qmail-smtpd rm -f /var/lock/subsys/qmail ;; *) echo "Usage: qmail {start|stop}" exit 1 esac exit 0 EOF chmod 700 $RPM_BUILD_ROOT/etc/init.d/qmail mkdir -p $RPM_BUILD_ROOT/var/qmail/queue/lock %clean # if buildroot is not "/" then remove it to clean up before install [ "%{buildroot}" != "/" ] && rm -rf %{buildroot} # Pre/Post-install Scripts ##################################################### %pre PATH="/sbin:/usr/sbin:$PATH" export PATH add_user() { grep "^$1:" /etc/passwd >/dev/null || useradd -d "$3" -g "$2" -M -r -s /bin/true "$1"; } add_group() { grep "^$1:" /etc/group >/dev/null || groupadd -r "$1"; } add_group qmail add_group nofiles add_user alias nofiles /etc/qmail/alias add_user qmaild nofiles /var/qmail add_user qmaill nofiles /var/qmail add_user qmailp nofiles /var/qmail add_user qmailq qmail /var/qmail add_user qmailr qmail /var/qmail add_user qmails qmail /var/qmail add_user qmaillog qmail /var/log %post # Build the default tcpcontrol rules & CDBs if [ ! -d /etc/tcpcontrol ]; then mkdir -p /etc/tcpcontrol fi pushd /etc/tcpcontrol echo :allow >pop-3.rules echo :deny >qmqp.rules echo :allow >qmtp.rules #echo :allow >spop3.rules echo :allow >smtp.rules tcprules pop-3.cdb pop-3.tmp /dev/null 2>&1; then if ! [ -e inetd.conf.rpmsave ]; then cp -v inetd.conf inetd.conf.rpmsave fi sed -e 's/^smtp[ ]/#smtp /' inetd.conf >inetd.conf.new mv inetd.conf.new inetd.conf echo "inetd may need to be restarted before incoming SMTP connections" echo "will work. Do this by typing '/etc/rc.d/init.d/inet restart'" fi fi echo Read %{_docdir}/README.service for instructions echo on starting and stopping qmail services. if [ -f /etc/xinetd.d/smtp ]; then cp /etc/xinetd.d/smtp /etc/xinetd.d/smtp.rpmsave fi cat > /etc/xinetd.d/smtp < /etc/qmail/control-sample/aliasempty < /etc/qmail/control-sample/checkpassword < /etc/qmail/control-sample/locals < /etc/qmail/control-sample/rcpthosts <> /etc/qmail/control-sample/rcpthosts l_vuser=`echo $l_vdomain| sed -e 's/\.//g'`01 echo $l_vdomain:${l_vuser}admin > /etc/qmail/control-sample/virtualdomains %preun if [ $1 -gt 0 ]; then exit 0; fi for svc in pop3d qmail qmqpd qmtpd qread qstat smtpd do if [ -e /service/$svc ] then svc-remove $svc fi done echo "Removing Qmail user ids..." userdel alias userdel qmaild userdel qmaill userdel qmailp userdel qmailq userdel qmailr userdel qmails userdel qmaillog echo "Removing Qmail group ids..." groupdel qmail groupdel nofiles # Files List ################################################################### %files %defattr(-,root,qmail) %doc BLURB BLURB2 BLURB3 BLURB4 CHANGES FAQ FILES %doc INSTALL INSTALL.* INTERNALS PIC.* README REMOVE.* %doc SECURITY SENDMAIL TEST.* THANKS THOUGHTS TODO UPGRADE %doc qmail-rhinit/README.* %config /etc/profile.d/* # These rules are installed in the post process now. #%config(noreplace) /etc/tcpcontrol/pop-3.cdb #%config(noreplace) /etc/tcpcontrol/pop-3.rules #%config(noreplace) /etc/tcpcontrol/qmqp.cdb #%config(noreplace) /etc/tcpcontrol/qmqp.rules #%config(noreplace) /etc/tcpcontrol/qmtp.cdb #%config(noreplace) /etc/tcpcontrol/qmtp.rules #%config(noreplace) /etc/tcpcontrol/smtp.cdb #%config(noreplace) /etc/tcpcontrol/smtp.rules #%config(noreplace) /etc/tcpcontrol/spop3.cdb #%config(noreplace) /etc/tcpcontrol/spop3.rules %defattr(-,root,qmail) %config /etc/cron.hourly/qmail %dir /etc/qmail %attr(2755, alias, qmail) %dir /etc/qmail/alias/ %attr(-, alias, qmail) %config(noreplace) /etc/qmail/alias/.qmail-* %dir /etc/qmail/owners %defattr(-,root,qmail) %config /etc/qmail/owners/* %attr(0644,alias,qmail) /etc/qmail/owners/uida %attr(0644,qmaild,qmail) /etc/qmail/owners/uidd %attr(0644,qmaill,qmail) /etc/qmail/owners/uidl %attr(0644,qmailp,qmail) /etc/qmail/owners/uidp %attr(0644,qmailq,qmail) /etc/qmail/owners/uidq %attr(0644,qmailr,qmail) /etc/qmail/owners/uidr %attr(0644,qmails,qmail) /etc/qmail/owners/uids %dir /etc/qmail/users %defattr(-,root,qmail) %ghost %config(missingok,noreplace) /etc/qmail/users/assign %ghost %config(missingok,noreplace) /etc/qmail/users/cdb %ghost %config(missingok,noreplace) /etc/qmail/users/include %config(noreplace) /etc/qmail/users/append %config(noreplace) /etc/qmail/users/exclude %config(noreplace) /etc/qmail/users/mailnames %config(noreplace) /etc/qmail/users/subusers %dir /etc/qmail/control %defattr(-,root,qmail) %ghost %config(missingok,noreplace) /etc/qmail/control/defaultdomain %ghost %config(missingok,noreplace) /etc/qmail/control/locals %ghost %config(missingok,noreplace) /etc/qmail/control/plusdomain %ghost %config(missingok,noreplace) /etc/qmail/control/rcpthosts %verify(mode,group,user) %config(noreplace) /etc/qmail/control/aliasempty %verify(mode,group,user) %config(noreplace) /etc/qmail/control/me /bin/* %defattr(-,root,qmail) %{_bindir}/bouncesaying %{_bindir}/condredirect %{_bindir}/datemail %{_bindir}/elq %{_bindir}/except %{_bindir}/forward %{_bindir}/ipmeprint %{_bindir}/maildir2mbox %{_bindir}/maildirmake %{_bindir}/maildirwatch %{_bindir}/mailq %{_bindir}/mailsubj %{_bindir}/make-owners %{_bindir}/pinq %{_bindir}/predate %{_bindir}/preline %{_bindir}/qail %{_bindir}/qbiff %attr(0711,root,qmail) %{_bindir}/qmail-clean %attr(0711,root,qmail) %{_bindir}/qmail-getpw %{_bindir}/qmail-inject %attr(0711,root,qmail) %{_bindir}/qmail-local %attr(0700,root,qmail) %{_bindir}/qmail-lspawn %attr(0700,root,qmail) %{_bindir}/qmail-newmrh %attr(0700,root,qmail) %{_bindir}/qmail-newu %{_bindir}/qmail-pop3d %attr(0700,root,qmail) %{_bindir}/qmail-popup %attr(0711,root,qmail) %{_bindir}/qmail-pw2u %{_bindir}/qmail-qmqpc %{_bindir}/qmail-qmqpd %{_bindir}/qmail-qmtpd %{_bindir}/qmail-qread %{_bindir}/qmail-qstat %attr(04711,qmailq,qmail) %{_bindir}/qmail-queue %attr(0711,root,qmail) %{_bindir}/qmail-remote %{_bindir}/qmail-rhconfig %attr(0711,root,qmail) %{_bindir}/qmail-rspawn %attr(0711,root,qmail) %{_bindir}/qmail-send %{_bindir}/qmail-showctl %{_bindir}/qmail-smtpd %attr(0700,root,qmail) %{_bindir}/qmail-start %{_bindir}/qmail-tcpok %{_bindir}/qmail-tcpto %{_bindir}/qreceipt %{_bindir}/qsmhook %attr(0711,root,qmail) %{_bindir}/splogger %{_bindir}/tcp-env /usr/lib/sendmail %{_mandir}/man?/* /usr/share/qmail %{_sbindir}/sendmail %attr(-,root,qmail) /var/qmail %attr(0750,qmailq,qmail) /var/qmail/queue %attr(0700,qmails,qmail) /var/qmail/queue/bounce %attr(0700,qmails,qmail) /var/qmail/queue/info %attr(0700,qmailq,qmail) /var/qmail/queue/intd %attr(0700,qmails,qmail) /var/qmail/queue/local %attr(0750,qmailq,qmail) /var/qmail/queue/lock %attr(0600,qmails,qmail) /var/qmail/queue/lock/sendmutex %attr(0622,qmails,qmail) /var/qmail/queue/lock/trigger %attr(0644,qmailr,qmail) /var/qmail/queue/lock/tcpto %attr(0750,qmailq,qmail) /var/qmail/queue/mess %attr(0700,qmailq,qmail) /var/qmail/queue/pid %attr(0700,qmails,qmail) /var/qmail/queue/remote %attr(0750,qmailq,qmail) /var/qmail/queue/todo %attr(755,root,qmail) /var/qmail/service %attr(1755,root,qmail) /var/qmail/service/pop3d %attr(0755,root,qmail) /var/qmail/service/pop3d/log %attr(0755,root,qmail) /var/qmail/service/pop3d/log/run %attr(0755,root,qmail) /var/qmail/service/pop3d/run %attr(1755,root,qmail) /var/qmail/service/qmail %attr(0755,root,qmail) /var/qmail/service/qmail/log %attr(0755,root,qmail) /var/qmail/service/qmail/log/run %attr(0755,root,qmail) /var/qmail/service/qmail/run %attr(1755,root,qmail) /var/qmail/service/qmqpd %attr(0755,root,qmail) /var/qmail/service/qmqpd/log %attr(0755,root,qmail) /var/qmail/service/qmqpd/log/run %attr(0755,root,qmail) /var/qmail/service/qmqpd/run %attr(1755,root,qmail) /var/qmail/service/qmtpd %attr(0755,root,qmail) /var/qmail/service/qmtpd/log %attr(0755,root,qmail) /var/qmail/service/qmtpd/log/run %attr(0755,root,qmail) /var/qmail/service/qmtpd/run %attr(1755,root,qmail) /var/qmail/service/smtpd %attr(0755,root,qmail) /var/qmail/service/smtpd/log %attr(0755,root,qmail) /var/qmail/service/smtpd/log/run %attr(0755,root,qmail) /var/qmail/service/smtpd/run %attr(0700,root,root) /etc/init.d/qmail %changelog * Fri Nov 22 2002 Blair Lowe - redo with correct protection values in files area and populate control files. * Sat Nov 9 2002 Blair Lowe - compile and build release 18_compeng for rh72. - do not remove "/" when installing and cleaning. - run rpm -ba as regular user, not root. - Add this changelog. - Add creation of /usr/sbin dir in $RPM_BUILD_ROOT. - Make bogus make-owners-for-install script for non root compilation. * Fri Jul 26 2002 Bruce Guenter - latest release (-18)