Jeff Grossman wrote:
> I must have something wrong in my filter. I am getting the following
> error:
>
> Jan 17 10:57:28 mail mimedefang.pl[29405]: action_bounce called
> outside of messa
> ge context
>
>
> Here is the part of my filter which is triggering this: (it is in
> filter-recipient)
>
> sub filter_recipient {
>
> my($recip, $sender, $ip, $host, $first, $helo, $rcpt_mailer,
> $rcpt_host, $rcpt_addr) = @_;
>
> $recip2 = $recip;
> $recip2 =~ tr/<>//d;
> $recip2 = lc($recip2);
>
> if ($recip2 eq '[EMAIL PROTECTED]' or
> $recip2 eq '[EMAIL PROTECTED]') {
> action_bounce("The intended recipient is not allowed
> to receive
> e-mail");
> return action_notify_administrator("Incorrect
> Recipient $recip2"
> );
> }
>
>
> Thanks for the help.
To reject a recipient, do a return ('REJECT', 'because we do not like you');
See the documentation - man mimedefang-filter
filter_recipient must return a two-to-five element list whose interpretation is
the same as for filter_relay and filter_sender.
...
($code, $msg, $smtp_code, $smtp_dsn, $delay). $msg speci�fies the text
message to use for the SMTP reply. If $smtp_code and $smtp_dsn are
supplied, they become the SMTP numerical reply code and the enhanced status
delivery code (DSN code). If they are not supplied, sensible defaults
are used. $delay specifies a delay in seconds; the C milter code will sleep
for $delay seconds before returning the reply to Sendmail. $delay defaults
to zero.
...
sub filter_recipient {
my ($recipient, $sender, $ip, $hostname, $first, $helo,
$rcpt_mailer, $rcpt_host, $rcpt_addr) = @_;
if ($sender =~ /^<[EMAIL PROTECTED]>?$/i) {
if ($recipient =~ /^<[EMAIL PROTECTED]>?$/i) {
return ('CONTINUE', "ok");
}
return ('REJECT', 'Sorry; [EMAIL PROTECTED] is blacklisted.');
}
return ('CONTINUE', "ok");
}
...
_______________________________________________
Visit http://www.mimedefang.org and http://www.canit.ca
MIMEDefang mailing list
[email protected]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang