From: Stephan B. <li...@co...> - 2003-11-28 06:10:31
|
Thanks Mark, Thanks a lot! What I am doing is I am placing the mails on HOLD if they contain specific messages in the header. I.e. I do not want to block large messages (as with message_size_limit), I just want to detect and hold them, later to be released when WAN usage is not at it's peak. This hack allows me to let Postfix handle holding and queue management. You help is greatly appreciated. Regards, Stephan Buys On Friday 28 November 2003 01:31, Mark Martinec wrote: > Stephan, > > | I need to add message size information to my mails, for processing with > | postfix. I already integrate amavisd-new into Postfix and it seems like > | the natural place to do this. > | I want to tag any messages larger than a certain size with: > | X-Mailsize Oversized > | (or any other text that I can search for with postfix header_checks) > > A colon after a header field head is a required syntax. > > | I have setup Postfix with header checks to hold any messages that > | contain a certain text string. All I need to do is get that information > | into the message. > | > | Can anyone assist me in doing this? Even a pointer to the most > | appropriate code section would also be greatly appreciated. > > I fail to see why just setting $message_size_limit in Postfix main.cf > would not be appropriate. > > But if you insist: > > in sub check_mail the mail size is stored in a variable $mail_size > (and is also available via $msginfo): > > my($mail_size) = $msginfo->orig_header_size + 1 + > $msginfo->orig_body_size; > > > Later in the same subroutine: > # THIRD: now that we know what to do with it, do it! > ... > my($hdr_edits) = Amavis::Out::EditHeader->new; > > you may insert this call: > > $hdr_edits->append_header( > 'X-Mailsize', 'Oversized') if $mail_size > 10*1024*1024; > > right before appending other headers: > > $hdr_edits = add_forwarding_header_edits_common(... > > > Mark > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > AMaViS-user mailing list > AMa...@li... > https://lists.sourceforge.net/lists/listinfo/amavis-user > AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3 > AMaViS-HowTos:http://www.amavis.org/howto/ -- Stephan Buys Code Fusion cc. Tel: +27 11 391 1412 Mobile: +27 83 294 1876 Email: s....@co... |