procmail
[Top] [All Lists]

Re: How to process messages with ^M characters?

2001-10-03 07:37:15
On 10/02/01 07:54 PM, Jeff Haferman sat at the `puter and typed:

Quick (untested) answer, pipe it into sed:

| sed -e 's/^M//'

where the ^M is actually the control-M which can be
inserted using vi, for example, by using the keyboard
sequence ctrl-v ctrl-m

Uh, I always have to hit ctrl-v ctrl-<enter>

I usually use something like this:
:%s/^M//g
but this is in vim.  The pipe to sed above should work from procmail
though - provided you do get the correct key sequence.

Could also try 'tr', see "man tr"

Don't know anything about this.  Check it out to see if it fits your
situation better than the other suggestions.


Hi,

There is a list to which I am subscribe which sends automated mail
with ^M.  How can I get read of these?  I have tried to use recode
to do this:

Hmm.  Thinking about it some more, if you were to hit a message with a
binary attachment with the sed command above, you'd hose the binary.
Not sure how dos2unix would handle it.

For that matter, what the heck are they doing sending mail in that
format?  They must be doing a binary attach of a text file from a
Windoze box.  What is the mime type coming thru?  That could be part
of the problem.  You need to have some kind of text/* mime type.

HTH
Lou
-- 
Louis LeBlanc       leblanc(_at_)acadia(_dot_)ne(_dot_)mediaone(_dot_)net
Fully Funded Hobbyist, KeySlapper Extrordinaire :)
http://acadia.ne.mediaone.net                 Ô¿Ô¬

It is not every question that deserves an answer.
    -- Publilius Syrus

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail