Re: [Mimedefang] Where is best to use $SendmailMacros{"auth_authen"} ?

2004-07-01 Thread Ben Kamen
Although it still shows in mail.log that "X-Scanned-By: MIMEDefang" was added to 
the header... should that be there?

 -Ben
Ben Kamen wrote:
nevermind...
 --Ben

___
Visit http://www.mimedefang.org and http://www.canit.ca
MIMEDefang mailing list
[EMAIL PROTECTED]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang


Re: [Mimedefang] Where is best to use $SendmailMacros{"auth_authen"} ?

2004-07-01 Thread Ben Kamen
nevermind...
 --Ben

___
Visit http://www.mimedefang.org and http://www.canit.ca
MIMEDefang mailing list
[EMAIL PROTECTED]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang


Re: [Mimedefang] Where is best to use $SendmailMacros{"auth_authen"} ?

2004-07-01 Thread Ben Kamen
Crap:
Was that
if ( defined($SendmailMacros{"auth_authen"} ) ) {
  do something;
}
or some other syntax? as listed above doesn't work.
syntax error at /etc/mail/mimedefang-filter line 189, near "}" syntax error at 
/etc/mail/mimedefang-filter line 186, near "auth_authen"}"" Missing right curly 
or square bracket at /etc/mail/mimedefang-filter line 414, at end of line 
Compilation failed in require at /usr/local/bin/mimedefang.pl line 4052.

Perl... gotta love it.
 Where's my perl book when I need it?
Thanks,
 _Ben_
___
Visit http://www.mimedefang.org and http://www.canit.ca
MIMEDefang mailing list
[EMAIL PROTECTED]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang


RE: [Mimedefang] Where is best to use $SendmailMacros{"auth_authen"} ?

2004-07-01 Thread Minica, Nelson \(EDS\)
> Nit:  you're calling is_trusted twice to check the same things -
including a file read. Option 1, store the value and use it for the
tests.

Thanks, your right.  I saw that but let it go since we don't block many
HELO's.  Shame on me, posting sloppy code!

___
Visit http://www.mimedefang.org and http://www.canit.ca
MIMEDefang mailing list
[EMAIL PROTECTED]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang


RE: [Mimedefang] Where is best to use $SendmailMacros{"auth_authen"} ?

2004-07-01 Thread Minica, Nelson \(EDS\)
Here's what I use: ACCEPT_AND_NO_MORE_FILTERING in filter_relay.  Can't
use macros there, have to read COMMANDS file.

sub is_trusted() {
  if ($RelayAddr eq "127.0.0.1" || $RelayAddr eq "123.123.123.123" ||
$RelayAddr =~ /^10\.1\.1\./) {
return 1;
}
  else {
open(COMM, "<./COMMANDS") or return 0;
while() {
  if (/^=auth_authen/) {
close(COMM);
md_syslog('info', "MDLOG: SMTP Authenticated");
return 1;
}
  }
close(COMM);
return 0;
}
}

#Must set MX_RELAY_CHECK=yes in /etc/init.d/mimedefang
sub filter_relay {
 my($ip, $name, $helo) = @_;
 if ($helo =~ /mydomain\./i) {
   if (!is_trusted()){
 return(REJECT,"Spam block HELO $helo.");
 }
   }
 if (is_trusted()){
   return(ACCEPT_AND_NO_MORE_FILTERING,"ok1");
   }

 return (CONTINUE,"ok2");
 }

___
Visit http://www.mimedefang.org and http://www.canit.ca
MIMEDefang mailing list
[EMAIL PROTECTED]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang


Re: [Mimedefang] Where is best to use $SendmailMacros{"auth_authen"} ?

2004-07-01 Thread Jeff Grossman
on 7/1/04 7:39 AM, Ben Kamen at [EMAIL PROTECTED] wrote:

> 
> Where would I be best putting a check for $SendmailMacros{"auth_authen"}
> to see if someone relaying has auth'd?
> 
> And what action would I use? Just action_accept()?
> 
> I don't want to do anything to the email - I want MIMEdefang to just "get out
> of 
> the way"... heheh.. waste no more time!

I would probably put it in filter_begin with the following line:

return ('ACCEPT_AND_NO_MORE_FILTERING', "ok");

That way MIMEDefang will just stop processing the message from that point
forward.

But, that will not stop a message with a virus from being sent out.

Jeff
-- 
Jeff Grossman ([EMAIL PROTECTED])


___
Visit http://www.mimedefang.org and http://www.canit.ca
MIMEDefang mailing list
[EMAIL PROTECTED]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang


Re: [Mimedefang] Where is best to use $SendmailMacros{"auth_authen"} ?

2004-07-01 Thread Joseph Brennan

--On Thursday, July 1, 2004 9:39 AM -0500 Ben Kamen <[EMAIL PROTECTED]> 
wrote:

Where would I be best putting a check for $SendmailMacros{"auth_authen"}
to see if someone relaying has auth'd?

I have it in filter_begin() and we see if there is any auth_type:

   # Mark some mail we trust: smtp-auth'd mail, mail from localhost
   undef($good);
   if (defined($SendmailMacros{"auth_type"})) {
   $good = 1;
   }
   if ($RelayAddr eq "127.0.0.1") {
   $good = 1;
   }

Also $good is mail from a few specific IP addresses, and a couple of
more convoluted exceptions we agreed to deal with.
But we do subject this mail to some testing, so we don't do an
action_accept().  Instead we use $good to skip things with a
"unless ($good) { ... }" around those stanzas.
And one special case I don't fully trust gets "$good = 2" so we can
distinguish it as being "sort of good".
Joseph Brennan
Academic Technologies Group, Academic Information Systems (AcIS)
Columbia University in the City of New York

___
Visit http://www.mimedefang.org and http://www.canit.ca
MIMEDefang mailing list
[EMAIL PROTECTED]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang