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

2016-09-21 Thread Vieri Di Paola
> From: "Richard Laager" 
> So in your case, you would resent to u...@domain.org,
> delete_recipient(u...@domain.org), and then add the boilerplate.

It's a typo, I presume? In my example, u...@domain.com wants the boilerplate 
and u...@domain.org doesn't. So I guess you meant "resend to u...@domain.com, 
delete_recipient(u...@domain.org) 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 MIMEDefang@lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang


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

2016-09-21 Thread Richard Laager
On 09/21/2016 09:09 AM, Vieri Di Paola wrote:
>> You can stream_by_recipient() so MIMEDefang resends the message for each
>> recipient. In this way, your filter code can handle recipients
>> differently. Note the warnings in the mimedefang-filter man page, though.
> 
> The man page isn't too extensive on this. At a first glance it seems that 
> calling stream_by_recipient in filter_begin does not trigger the code in 
> filter_end, for instance. So if  stream_by_recipient is true then only 
> filter() is run?

I don't use stream_by_recipient() and never have. Here's my
understanding, though... If stream_by_recipient() returns false, there
was only one user, so stream_by_recipient() did nothing and the filter
runs as normal. If there are multiple recipients, then
stream_by_recipient() resends the original message to each recipient
individually, and your filter should terminate. You'll then see the new
messages in separate invocations of your filter.

>> Alternatively, you can do all the work yourself, and only selectively
>> resend when necessary. This is what I do (not for boilerplate insertion,
>> but other things).
> 
> How do you do that?
> Do you use resend_message()? (but that resends immediately the ORIGINAL 
> message)

Until a few weeks ago, yes. We were adding a header in some cases. So
what we did was: if everyone wants the header, add it, and we're done.
If some recipients want the header and some don't, resend the (original)
message to those who *don't*, remove them with delete_recipient(), and
add the header.

So in your case, you would resent to u...@domain.org,
delete_recipient(u...@domain.org), and then add the boilerplate.

We're now doing more extensive modifications, so I have re-implemented
resend_message() with my own code to modify the message as appropriate.

-- 
Richard
___
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 MIMEDefang@lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang


Re: [Mimedefang] mimedefang mailing list page

2016-09-21 Thread Dianne Skoll
Hi, all,

I have started the procedures with Symantec to get delisted.

I'm not optimistic they will care or have a clue.

Regards,

Dianne.
___
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 MIMEDefang@lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang


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

2016-09-21 Thread Vieri Di Paola
Thanks Richard.

> Sent: Wednesday, September 21, 2016 at 2:44 PM
> From: "Richard Laager" 
> To: mimedefang@lists.roaringpenguin.com
> Subject: Re: [Mimedefang] conditionally add boilerplate in message with more 
> than one recipient
> On 09/21/2016 07:16 AM, Vieri Di Paola wrote:
>> Suppose I have an email that's being sent To: u...@domain.org, 
>> u...@domain.com.
>>
>> @Recipients will hold both addresses.
>> I'd like mimedefang to add a boilerplate only for the message being sent to 
>> u...@domain.com.
>>
>> Is that possible?
>> If so, how?
>
> You can stream_by_recipient() so MIMEDefang resends the message for each
> recipient. In this way, your filter code can handle recipients
> differently. Note the warnings in the mimedefang-filter man page, though.

The man page isn't too extensive on this. At a first glance it seems that 
calling stream_by_recipient in filter_begin does not trigger the code in 
filter_end, for instance. So if  stream_by_recipient is true then only filter() 
is run?

> Alternatively, you can do all the work yourself, and only selectively
> resend when necessary. This is what I do (not for boilerplate insertion,
> but other things).

How do you do that?
Do you use resend_message()? (but that resends immediately the ORIGINAL message)

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 MIMEDefang@lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang


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

2016-09-21 Thread Richard Laager
On 09/21/2016 07:16 AM, Vieri Di Paola wrote:
> Suppose I have an email that's being sent To: u...@domain.org, 
> u...@domain.com.
> 
> @Recipients will hold both addresses.
> I'd like mimedefang to add a boilerplate only for the message being sent to 
> u...@domain.com.
> 
> Is that possible?
> If so, how?

You can stream_by_recipient() so MIMEDefang resends the message for each
recipient. In this way, your filter code can handle recipients
differently. Note the warnings in the mimedefang-filter man page, though.

Alternatively, you can do all the work yourself, and only selectively
resend when necessary. This is what I do (not for boilerplate insertion,
but other things).

-- 
Richard
___
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 MIMEDefang@lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang


Re: [Mimedefang] mimedefang mailing list page

2016-09-21 Thread Dianne Skoll
On Wed, 21 Sep 2016 14:15:11 +0200
"Vieri Di Paola"  wrote:

> I noticed that Norton Safe Web (DNS) blocks access to mimedefang's
> mailing list page and throws this warning:

Norton Safe Web is being idiotic.  That's a trapped incident on our
anti-spam cluster, which has nothing whatsoever to do with our list
server.  And of COURSE there may be threats on antispam.roaringpenguin.com;
we trap all kinds of nasty stuff.

Typical large "security" company that lacks clue.

Regards,

Dianne.
___
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 MIMEDefang@lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang


[Mimedefang] mimedefang mailing list page

2016-09-21 Thread Vieri Di Paola
I noticed that Norton Safe Web (DNS) blocks access to mimedefang's mailing list 
page and throws this warning:

Threat Name:
W97M.Downloader
Location:
https://antispam.roaringpenguin.com/canit/s.php?s=jballard%40hendersoncountync.org&rlm=hendersoncountync-org&id=09RCo3dkr&cookie=16bd6564&mime=1&part=1.2




___
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 MIMEDefang@lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang


[Mimedefang] conditionally add boilerplate in message with more than one recipient

2016-09-21 Thread Vieri Di Paola
Hi,

Suppose I have an email that's being sent To: u...@domain.org, u...@domain.com.

@Recipients will hold both addresses.
I'd like mimedefang to add a boilerplate only for the message being sent to 
u...@domain.com.

Is that possible?
If so, how?

I can only add boilerplates in filter_end but not in filter_recipient. However, 
I can tell which is the "current" recipient being processed in filter_recipient 
but not in filter_end.

I guess it's not designed to do this unless I somehow duplicate the message 
itself and add a boilerplate to one of the two.

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 MIMEDefang@lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang