Re: [Mimedefang] action_change_header

2018-05-07 Thread Dianne Skoll
On Mon, 7 May 2018 18:31:18 +
Thomas Kristensen  wrote:

> Then I dont understand the rebuild action. 

action_rebuild does nothing except set a flag telling MIMEDefang that
the message must be regenerated and passed back to the milter
body-replacement function.  The flag is checked when filter_end
returns,

> Should i then do the action_change_header and also add the header to
> the MIME::Entity? 

If it needs to be visible later on in your code, then yes.

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] action_change_header

2018-05-07 Thread Thomas Kristensen
Hey

Then I dont understand the rebuild action. 

Should i then do the action_change_header and also add the header to the 
MIME::Entity? 

Med venlig hilsen
Thomas Kristensen

Storhaven 12 - 7100 Vejle
Tlf: 75 72 54 99 - Fax: 75 72 65 33
E-mail: t...@multimed.dk

-Oprindelig meddelelse-
Fra: MIMEDefang [mailto:mimedefang-boun...@lists.roaringpenguin.com] På vegne 
af Dianne Skoll
Sendt: 7. maj 2018 17:51
Til: mimedefang@lists.roaringpenguin.com
Emne: Re: [Mimedefang] action_change_header

On Mon, 7 May 2018 13:55:19 +
Thomas Kristensen <t...@multimed.dk> wrote:

> If I use action_change_header in the begining of the filter_begin, 
> will the header I add/change be readable later on?

No, not in MIMEDefang.  MIMEDefang just makes a note to ask the milter engine 
to add the header; Sendmail does the header addition just before delivery.

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

___
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] action_change_header

2018-05-07 Thread Dianne Skoll
On Mon, 7 May 2018 13:55:19 +
Thomas Kristensen  wrote:

> If I use action_change_header in the begining of the filter_begin,
> will the header I add/change be readable later on?

No, not in MIMEDefang.  MIMEDefang just makes a note to ask the
milter engine to add the header; Sendmail does the header addition
just before delivery.

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] action_change_header

2018-05-07 Thread Thomas Kristensen
Hey

If I use action_change_header in the begining of the filter_begin, will the 
header I add/change be readable later on?
I noted the action_rebuild so my guess would be yes, but i just need to be sure 
before I go any futher on this path :)

Thanks.

Med venlig hilsen
Thomas Kristensen
[MM_mail_logo_3_AS]
Storhaven 12 - 7100 Vejle
Tlf: 75 72 54 99 - Fax: 75 72 65 33
E-mail: t...@multimed.dk


___
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] action_change_header w/ multiple Subjects

2005-10-20 Thread Matthew.van.Eerde
I'd like to be able to change the subject for emails detected as spam.

I've been using
action_change_header(Subject, [SPAM] $Subject);
which has worked well until recently.

Alas, recently there have been spams that put in multiple Subject headers.  
action_change_header tags the first Subject:, but the MUA displays the second!

I'm tempted to do something like
action_delete_all_headers(Subject);
action_add_header(Subject, [SPAM] $Subject);

but I have some questions...

1) Will this work?  Or will action_delete_all_headers(Subject) repopulate the 
$Subject variable?  If so, no problem, I can shadow the variable before I call 
the action_delete_all_headers.

2) Is there a way to detect how many of a given header there are, short of 
slurping ./HEADERS?

3) Is there a way to make an action_change_all_headers()?

-- 
Matthew.van.Eerde (at) hbinc.com   805.964.4554 x902
Hispanic Business Inc./HireDiversity.com   Software Engineer

___
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] action_change_header w/ multiple Subjects

2005-10-20 Thread David F. Skoll
[EMAIL PROTECTED] wrote:

 I'm tempted to do something like
   action_delete_all_headers(Subject);
   action_add_header(Subject, [SPAM] $Subject);

 1) Will this work?

Yes.

 Or will action_delete_all_headers(Subject) repopulate the $Subject
 variable?

No; you're OK on that count.

 2) Is there a way to detect how many of a given header there are,
 short of slurping ./HEADERS?

Not really.

 3) Is there a way to make an action_change_all_headers()?

Sure:

First, you count how many there are.  Then:

for $i (1 .. $num_headers) {
action_change_header(HeaderName, $header_value, $i);
}

Regards,

David.
___
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] action_change_header w/ multiple Subjects

2005-10-20 Thread Sean Ware
[EMAIL PROTECTED] ([EMAIL PROTECTED]) @ 2005.10.20 10:10:34 -0700:
 I'd like to be able to change the subject for emails detected as spam.
 
 I've been using
   action_change_header(Subject, [SPAM] $Subject);
 which has worked well until recently.
 
 Alas, recently there have been spams that put in multiple Subject
 headers.  action_change_header tags the first Subject:, but the MUA
 displays the second! 
 
 I'm tempted to do something like
   action_delete_all_headers(Subject);
   action_add_header(Subject, [SPAM] $Subject);
 
 but I have some questions...
 
 1) Will this work?  Or will action_delete_all_headers(Subject)
 repopulate the $Subject variable?  If so, no problem, I can shadow
 the variable before I call the action_delete_all_headers. 

Yes. It works beautifully. I asked this very question not too long
ago:

http://lists.roaringpenguin.com/pipermail/mimedefang/2005-September/027960.html

I have been running in production with the proposed code I list in the
message linked above for over a month. It does exactly what I intended
it to do.

 2) Is there a way to detect how many of a given header there are,
 short of slurping ./HEADERS? 

That I don't know. I suspect looking at ./HEADERS is probably your
best course.
 
 3) Is there a way to make an action_change_all_headers()?

That I also don't know. I did not find such a function on my first
glance.

Sean

-- 
Sean Ware  Midway Amusement Games, LLC
Senior Network Engineer  2727 W. Roscoe Street
Information Technology Department   Chicago, IL 60618-5909
[EMAIL PROTECTED]   (773) 961-2000

___
Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list
MIMEDefang@lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang