Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

handle format=flowed in perl script

Status
Not open for further replies.

meesterfox

Technical User
Apr 26, 2008
1
US
Hello,

I use net::pop3 to grab a message from my mailserver, store it's contents in an array, then parse the lines. for example,
name
address
company

name
address
company

and so on. the problem i have is when the address is long, it chops it and creates a new line. so now it's
name
address
more address
company

which goofs things up. this, from what I can tell, has to do with the format=flowed dude when using ascii in mail (aka plaintext). or something like that, when a line is over 79 characters or so it inserts a break.

I need to remove this soft line break of sorts so that address stays as one line.

I have scoured the internet and have found nothing on this. my mail program reassbles things correctly, making the message look as it was sent. when i use squirrelmail, it does not reformat it back to the original. so in it's pure form, there are soft line breaks, which i need to remove.

any idea's?
 
Haven't used net::pop3 so the following may not fit the context you need. However can you check the size of the array and if greater than 3 lines, merge the middle two?

i.e.

@mail_array = &server_call();
if ($#mail_array > 2) {
$mail_array[1] .= $mail_array[2] ;
$mail_array[2] = pop @mail_array ;
};

This is a little brute force but it may get done what you need until you can find something more elegant.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top