Re: conditionally add boilerplate in message with more than one recipient

"Vieri Di Paola" <[email protected]>
Newsgroups gmane.mail.mimedefang
Message-ID <trinity-32f6e721-df56-45a5-a0ff-dad2312fffd1-1474496026274@3capp-mailcom-bs09>
> From: "Richard Laager" <[email protected]>
> So in your case, you would resent to [email protected],
> delete_recipient([email protected]), and then add the boilerplate.

It's a typo, I presume? In my example, [email protected] wants the boilerplate and [email protected] doesn't. So I guess you meant "resend to [email protected], delete_recipient([email protected]) and add boilerplate", right?

The man page says to call this function (resend_message) in either filter_begin() or filter_end(). The *boilerplate* functions can only be called in filter_end().
I haven't tried it yet but would it look something like this pseudo-code below?

sub filter_end() {
  @want_boilerplate = get_recipients_with_boilerplate_from(@Recipients);
  @dont_want_boilerplate = get_recipients_without_boilerplate_from(@Recipients);
  if (scalar(@dont_want_boilerplate) > 0 && resend_message(@want_boilerplate)) {
    foreach $recip (@dont_want_boilerplate) {
      delete_recipient($recip);
    }
    append_text_boilerplate();
    append_html_boilerplate();
  }
  [continue with other filtering code in this function...]

Sorry if I only have a vague idea of how the mimedefang filtering process works but I don't know if the new ORIGINAL message created by resend_message will also go through the filter_begin(), filter() and filter_end() functions again. That's because I have other filtering needs in those functions not just appending a boilerplate (such as virus scanning, etc). In other words, I need ALL messages to be processed via all filter*() functions and SOME messages sent to specific recipients should not have a boilerplate appended. So does the filtering process start over again with resend_message()?

Finally, I'm using Postfix 3.1.0 with mimedefang and it's working fine. However, I'm concerned that resend_message() might not work as expected since the man page only refers to Sendmail-specific flags.

Thanks,

Vieri

_______________________________________________
NOTE: If there is a disclaimer or other legal boilerplate in the above
message, it is NULL AND VOID.  You may ignore it.

Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list [email protected]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.