You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Rick Duval <ri...@duvals.ca> on 2008/05/22 14:57:37 UTC

Vars for Custom Plugins

Can someone point me to a list and description of vars available to plugins.

I know a couple like $pms->get("to") , etc but there's also "to:addr". I'm
looking for some sort of reference that tell me what the differences are?

Also how to just get a clean "to" address. I've notice that may mailing
lists will put their name in the to which screw me up. Any help would be
much appreciated.

Rick

Re: Vars for Custom Plugins

Posted by Mark Martinec <Ma...@ijs.si>.
> > no, it is not. The real recipient is transferred in mail envelope, which
> > needs not to appeart in headers.

Rick Duval wrote:
> How would you go about getting that?

Extend SpamAssassin's API to allow a caller to pass it additional
information, like envelope addresses in this case, and possibly
other interesting information about a SMTP session which never
make it into a mail header.

  Mark

Re: Vars for Custom Plugins

Posted by Rick Duval <ri...@duvals.ca>.
How would you go about getting that?

On Mon, May 26, 2008 at 4:26 AM, Matus UHLAR - fantomas <uh...@fantomas.sk>
wrote:

> On 23.05.08 13:14, Rick Duval wrote:
> > Sorry , didn't send tha last email to the list as well/....
> >
> > Doesn't Spamassassin have a standard routine somewhere to deteremine who
> an
> > email is for? It would seem like pretty basic stuff?
>
> no, it is not. The real recipient is transferred in mail envelope, which
> needs not to appeart in headers.
> --
> Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
> Warning: I wish NOT to receive e-mail advertising to this address.
> Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
> BSE = Mad Cow Desease ... BSA = Mad Software Producents Desease
>

Re: Vars for Custom Plugins

Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
On 23.05.08 13:14, Rick Duval wrote:
> Sorry , didn't send tha last email to the list as well/....
> 
> Doesn't Spamassassin have a standard routine somewhere to deteremine who an
> email is for? It would seem like pretty basic stuff?

no, it is not. The real recipient is transferred in mail envelope, which
needs not to appeart in headers.
-- 
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
BSE = Mad Cow Desease ... BSA = Mad Software Producents Desease

Re: Vars for Custom Plugins

Posted by Rick Duval <ri...@duvals.ca>.
Sorry , didn't send tha last email to the list as well/....

Doesn't Spamassassin have a standard routine somewhere to deteremine who an
email is for? It would seem like pretty basic stuff?

Rick

On Thu, May 22, 2008 at 11:38 AM, Theo Van Dinter <fe...@kluge.net>
wrote:

> [sending back to users@ list since it's generally useful info]
>
> On Thu, May 22, 2008 at 11:25:44AM -0400, Rick Duval wrote:
> > One thing though, IF using to:addr I often get the name of the mailing
> list
> > as opposed to the actual recipient. Is there a "clean" way to get that?
>
> It sounds like you want the envelope recipient, not the "To" header field.
>
> Unfortunately, there's no standard way to get that since each MTA does it
> differently, if that information is added at all.
>
> There should probably be a standard get() option that at least attempts
> to figure this out similar to EnvelopeFrom (feel free to open a bugzilla
> request about it), but in the mean time, looking at another function in
> PerMsgStatus that wants similar data (in no particular order):
>
>         $self->get('To')                       # std
>         $self->get('Cc')                       # std
>         $self->get('Apparently-To')            # sendmail, from envelope
>         $self->get('Delivered-To')             # Postfix, poss qmail
>         $self->get('Envelope-Recipients')      # qmail: new-inject(1)
>         $self->get('Envelope-To')              # exim
>         $self->get('X-Envelope-To')            # procmailrc manpage
>         $self->get('X-Delivered-To')           # procmail quick start
>         $self->get('X-Original-To')            # procmail quick start
>         $self->get('X-Rcpt-To')                # procmail quick start
>         $self->get('X-Real-To')                # procmail quick start
>         $self->get('Apparently-Resent-To')     # procmailrc manpage
>
> Hope this helps. :)
>
> --
> Randomly Selected Tagline:
> "I lost my foo."               - Theo
>

Re: Vars for Custom Plugins

Posted by Theo Van Dinter <fe...@kluge.net>.
[sending back to users@ list since it's generally useful info]

On Thu, May 22, 2008 at 11:25:44AM -0400, Rick Duval wrote:
> One thing though, IF using to:addr I often get the name of the mailing list
> as opposed to the actual recipient. Is there a "clean" way to get that?

It sounds like you want the envelope recipient, not the "To" header field.

Unfortunately, there's no standard way to get that since each MTA does it
differently, if that information is added at all.

There should probably be a standard get() option that at least attempts
to figure this out similar to EnvelopeFrom (feel free to open a bugzilla
request about it), but in the mean time, looking at another function in
PerMsgStatus that wants similar data (in no particular order):

         $self->get('To')                       # std 
         $self->get('Cc')                       # std
         $self->get('Apparently-To')            # sendmail, from envelope
         $self->get('Delivered-To')             # Postfix, poss qmail
         $self->get('Envelope-Recipients')      # qmail: new-inject(1)
         $self->get('Envelope-To')              # exim
         $self->get('X-Envelope-To')            # procmailrc manpage
         $self->get('X-Delivered-To')           # procmail quick start
         $self->get('X-Original-To')            # procmail quick start
         $self->get('X-Rcpt-To')                # procmail quick start
         $self->get('X-Real-To')                # procmail quick start
         $self->get('Apparently-Resent-To')     # procmailrc manpage

Hope this helps. :)

-- 
Randomly Selected Tagline:
"I lost my foo."               - Theo

Re: Vars for Custom Plugins

Posted by Theo Van Dinter <fe...@apache.org>.
On Thu, May 22, 2008 at 08:57:37AM -0400, Rick Duval wrote:
> Can someone point me to a list and description of vars available to plugins.
> 
> I know a couple like $pms->get("to") , etc but there's also "to:addr". I'm
> looking for some sort of reference that tell me what the differences are?

$pms->get() is a function, not a variable. :)

Take a look at "perldoc Mail::SpamAssassin::PerMsgStatus" for the functions
from PerMsgStatus.

-- 
Randomly Selected Tagline:
"Only your father could take a part-time job at a small town paper,
 and wind up the target of international assassins."
         - Marge Simpson, Guess Who's Coming to Criticize Dinner