[Mimedefang] Help

jmiller at purifieddata.net jmiller at purifieddata.net
Sun Oct 20 03:04:02 EDT 2002


On Sun, 20 Oct 2002, Easy wrote:

> I've restarted MD using the script packed with the MD. There is one small
> problem, that the .pid file
> contains only one number of proces, and there are several of them running
> but i've solved it that way
> ps aux|grep mimedefang|kill -9

You only really need to politely kill the one pid in the pidfile:
	kill `cat $PIDFILE`
When send that signal, it'll clean up the other running processes. kill -9
should be reserved for times when a program is seriously locked up (this
is not mimedefang specific, kill -9 should rarely be needed on any
properly running unix box).

> something like that. I've made script, that really kils _all_ mimedefang
> proceses. Problem is that this
> filter doesn't produce backup mail message at all:
>
> sub filter_begin () {
>
>     if ($Sender =~ /^<mymail\@domain>?$/i or
>         $Sender =~ /^<mymail2\@domain>?$/i) {
>     add_recipient('mybackup at domain');
>         }
>
> }
> It seems to be running, it doesn't produce any error messages, but it
> doesn't make what i seem to be asking. :))

First, make sure it's actually scanning your messages. Look at one of the
messages that goes through, there should be an "X-Scanned-By:" header
if mimedefang is actually looking at it.
If it's not, then check your sendmail setup.
Make sure you're regular expression is checking for the right thing. Looks like there's a "?" missing:
	/^<?mymail\@domain\.com>?$/i
If it's not working yet, throw some debugging stuff in there so you can figure
out what isn't working.
	sub filter_begin () {
		syslog('warning',"in filer_begin");
		syslog('warning',"Sender = $Sender");
		syslog('warning',"matched first regex") if ($Sender =~ /^<?mymail\@domain\.com>?$/i);
		syslog('warning',"matched second regex") if ($Sender =~ /^<?mymail2\@domain\.com>?$/i);
		if ( ($Sender =~ /^<?mymail\@domain\.com>?$/i) ||
		     ($Sender =~ /^<?mymail2\@domain\.com>?$/i) ) {
			syslog('warning',"should be adding a recipient");
			add_recipient('mybackup at domain');
		}
	}
syslog stuff should show up in /var/log/maillog

Make sure you restart mimedefang after changing the filter. If you're running
it as the multiplexor, you can simply:
	kill -INT `cat /var/spool/MIMEDefang/mimedefang-multiplexor.pid`

--
Josh I.




More information about the MIMEDefang mailing list