Summary: This is a simple milter for SpamAssassin. Name: env-milter Version: 0.1.1 Release: 2rcs License: Sendmail Group: Networking/Mail URL: http://utter.chaos.org.uk/~richard/ Source1: http://utter.chaos.org.uk/~richard/sw/env-milter.c Source2: http://utter.chaos.org.uk/~richard/sw/env-milter.init Buildroot: %{_tmppath}/%{name}-root Prefix: %{_prefix} Prereq: /sbin/chkconfig %description This milter rewrites envelope recipients based on the presence of a trigger header. All existing envelope recipients are removed and replaced with a configurable 'trap' recipient. %prep %setup -q -n %{name} -c -T cp %{SOURCE1} . %build gcc -Wall -o env-milter env-milter.c -lmilter -lsm -pthread %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT install -d %{buildroot}%{_sbindir} install -m 0755 env-milter %{buildroot}%{_sbindir}/ install -d %{buildroot}%{_initrddir} install %{SOURCE2} %{buildroot}%{_initrddir}/env-milter install -d %{buildroot}/var/run/env-milter install -d %{buildroot}/etc/sysconfig cat < %{buildroot}/etc/sysconfig/env-milter # Envelope Milter recognises the following command line options: # # -b Run in the background. Default is to run in forground. # -d Debug mode. Log extra debuging information. # -m header Name of header to match. Match is case insensitive. # Default is "X-Spam-Status". # -p port Name of Milter port. Default is "unix:env-milter.sock" # in the current directory. # -r recipient Valid email address of recipient if match header is # found. Default is "root@localhost". # -s string Right hand side of header to match. Match is case # insensitive. Default is "Yes". # -t timeout Time to wait for connection from Sendmail. Default is # is configured via sendmail (typically 1800 seconds). # -x header Header to add for each removed recipient. Default is # "X-Env-Recipient". If set to an empty string, no # header will be added. # # Multiple env-milters can be run by setting a list of opts. Each # running env-milter must have its own unique socket. # ENVMILTERLIST="FROM_MILTER TO_MILTER" # TO_MILTER="-b -m To -s me -r root -p '/var/run/env-milter/to.sock'" # FROM_MILTER"-b -m From -s you -r me -p '/var/run/env-miter/from.sock # # If ENVMILTERLIST is not set, the startup script runs a single instance of # env-milter using the values from ENVMILTEROPTS # ENVMILTEROPTS="-b -p '/var/run/env-milter/env-milter.sock'" EOF %files %defattr(-,root,root) %doc env-milter.c %{_sbindir}/env-milter %config %{_initrddir}/env-milter %config /etc/sysconfig/env-milter %attr(-,spamd,spamd) %dir /var/run/env-milter %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT %pre useradd -c 'Spam Daemon' -d /var/lib/spamd -m -r spamd 2>/dev/null || : %post /sbin/chkconfig --add env-milter %preun if [ $1 = 0 ]; then /sbin/chkconfig --del env-milter fi exit 0 #%postun %changelog * Sat Nov 23 2002 Richard Smith - First build