curl / Mailing Lists / curl-users / Single Mail

curl-users

Re: Mail received but message body is empty

From: Dutch Raf via curl-users <curl-users_at_cool.haxx.se>
Date: Wed, 21 Jun 2017 10:41:54 +0000

Hi,


here are the answers:

a) does the mail you receive contain all the headers that you showed us
in the file? - ie the Content-Type: though to MIME-Version?

yes, all headers are in de the properties of the received mail.
even the filename is mentioned in the headers, so it is receiving the file.
The SMTP server is an MS Exchange 2010 relay server.

The header properties in my received mail: (servernames etc. are modified)

Received: from blablaserver (blablaIPaddress) by blablaserver (blablaIPaddress) with Microsoft SMTP Server (TLS) id 15.0.1263.5 via Mailbox
 Transport; Tue, 20 Jun 2017 13:44:45 +0200
Received: from blablaserver (blablaIPaddress) by blablaserver (blablaIPaddress) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Tue, 20 Jun 2017 13:44:45 +0200
Received: from mailtext.txt (server1) by blablaserver (blablaIPaddress) with Microsoft SMTP Server id 15.0.1263.5 via Frontend
 Transport; Tue, 20 Jun 2017 13:44:45 +0200
From: "server1" <server1_at_domain.com>
To: "myName" <myemail_at_domain.com>
Subject: This is a test message from server1
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Message-ID: <715c70b20c214f7c8a12b4da3bfecd33_at_blablaserver>
Return-Path: server1_at_domain.comDate: Tue, 20 Jun 2017 13:44:45 +0200
X-MS-Exchange-Organization-Network-Message-Id: 3177f279-f0ec-435e-9fe1-08d4b7d1bf6b
X-MS-Exchange-Organization-AVStamp-Enterprise: 1.0
X-MS-Exchange-Organization-AuthSource: blablaserver
X-MS-Exchange-Organization-AuthAs: Anonymous

 b) does the text file contain just one blank line between the headers
and the message body?


yes, just one blank line
I finished the message body with CR/LF . CR/LF like the RFC 5.... (forgot the number) describes

 c) what OS is this under?

The OS is a VMware VCSA 6.5 (Virtual vCenter Server Appliance)
cat /proc/version
Linux version 4.4.8 (root_at_photon) (gcc version 5.3.0 (GCC) ) #1-photon SMP Fri Oct 21 20:13:51 UTC 2016

Does the file have the usual line-end characters in it?

That is what I don't know for sure. I did a "cat -eT" and it gives me the $ char at the end of each line.
The same behaviour with vi and with the command sed -n 'l'

curl version is:
curl 7.47.1 (x86_64-pc-linux-gnu) libcurl/7.50.0-DEV OpenSSL/1.0.2j zlib/1.2.8 c-ares/1.11.1-DEV
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP UnixSockets

grtz,
Dutch




----------------------------------------------------------------------

Message: 1
Date: Tue, 20 Jun 2017 14:26:39 +0000
From: Dutch Raf <dutchraf_at_outlook.com>
To: "curl-users_at_cool.haxx.se" <curl-users_at_cool.haxx.se>
Subject: Mail received but message body is empty
Message-ID:
        <DB6PR10MB0743A1AB57FDD695DF53CD3EC7C50_at_DB6PR10MB0743.EURPRD10.PROD.OUTLOOK.COM>

Content-Type: text/plain; charset="utf-8"

Hello all,

My problem: Mail received but message body is empty


I have tried plain text and html format for the --upload-file numerous times now, but I can't get the message body to work.

I receive the e-mail, the subject is ok and corresponds to the subject in the --upload-file but the message body is ignored. So the e-mail does not show any text.


I have used the following: (the content of the file is between the "-----", the "-----" are not part of the content)


-----

From: "server1" <server1_at_domain.com>
To: "myName" <myemail_at_domain.com>
Subject: This is a test message from server1
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0

This should be the e-mail text message,

and this could go on for a couple of lines.


.


-----


the command I used from bash:

curl -v smtp://smtprelay.domain.com --mail-from server1_at_domain.com --mail-rcpt myemail_at_domain.com --upload-file ./mailtext.txt


Because I receive the mail, something must be wrong with the content of the --upload-file ./mailtext.txt.


Any help is very welcome. 😊


grtz,

Dutch

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cool.haxx.se/pipermail/curl-users/attachments/20170620/e678d8bb/attachment-0001.html>

------------------------------

Message: 2
Date: Tue, 20 Jun 2017 21:45:08 +0100
From: Jeremy Nicoll <jn.ml.crlu.36_at_letterboxes.org>
To: curl-users_at_cool.haxx.se
Subject: Re: Mail received but message body is empty
Message-ID:
        <1497991508.3717172.1015864248.37BE17D1_at_webmail.messagingengine.com>
Content-Type: text/plain; charset="utf-8"

On Tue, 20 Jun 2017, at 15:26, Dutch Raf via curl-users wrote:
> Hello all,
>
> My problem: Mail received but message body is empty
>
> I have tried plain text and html format for the --upload-file numerous
> times now, but I can't get the message body to work.
>
> I receive the e-mail, the subject is ok and corresponds to the subject in
> the --upload-file but the message body is ignored. So the e-mail does not
> show any text.

a) does the mail you receive contain all the headers that you showed us
in
   the file? - ie the Content-Type: though to MIME-Version?

b) does the text file contain just one blank line between the headers
and
     the message body?

c) what OS is this under? Does the file have the usual line-end
characters
    in it?


--
Jeremy Nicoll - my opinions are my own.


------------------------------

Message: 3
Date: Wed, 21 Jun 2017 02:46:09 -0400
From: Ray Satiro <raysatiro_at_yahoo.com>
To: curl-users_at_cool.haxx.se
Subject: Re: Mail received but message body is empty
Message-ID: <6c479980-e601-5587-4631-eb0c56659e70_at_yahoo.com>
Content-Type: text/plain; charset="utf-8"

On 6/20/2017 10:26 AM, Dutch Raf via curl-users wrote:
>
> My problem: Mail received but message body is empty
>
>
> I have tried plain text and html format for the --upload-file numerous
> times now, but I can't get the message body to work.
>
> I receive the e-mail, the subject is ok and corresponds to the subject
> in the --upload-file but the message body is ignored. So the e-mail
> does not show any text.
>
>
> I have used the following: (the content of the file is between the
> "-----", the "-----" are not part of the content)
>
>
> -----
>
> From: "server1" <server1_at_domain.com>
> To: "myName" <myemail_at_domain.com>
> Subject: This is a test message from server1
> Content-Type: text/plain; charset="us-ascii"
> Content-Transfer-Encoding: quoted-printable
> MIME-Version: 1.0
>
>
> This should be the e-mail text message,
>
> and this could go on for a couple of lines.
>
>
> .
>
>
> -----
>
>
> the command I used from bash:
>
> curl -v smtp://smtprelay.domain.com --mail-from server1_at_domain.com
> --mail-rcpt myemail_at_domain.com --upload-file ./mailtext.txt
>
>
> Because I receive the mail, something must be wrong with the content
> of the --upload-file ./mailtext.txt.
>

I can't reproduce this. I tested with gmail and I received it ok
several times. I tried a recent version of curl 7.54.1-DEV and an old
version curl 7.39.0. Maybe your mail provider requires content length
header? Check the content of the raw received message for content length
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cool.haxx.se/pipermail/curl-users/attachments/20170621/5edaeebd/attachment-0001.html>

------------------------------

Subject: Digest Footer

_______________________________________________
curl-users mailing list
curl-users_at_cool.haxx.se
https://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users

curl-users Info Page - Haxx<https://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users>
cool.haxx.se
How to use the curl command line tool. Bugs, new ideas, features and similar. Use the curl-users mailing list. Before you consider sending any mails to this list ...





------------------------------

End of curl-users Digest, Vol 142, Issue 5
******************************************

-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2017-06-21