If this isn't exactly what you wanted, please try our Search (there's a LOT of techy and non-techy stuff here about Linux, Unix, Mac OS X and just computers in general!):
From - Sun Jun 18 11:58:46 2000
Path: news.randori.com!news-hub.cableinet.net!newsfeed.icl.net!news.algonet.se!newsfeed1.telenordia.se!algonet!uab.ericsson.se!erix.ericsson.se!not-for-mail
From: per@erix.ericsson.se (Per Hedeland)
Newsgroups: comp.unix.sco.misc,comp.mail.sendmail,comp.lang.java.programmer
Subject: Re: Carriage Returns????
Date: 18 Jun 2000 12:51:44 GMT
Organization: Ericsson Utvecklings AB, Stockholm, Sweden
Lines: 50
Message-ID: <8iigl0$dq$1@news.du.uab.ericsson.se>
References: <394C1F53.1BC8FE2D@sprynet.com>
NNTP-Posting-Host: super.du.uab.ericsson.se
NNTP-Posting-User: per
X-Newsreader: trn 4.0-test69 (20 September 1998)
Xref: news.randori.com comp.unix.sco.misc:61934 comp.mail.sendmail:55453 comp.lang.java.programmer:228676
X-Mozilla-Status: 8010
X-Mozilla-Status2: 00000000
In article <394C1F53.1BC8FE2D@sprynet.com> Michelle Warner
<hrdbdy@sprynet.com> writes:
>I have an interesting problem. I am trying to send email via the
>JavaMail API to a SCO Unix machine. The body of the email contains
>carriage returns and newlines. When the email reaches the SCO Unix
>machine, the carriage returns are newlines.
This is expected behaviour if you send the message in "raw" form: The
SMTP spec says that end-of-line (EOL) should be represented as CRLF "on
the wire", and the sending and receiving systems are expected to
translate from/to the "local EOL convention". The local EOL convention
on Unix is LF only, so the Unix system correctly translates CRLF to LF
at delivery time.
> This is causing some
>problems for an application which receives the email via a pipe and the
>application expects/needs the carriage returns. I am not sure where the
>conversion is actually place but when I email the message to myself and
>open it with Lotus Notes the carriage returns are present,
Presumably you aren't running Lotus Notes on Unix...
> leading me to
>believe the problem is on the SCO Unix side. I checked the mail.cf (I
>think that is what it was called) and according to information in a
>SendMail book, sendmail should automatically recognize the carriage
>returns. Is there something I am missing? I need to keep the carriage
>returns. Thanks in advance.
Well, strictly speaking, if your message should be delivered on Unix
with CRLF-terminated lines, it isn't "text", and thus needs to be
encoded during transmission - you could e.g. use MIME with Content-Type:
application/octet-stream and Content-Transfer-Encoding: Base64 (Quoted-
Printable probably won't cut it as it more or less assumes "text").
This would be rather gross overkill for your problem though - the real
fix would be for your application to follow the conventions on the
system it is running on, and expect (or at least be prepared to deal
with) LF-only line termination. Failing that, you could just reinstate
the CRs before passing the message to it, e.g. by putting
perl -lpe 's/$/\r/'
ahead of it in the pipe. There are other ways to deal with this, but
those I can think of are more complex or intrusive. Bottom line is, it's
a problem with your application and/or the way you are communicationg
with it, not with the mail system.
--Per Hedeland
per@erix.ericsson.se
Enter your email address for automatic notification of new posts here
(be sure to whitelist 'feedburner.com' if you use spam filtering)
| Views for this page | ||||
|---|---|---|---|---|
| Today | This Week | This Month | This Year | Overall |
| 1 | 21 | 20 | 896 | 3,692 |
/Bofcusm/409.html copyright 1997-2004 (various authors) All Rights Reserved
Have you tried Searching this site?
Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates
This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Add your comments
comment on this page here