[Mimedefang] SMTP AUTH?
Lucas Albers
admin at cs.montana.edu
Mon Aug 9 13:31:28 EDT 2004
Or you can use this really long version:
ala David Skoll originally if I remember correctly.
sub authenticated_user(){
# Read command files
if (!open(IN, "<COMMANDS")) {
fatal("Cannot open COMMANDS file from mimedefang: $!");
#i am rejecting mail if it can't open commands
#return -1;
return 0;
}
my $seenF = 0;
while(<IN>) {
chomp;
my $rawcmd = $_;
my $cmd = percent_decode($rawcmd);
my $arg = substr($cmd, 1);
$cmd = substr($cmd, 0, 1);
my $rawarg = substr($rawcmd, 1);
if ( $cmd eq "F") {
$seenF = 1;
last;
}
elsif ($cmd eq "=") {
my($macro, $value);
($macro, $value) = split(' ', $rawarg);
$value = "" unless defined($value);
$macro = "" unless defined($macro);
if ($macro ne "") {
$macro = percent_decode($macro);
$value = percent_decode($value);
$SendmailMacros{$macro} = $value;
#md_syslog('warning',"SendmailMacro:$SendmailMacros{$macro},$value,$macro");
}
} else {
#md_syslog('warning', "Unknown command $cmd from mimedefang");
}
}
close(IN);
if (exists ($SendmailMacros{'auth_authen'})) {
return 1;
}
else {
return 0;
}
if (!$seenF) {
md_syslog('err', "COMMANDS file from mimedefang did not terminate
with 'F' -- check disk space in spool directory");
}
}
Richard A Nelson said:
> On Sat, 7 Aug 2004, Jon Fullmer wrote:
>>
>> Is there a way to tell MIMEDefang not to check e-mails from a user that
>> has
>> properly authenticated with SMTP AUTH?
>
> I'm new to mimedefang, so this is just a guess, but it looks like
> sendmail will (by default) pass the auth_ macros to the from: callout.
>
> This means that in the filter_sender function you should be able to
> use something like:
> if ($SendmailMacros{"auth_type"} = 'ok') {
> return ('ACCEPT_AND_NO_MORE_FILTERING', 'ok');
> };
>
> --
> Rick Nelson
> Life'll kill ya -- Warren Zevon
> Then you'll be dead -- Life'll kill ya
> _______________________________________________
> Visit http://www.mimedefang.org and http://www.canit.ca
> MIMEDefang mailing list
> MIMEDefang at lists.roaringpenguin.com
> http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
>
--
Luke Computer Science System Administrator
Security Administrator,College of Engineering
Montana State University-Bozeman,Montana
More information about the MIMEDefang
mailing list