[milters] Archive

Lists Index Date Thread Search

Article: 1037
From: Michael Elliott
Date: 2006-07-15 03:33:00 -0400
Subject: Re: milter-gris and Popauth.db

Removal...........: milters-request@milter.info?subject=remove
More information..: http://www.milter.info/#Support

> Has anyone else have this POP_B4_SMTP_TAG in use, or have been
> successful in getting a pop before smtp solution working with milter-gris?
> TIA,
> Jim

I am the one that Anthony put the --enable-popauth in for.  The first 
version of it I gave to him did a read of the database.  It slowed
things down, so I went to a version that looked at the variable sendmail
was setting after it did its database reading.

The sendmail macros I am using are extinct on the net now, but I 
carry them forward because of their usefulness for an ISP class
machine.  They have also been highly customized over time. 
But, the key factors in mine that you need to get close to the same 
in your implementation are:

sendmail.cf near the top:
   # ================== DATABASE =================================
   # database definitions
   # =============================================================
   # definition of popauth
   Kpopauth btree /usr/local/etc/dracd

The type of database doesn't matter.  Just that there is one, and 
sendmail is reading it to compare the connecting IP against.
   # ================== ENVELOPE =================================
   # macro for header field X-Popauth-Info
   H?${popauth_info}?X-Popauth-Info: ${popauth_info}

This simply added a header line if the {popauth_info} storage 
variable contained data.  That was part of the original extinct

   # check the client_addr against the popauth-database
   R$*			$: $1 $| <$&{client_addr}>
   R$* $| <$+>		$: $1 $| <$(popauth $2 $: ? $)> <$2>
   R$* $| <?> $*	$: $1
   # add the RHS of the popauth.db to the header-field X-Popauth-Info
   R$* $| <@NOINFO> $*	$: $1 $| <>
   R$* $| <$+> $*	$: $1 $| <$(storage {popauth_info} $@ $2 $)>
   R$* $| <$*> $*	$#OK
   R$* $| $*		$: $1

In most stock sendmail configs, SLocal_check_rcpt is an empty function,
Adding the previous function is what does the major work for me.

The key factor is that after the database lookup, the storage command
puts the value of the lookup into the {popauth_info} variable.  That is 
how it is read by all of Anthony's milters.  Since you are using a 
completely different package I haven't seen before, I don't have a quick
drop in answer for you.  Whatever variable used to mark your headers
with an H? line is what you need to copy into a {popauth_info} and then 
expose to the milters as Anthony showed in his reply. 

Hope that helps.  But, unless you are completely comfortable with writing 
R$* code, *!*don't try this*!*.  R$* is the fastest way to a disaster 
possible in coding.  Guessing is not an option.  Modifying your package 
to do this is going to be very tricky.  You have been warned.

-Mike Elliott

Lists Index Date Thread Search