[Mimedefang] Per Domain Configuration

Robert Covell rcovell at rolet.com
Tue Aug 13 19:08:00 EDT 2002


I am trying to setup our mimedefang-filter.pl so that mail that is either
defanged or marked as Spam goes to different places  based on the domain it
is going to.  If the domain is not in the list then it uses the default
information and basically discards it on the server end.

Configuring mimedefang-filter.pl to this has not been as straight forward as
I thought it would be.  Here is what I have so far:

In filter_begin () I placed:

    if (stream_by_domain()) {
        return;
    }

to have it set $Domain.

And then in filter I placed:

    if ($Domain eq "domain1.com") {
        $AdminAddress = 'spamcop at domain1.com';
        $AdminName = "Domain1 Administration";
    } elsif ($Domain eq "domain2.com") {
        $AdminAddress = 'contact at domain2.com';
        $AdminName = "Domain2 Administration";
    } else {
        $AdminAddress = 'spamcop at rolet.com';
        $AdminName = "Rolet Administration";
    }

    if (filter_bad_filename($entity)) {
        action_defang($entity, "", "", "text/plain")

The above action_defang does use the new values set above, but filter_end
does not.

And in filter_end I have reference like:

	action_change_header("To", "$AdminAddress");

When the mail arrives it has the AdminAddress is the same as the one set at
the very top.  The reason we are changing the "To" field is that if a
message is marked as Spam, we want it to go to their Spam Mailbox so it can
be reviewed later.  Any ideas on how to do this or a better way to implement
it?

-Bob




More information about the MIMEDefang mailing list