
MIME-Tools - MIME::Entity - extra newline problem
Hello,
I have a problem with MIME::Entity->as_string() inserting extra
newlines. The message I create is to be posted to a news server,
therefore it has a Newsgroups: header line. Here's the code I use to
create the message:
$entity = MIME::Entity->build(Type => "text/html",
From => $sender,
Subject => $subject,
Date => $date,
"Message-ID" => $msgId,
"Newsgroups:" => $newsgroups,
Data => $data);
where $newsgroups is equal to:
"abcdefg,hijklmn,opqrst,uvwxyzabcde,fghijk,lmnopqrst,uvwxyzab,cdefghijk"
which is just a long list of newsgroup names I made up to exceed the
62-character limit (it always chops off after the 62nd character).
I post the message using the as_string() method as follows:
$newsServer->post($entity->as_string());
Here's the offending line from the text that as_string is returning:
Newsgroups:
abcdefg,hijklmn,opqrst,uvwxyzabcde,fghijk,lmnopqrst,uvwxyzab,c
defghijk
It chopped off the last newsgroup name and continued on the next line!
The news server spits back an error when it receives messages like
this. Is there any way I can turn this line-splitting behavior off?
Thanks,
Andy