List Info

Thread: RELAYCOUNTRY Header passed




RELAYCOUNTRY Header passed
country flaguser name
United States
2008-03-11 12:54:54
I've done a little more digging since my first posting on
this subject.

We really need to get _RELAYCOUNTRY_ from SpamAssassin into
our messages 
with X-RelayCountries header.

I see where provisions have been made in the past year to
allow amavisd to 
capture this (along with a few others) from SA by using
supplementary_info 
subroutine.

Making all of this work is probably simpler than I realize,
but not being 
a perl programmer, I haven't got a clue of how to start.  I
can usually 
follow by example, but I couldn't find any examples in the
code (or I just 
didn't know what I was looking at...probably the case).

Can anyone get me started in the right direction to get this
header into 
our email messages?

Thanks!
------------------------------------------------------------
-------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
AMaViS-user mailing list
AMaViS-userlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user

AMaViS-FAQ:http://www.amav
is.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/ho
wto/

Re: RELAYCOUNTRY Header passed
country flaguser name
Slovenia
2008-03-14 09:17:31
Leonard,

> I've done a little more digging since my first posting
on this subject.
>
> We really need to get _RELAYCOUNTRY_ from SpamAssassin
into our messages
> with X-RelayCountries header.
>
> I see where provisions have been made in the past year
to allow amavisd to
> capture this (along with a few others) from SA by using
supplementary_info
> subroutine.
>
> Making all of this work is probably simpler than I
realize, but not being
> a perl programmer, I haven't got a clue of how to
start.  I can usually
> follow by example, but I couldn't find any examples in
the code (or I just
> didn't know what I was looking at...probably the
case).
>
> Can anyone get me started in the right direction to get
this header into
> our email messages?

Assuming amavisd-new-2.5.4 (or 2.6.0-*), place the
following
into amavisd.conf:
  include_config_files('/etc/amavisd-custom.conf');


The /etc/amavisd-custom.conf could then look like:


package Amavis::Custom;
use strict;

sub new {
  my($class,$conn,$msginfo) = _;
  bless {}, $class;
}

sub before_send {
  my($self,$conn,$msginfo) = _;
  my($rly_country) =
$msginfo->supplementary_info('RELAYCOUNTRY');
  if (defined $rly_country && $rly_country ne '') {
    my($hdr_edits) = $msginfo->header_edits;
    my($all_local) =
      !grep { !$_->recip_is_local } {$msginfo->per_recip_data};
    $hdr_edits->add_header('X-Relay-Countries',
$rly_country)  if $all_local;
  }
};

1;  # insure a defined return



  Mark

------------------------------------------------------------
-------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
AMaViS-user mailing list
AMaViS-userlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user

AMaViS-FAQ:http://www.amav
is.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/ho
wto/

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )