Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
unfolding header lines in TIdAttachment[File]
#7
(06-10-2018, 01:53 AM)Boba TC Wrote: This is what I would like to see in attachment header on the receiving server side:

Code:
Content-Type: text/plain; charset="US-ASCII"; name="testfilename.txt"
Content-Disposition: attachment; filename="testfilename.txt"
Content-Transfer-Encoding: base64

After reviewing Indy's code, I'm sorry to say that you will not be able to achieve that format without altering and recompiling Indy's code.  The folding is hard-coded in TIdMessageClient.SendBody(), it is not even being handled by TIdHeaderList at all.  So setting the folding setting of TIdAttachmentFile->Headers has no effect, like I thought it would.  I have created a ticket for this issue:

#215: TIdMessageClient.SendBody() should respect header folding settings for message parts.

But, you should also complain to the author of the GUI that it requires unfolded formatting to begin with, that it is not processing folded headers correctly.  All of the major email senders fold headers to some degree, the GUI needs to be able to handle that.

(06-10-2018, 01:53 AM)Boba TC Wrote: If I uncomment the line where attchmnt->ContentType is set, my message arrives with
Code:
Content-Type: text/plain; charset="US-ASCII"; name="testfilename.txt"
        name="testfilename.txt"

I am not able to reproduce that.  Using the latest SVN revision, I get only 1 "name" attribute no matter how I assign the attachment's ContentType and FileName properties.

(06-10-2018, 01:53 AM)Boba TC Wrote: the GUI is almost happy: it shows the attachment properly but when users try to save it to file, 
the file name shows as "testfilename.txt        _testfilename.txt_" with 8 spaces in the middle
and 2 underscores

Then the GUI is faulty and needs to be fixed.

Reply


Messages In This Thread
RE: unfolding header lines in TIdAttachment[File] - by rlebeau - 06-11-2018, 07:50 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)