accessing message variables in a custom funciton

Leonardo Helman mailscanner at lists.com.ar
Thu May 15 12:42:26 IST 2008


Do you have this part?:

sub MyFunctionExample {
    my($message) = @_;
}

$message is not predefined in perl, and it's not global

Or this (if you are setting a custom scanner)
  my($ip, $from, $to, $message) = @_;


Look for the examples in CustomFunctions dir

And do read "learning perl" it's a very good book



On Wed, 2008-05-14 at 13:13 -0400, Rick Duval wrote:
> I'm writing a custom function and am trying to access the variable
> that are shown at the top of Message.pm (per jules instructions).
> 
> Problem is that when I run a line like:
> 
> my $rickfrom = $message->{from};
> 
> I don't get anything back in the $rickfrom, it's empty.
> 
> I admit I'm not that experienced with Perl in general but can somebody
> point me in the right direction for accessing those vars?
> 
> Also, is there any one var that will just give me the first clean "to"
> address without and <>, etc.
> 
> Thanks
> 
> Rick
> 



More information about the MailScanner mailing list