Re: [Mimedefang] head->get('Subject') adds "#012"

2017-10-10 Thread Joseph Brennan
On Mon, Oct 9, 2017 at 10:26 PM, Michael Fox  wrote:
> I'm using the following to retrieve the message subject header:
>
> $subj = $entity->head->get('Subject');
>
> First is there a better way?

Yes, use the $Subject variable that Mimedefang gives you!


> Second, what I get back always has "#012" added to the end.  For example, if
> the actual subject is "foo", then the above get() method returns "foo#012".
> Why is this extra "#012" appearing?  And, is there a way to get just the
> subject?

That is the actual subject-- it ends with a linefeed character, #012.
Use chomp() to remove it.



Joseph Brennan

___
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] head->get('Subject') adds "#012"

2017-10-10 Thread Michael Fox
Thanks to Bill and Joseph.

Michael



___
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] base64 to quoted-printable

2017-10-10 Thread Michael Fox
I need to convert base64 to something readable.  Per previous suggestions on
this list, I'm going to convert it to quoted-printable.  So far, I'm using:

 

if ($bh = $entity->bodyhandle) ;

$qp_body = encode_qp($bh->as_string)

}

 

It seems to work (I use md_syslog() to show the first 20 chars).  Is that
right?  Or is there a better way? 

 

Then, I see an action_change_header(), but no action_change_body().  So,
presume I need to build a new entity by copying headers from the old entity,
replacing the Content-Transfer-Encoding header, and replacing the body.
Then use replace_entire_message().

 

Does that sound about right?

 

Also, I've got to believe someone else has needed to do this before.  But
I'm finding it tough to locate examples.  I'm looking at docs for
mime::tools, mime::body, etc. but I'm hoping to locate examples of the
entire process.  Any pointers?

 

Thanks,

Michael

 


___
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] base64 to quoted-printable

2017-10-10 Thread Joseph Brennan
On Tue, Oct 10, 2017 at 1:48 PM, Michael Fox  wrote:
> I need to convert base64 to something readable.
>
> Also, I've got to believe someone else has needed to do this before.


To be honest I can't think of a reason to do this. Any client from
this century can read base64. Mimedefang and Spamassassin can read it
too, so searching content just works.

(You may have explained a special case, and if so, I'm sorry I forgot.)


Joseph Brennan

___
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] base64 to quoted-printable

2017-10-10 Thread Dianne Skoll
On Tue, 10 Oct 2017 16:11:07 -0400
Joseph Brennan  wrote:

> On Tue, Oct 10, 2017 at 1:48 PM, Michael Fox  wrote:
> > I need to convert base64 to something readable.

> To be honest I can't think of a reason to do this. Any client from
> this century can read base64. Mimedefang and Spamassassin can read it
> too, so searching content just works.

And QP is not necessarily any more readable than B64, depending
on the source language.

Is =D7=A2=D7=91=D7=A8=D7=99=D7=AA=E2=80=8E any more readable than
16LXkdeo15nXquKAjg== ?

:)

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] base64 to quoted-printable

2017-10-10 Thread Michael Fox
> On Tue, 10 Oct 2017 16:11:07 -0400
> Joseph Brennan  wrote:
> 
> > On Tue, Oct 10, 2017 at 1:48 PM, Michael Fox  wrote:
> > > I need to convert base64 to something readable.
> 
> > To be honest I can't think of a reason to do this. 

Nevertheless, I need to for an old client.

So, back to my question:

if ($bh = $entity->bodyhandle) ;

$qp_body = encode_qp($bh->as_string)

}

It seems to work (I use md_syslog() to show the first 20 chars).  Is that
right?  Or is there a better way? 

Then, I see an action_change_header(), but no action_change_body().  So,
presume I need to build a new entity by copying headers from the old entity,
replacing the Content-Transfer-Encoding header, and replacing the body.
Then use replace_entire_message().

Does that sound about right?

Michael


___
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