From justin@rainbow.dgsys.com Fri Jul 14 08:52:34 1995
Date: Thu, 13 Jul 1995 23:46:13 -0400 (EDT)
From: Justin Newton <justin@rainbow.dgsys.com>
To: Carl Rigney <cdr@livingston.com>
Subject: Re: A subject totally unrelated to the radius RFC :)
In-Reply-To: <199507140259.TAA28922@server.livingston.com>
Message-ID: <Pine.LNX.3.91.950713233146.842A-100000@rainbow.dgsys.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Status: RO

On Thu, 13 Jul 1995, Carl Rigney wrote:

> If you send me a patch vs. RADIUS 1.16 and a short explanation of
> how it works I'd be glad to put it in our contrib area for others
> who could use it - that's very generous of you to offer!
> 

Let me know if you need anything else.

Here ya go.  Please note that for this to work the radius authentication 
server has to be the same machine as the one that the mail is spooled on, 
but hey, we all have to mmake sacrifices.  There is probably a more 
efficient way to do this, but this works for us and is adding almost no 
load to our server so we like it.  (We're running 3 pm2e30's at almost 
full load all the time, we're about to add a 4th, if we ever see a load 
problem I'll rewrite this).  I make no warranties about this software, 
but if you have any questions, please feel free to email me at 
justin@dgsys.com.

In users.c in the function userparse add the following variable

	char            jwnbuf[1000];

Then add the code so the following case statement in that function looks 
like this

case PW_TYPE_IPADDR:
	pair->lvalue = get_ipaddr(valstr);
	/* Code by JWN on 6/29/95 */ 
	/*204.97.64.1 is the low end of the addresses we have set aside 
	as ppp IP addresses, and 204.97.69.255 is the high end.  You 
	could obivously add an or statement to add a second block of IP 
	addresses to check*/
	if((pair->lvalue > get_ipaddr("204.97.64.1")) && (pair->lvalue < get_ipaddr("204.97.69.255"))){
		sprintf(jwnbuf,"/usr/local/bin/ppp_sendmail %s &",ip_hostname(pair->lvalue));
		puts(jwnbuf);
		system(jwnbuf);
	}
	break;

The following is the ppp_sendmail file:

#!/bin/sh
#
#
# ppp_sendmail - Process sendmail mqueue if PPP account is on
#
#
#PATH=/usr/bin:/bin:/usr/local/bin
#
# sleep awhile before starting sendmail
#       - create a list of queued files for $1
#       - process each id in list
#
sleep 120
cd /usr/spool/mqueue
/usr/local/bin/mqp $1 qf* | awk -F: '{print $1}' | sort | uniq | cut -b 
5- > /tmp/$1.mailq
if [ -s /tmp/$1.mailq ] ; then
        for i in `cat /tmp/$1.mailq`
        do
                /usr/lib/sendmail -M $i
        done
        /usr/sbin/ping $1
        if [ $? -eq "0" ] ; then
                echo '#!/bin/csh' > /tmp/tmp$$
                echo "/usr/local/bin/ppp_sendmail $1" >> /tmp/tmp$$
                at -c -f /tmp/tmp$$ now + 3 minutes
        fi
fi

rm -f /tmp/tmp$$
rm -f /tmp/$1.mailq

Justin Newton		* You have to change just to stay caught up.
Vice President/		*	
System Administrator	* 
Digital Gateway Systems	* 

