> Hi
>
> We are using amavisd onto an sql database. Each message is given a unique
message id. We would like to add a header to every message with the message
id (md5 encrypted).
>
> Could someone please point me in the right direction on how to achieve this ?
>
> we are using an older version of amavisd - modified amavisd-new-2.3.2
(20050629)
>
Mark Martinec as kind enough to write this custom filter for me to add a
message size header. You should be able to make it add your message id without
too much work.

Terry

Everything below this line is from Marc.

-----------------------------------------------------

If all you need to do is to add two header fields based on mail size, the
simplest way is to call add_header() from a custom hook, e.g.:


somewhere in amavisd.conf add:

  include_config_files('/etc/amavisd-custom.conf');


then in /etc/amavisd-custom.conf :


package Amavis::Custom;
use strict;

# invoked at child process creation time;
# return an object, or just undef when custom checks are not needed sub new {
  my($class,$conn,$msginfo) = @_;
  my($self) = bless {}, $class;
  my($mail_size) = $msginfo->msg_size;   # mail size in bytes
  my($mail_size_mb) = $mail_size/(1024*1024);
  my($hdr_edits) = $msginfo->header_edits;
  $hdr_edits->add_header('X-ActualMessageSizeBytes', $mail_size);
  $hdr_edits->add_header('X-ActualMessageSize',
                         '*' x ($mail_size_mb > 50 ? 50 : $mail_size_mb));
  $self;  # returning an object activates further callbacks,
          # returning undef disables them
}
1;  # insure a defined return



  Mark





-- 
CNY Support, LLC
Web. Database. Business
http://www.cnysupport.com




------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
AMaViS-user mailing list
AMaViS-user@lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/amavis-user 
 AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3 
 AMaViS-HowTos:http://www.amavis.org/howto/ 

Reply via email to