On Wed, 23 Jun 2004 09:14:56 -0500, VCI Help Desk wrote:
>� Using the virtusertable to relay the email to the POP3 server
>� requires a periodic update when new customers are added and
>� deleted. Is there a simpler method? One of the reasons I do this
>� is to block emails containing invalid email addresses from
>� reaching my POP3 server. I want to continue this.
Are the mails delivered to the POP servers with SMTP or some other way? If it
is delivered with SMTP, using "mailertable" to tell sendmail where to send
local mail and using "md_check_against_smtp_server" for checking recipients
could work.
If this doesn't work, I suggest asking on the MIMEDefang mailing list instead
(see www.mimedefang.org for more info).
Anyway, here's a snippet from my "filter_recipient":
--8<--
# If mail will be delivered to a host on our LAN, and is not for
*.frukt.org, check the user.
if (($rcpt_mailer =~ /^e?smtp$/) && ($rcpt_host =~
/^\[10\.0\.\d{1,3}\.\d{1,3}\]$/) &&
!($rcpt_addr =~ /^.*@(|.*\.)frukt.org$/i)) {
$rcpt_host =~ s/^(\[)(.*)(\])$/$2/;
#md_syslog('info', "filter_recipient: Host: $rcpt_host,
Address: $rcpt_addr");
my ($ok, $msg) = md_check_against_smtp_server($sender,
$rcpt_addr, $MyFilterHostName, $rcpt_host);
if ($ok eq "CONTINUE") {
$msg = "Address $rcpt_addr ok, go ahead.";
} else {
if ($ok eq "REJECT") {
md_syslog('info',
"MDLOG,$MsgID,unknown_user,$rcpt_host,$ip,$sender,$recipient,?");
$msg = "Cannot deliver to $rcpt_addr. Storing
server said: $msg";
} else {
$ok = 'CONTINUE';
$msg = "Not sure wether the user is ok or not,
so go ahead";
}
debug_log(2,"filter_recipient: $ok, $msg");
}
return($ok, $msg);
}
return ('CONTINUE', "Ok, go ahead.");
--8<--
This uses SMTP to check the recipient with the storing mail server before
accepting it. Actually, I think there's something about this in the
mimedefang-filter man-page.
Regards
/Jonas
--
Jonas Eckerman, [EMAIL PROTECTED]
http://www.fsdb.org/