[Sendmail-milter-users] setpriv questions
Brought to you by:
cying
From: Andrew A. <an...@hi...> - 2001-11-13 15:52:20
|
I am writing a filter using Sendmail::Milter. I want to maintain state using a hash reference. If I store this in a hash can I use the setpriv and getpriv methods of the Sendmail::Milter class to maintain state. Sample code. sub my_connect { my $ctx = shift; my $host = shift; my $real_ip = shift; my $state = {}; $state->{host} = $host; $state->{real_ip} = $real_ip; my $ctx->setpriv($state); return SMFIS_CONTINUE; } sub my_helo { my $ctx = shift; my $helo = shift; # get state hash my $state = $ctx->getpriv(); my $host = $state->{host}; $state->{helo} = $helo; # save state again $ctx->setpriv($state); return SMFIS_CONTINUE; } .... Will this work? It seems to but I was wondering if there were any problems with continually adding data to the $state hash and storing it using setpriv. Thanks in advance. -- Andrew Armstrong Director of Application Development an...@hi... Higher Technology Services |