[Mimedefang] Identity which sendmail process

Jan Pieter Cornet johnpc at xs4all.nl
Thu Feb 12 07:56:55 EST 2009


On Tue, Feb 10, 2009 at 10:54:45AM -0500, Joseph Brennan wrote:
> "Robert T. Covell" <rcovell at rolet.com> wrote:
> 
>> We have two sendmail processes running that will utilize the same MD
>> filter.
>> One process is for regular mail on port 25; the other is for
>> authenticated mail on port 587.
> 
> This is not exactly what you asked, but you can tell whether smtp
> auth was used:
> 
> if (defined($SendmailMacros{"auth_type"})) {
> 	# whatever
> }

This *is* exactly what you asked: you can use
$SendmailMacros{"daemon_name"} to determine the name of the port that
the user connected to. That macro is passed to mimedefang by default,
using standard sendmail configurations.

For example, we have in our sendmail.mc file:

    dnl# replacement "submission" port, to be used for smtp-noscan
    DAEMON_OPTIONS(`Listen=32,Port=589,Name=MSA-noscan,M=Eaf')

... and then somewhere in the mimedefang code is:

sub scan_for_virus {
    ...
    if ( $SendmailMacros{"daemon_name"} =~ /noscan$/ ) {
        md_syslog('warning', "$MsgID: No virus scanning");
        return;
    }

    ...


That said, if you want to differentiate on if the user is authenticated
or not, then do so, using the code Joseph gave.

-- 
Jan-Pieter Cornet <johnpc at xs4all.nl>
!! Disclamer: The addressee of this email is not the intended recipient. !!
!! This is only a test of the echelon and data retention systems. Please !!
!! archive this message indefinitely to allow verification of the logs.  !!



More information about the MIMEDefang mailing list