procmail
[Top] [All Lists]

Re: How to process messages with ^M characters?

2001-10-03 08:12:39
Marc advised Dominic,

| when uploading ascii file in binary mode with ftp you should use..
|
| sed -e "s/\r\n/\n/" this will problably be the same, convert a dos enter
| to a unix enter.

In sed "\n" matches only an embedded newline, not the one at the end of the
pattern space, and "\r" isn't recognized at all (well, maybe in a few
extended seds).  The above code will never match and never substitute.

 sed 's/^M$//'

will do it, usually requiring ctrl-V enter or ctr-V ctrl-M to enter the ^M.
However, Dominic was already taking care of that by filtering through
dos2unix.

Let's go back to Dominic's problematic recipe that he said is leading to
losing the messages:

:0:
* ^(To|Cc|From):.*jobboom\.com
| $dos2unix | formail -A "X-Sorted: Jobs" >> $JOBS

My first four guesses are that (1) the dos2unix variable isn't getting set
as he thinks it is [it is better to call executables by their basenames,
adding directories to $PATH if needed, than to assign variables and rely on
those; I don't understand why people do that], (2) the dos2unix program is
bombing and generating no output, (3) the JOBS variable is unset or null, or
(4) the JOBS variable points somewhere other than where Dominic expects, so
when he says the mail is lost, it's really in $JOBS but $JOBS isn't where
he's looking for it.

The usual question: what does a verbose logfile say?


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