Summary: Routing messages by user %define name smeserver-mailrouting Name: %{name} %define version 0.0.1 %define release 0 Version: %{version} Release: %{release}%{?dist} License: GPL Group: Mail Source: %{name}-%{version}.tar.gz BuildRoot: /var/tmp/%{name}-buildroot/ BuildArch: noarch Requires: smeserver-qpsmtpd qmail AutoReqProv: no %changelog * Sun Apr 29 2007 Shad L. Lords - Clean up spec so package can be built by koji/plague * Thu Dec 07 2006 Shad L. Lords - Update to new release naming. No functional changes. - Make Packager generic * Thu Sep 1 2005 Michael Weinberger - Initial release %description for SME7 only! Routes mail to another server by the recipient name Routed recipient don't need a local account. Mailrouting is disabled, when "internal mail server" (smtproutes) is set. How to set up: /sbin/e-smith/db /home/e-smith/mailrouting set ADDRESS mailrouting MailroutingAddress MAILROUTINGADDRESS Example: Route messages for joe.sixpack here (foo.com) to server mail2.foo.com /sbin/e-smith/db /home/e-smith/mailrouting set joe.sixpack@foo.com mailrouting MailroutingAddress Joe.Sixpack@mail2.foo.com /etc/rc.d/rc7.d/S85qpsmtpd restart /etc/rc.d/rc7.d/S85sqpsmtpd restart /etc/rc.d/rc7.d/S80qmail restart Note the lower-case for the key (joe.sixpack@foo.com)! %prep %setup %setup -q -n %{name}-%{version} %build %install rm -rf $RPM_BUILD_ROOT (cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) rm -f %{name}-%{version}-filelist find $RPM_BUILD_ROOT -depth -type f -print |\ sed -e "s@^$RPM_BUILD_ROOT@@g" \ -e "s@^/etc/e-smith/templates/@%attr(0644,root,root) &@"\ -e "s@^/var/qmail/control/@%attr(0644,root,root) &@"\ -e "s@^/var/qmail/alias/@%attr(0644,alias,qmail) &@"\ -e "s@^/var/qmail/bin/@%attr(0755,root,qmail) &@"\ -e "s@^/home/e-smith/qmail/@%attr(0640,root,qmail) &@"\ >> %{name}-%{version}-filelist find $RPM_BUILD_ROOT -depth -type l -print |\ sed "s@^$RPM_BUILD_ROOT@@g" >> %{name}-%{version}-filelist %clean rm -rf $RPM_BUILD_ROOT %pre %preun %post touch -a /home/e-smith/mailrouting chown root.admin /home/e-smith/mailrouting chmod 644 /home/e-smith/mailrouting if [ "x`/bin/cat /proc/1/cmdline`" = "xinit [7]" ] ; then /sbin/e-smith/signal-event email-update /etc/rc.d/rc7.d/S85qpsmtpd restart /etc/rc.d/rc7.d/S85sqpsmtpd restart /etc/rc.d/rc7.d/S80qmail restart fi %postun if [ "x`/bin/cat /proc/1/cmdline`" = "xinit [7]" ] ; then if [ $1 = 0 ] ; then # uninstall /sbin/e-smith/signal-event email-update /etc/rc.d/rc7.d/S85qpsmtpd restart /etc/rc.d/rc7.d/S85sqpsmtpd restart /etc/rc.d/rc7.d/S80qmail restart fi fi %files -f %{name}-%{version}-filelist %defattr(-,root,root)