Mangling of non-ASCII attachment file-names

It is not a 100%-reproducible problem that seems to happen in several cases involving both an OUCS 7u4 and an old JCS 5 server (when exchanging messages between each other or even within a server bypassing any milters for example, or sending to other domains such as google, posting with web or SMTP-Auth).
  The common thing is that the received attachment's headers lose the piece about character encoding of the first line of the filename:
--Boundary_(ID_aNbA9YOhlTUcvRNjPMb27Q)
Content-type: application/vnd.ms-excel;
name="0LPRgNCw0LzQvNGDINC+INC/0L7Rh9GC?=
=?UTF-8?B?0L7QstC+0Lkg0YHQuNGB0YLQtdC80LUg0LIg0KDQvtGB0L/QtdGH0LDRgtC4Lng=?=
=?UTF-8?B?bHM=?="
Content-transfer-encoding: base64
Content-disposition: attachment;
filename="0LPRgNCw0LzQvNGDINC+INC/0L7Rh9GC?= =?UTF-8?B?0L7QstC+0Lkg0YHQuNGB0YLQtdC80LUg0LIg0KDQvtGB0L/QtdGH0LDRgtC4Lng=?=
=?UTF-8?B?bHM=?=";
filename*0*=UTF-8''%D0%9E%D1%82%D0%B2%D0%B5%D1%82%20%D0%BD%D0%B0%20%D1%82;
filename*1*=%D0%B5%D0%BB%D0%B5%D0%B3%D1%80%D0%B0%D0%BC%D0%BC%D1%83%20%D0;
filename*2*=%BE%20%D0%BF%D0%BE%D1%87%D1%82%D0%BE%D0%B2%D0%BE%D0%B9%20%D1;
filename*3*=%81%D0%B8%D1%81%D1%82%D0%B5%D0%BC%D0%B5%20%D0%B2%20%D0%A0%D0;
filename*4*=%BE%D1%81%D0%BF%D0%B5%D1%87%D0%B0%D1%82%D0%B8%2E%78%6C%73
Sometimes messages do pass correctly, and in all cases they are saved into "Sent" folder correctly, so it is not a client error for example:
--------------090501050302010603060805
Content-Type: application/vnd.ms-excel;
name="=?UTF-8?B?0J7RgtCy0LXRgiDQvdCwINGC0LXQu9C10LPRgNCw0LzQvNGDINC+INC/0L7Rh9GC?=
=?UTF-8?B?0L7QstC+0Lkg0YHQuNGB0YLQtdC80LUg0LIg0KDQvtGB0L/QtdGH0LDRgtC4Lng=?=
=?UTF-8?B?bHM=?="
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename*0*=UTF-8''%D0%9E%D1%82%D0%B2%D0%B5%D1%82%20%D0%BD%D0%B0%20%D1%82;
filename*1*=%D0%B5%D0%BB%D0%B5%D0%B3%D1%80%D0%B0%D0%BC%D0%BC%D1%83%20%D0;
filename*2*=%BE%20%D0%BF%D0%BE%D1%87%D1%82%D0%BE%D0%B2%D0%BE%D0%B9%20%D1;
filename*3*=%81%D0%B8%D1%81%D1%82%D0%B5%D0%BC%D0%B5%20%D0%B2%20%D0%A0%D0;
filename*4*=%BE%D1%81%D0%BF%D0%B5%D1%87%D0%B0%D1%82%D0%B8%2E%78%6C%73
As can be seen in this example, the boundary identifiers have changed (meaning IMHO that the message was processed - taken apart and put together again), and in this example only part of the first line makes it into the received message's filename header.
Another example:
"Sent":
--------------010609000006000200040201
Content-Type: application/pdf;
name="=?UTF-8?B?0YLQtdC70LXQs9GA0LDQvNC80LAg0L4g0YDQsNCx0L7RgtC1INGB0LjRgdGC0LXQvA==?=
=?UTF-8?B?0Ysg0L7QsdC80LXQvdCwINGN0LvQtdC60YLRgC4g0L/QvtGH0YLQvtCy0YvQvNC4?=
=?UTF-8?B?INGB0L7QvtCx0YnQtdC90LjRj9C80Lgg0L7RgiAxNC4xMC4xMy5wZGY=?="
"Received":
--Boundary_(ID_kv6CyB9foC+l8rLg7THT2g)
Content-type: application/pdf;
name="QsdC80LXQvdCwINGN0LvQtdC60YLRgC4g0L/QvtGH0YLQvtCy0YvQvNC4?=
=?UTF-8?B?INGB0L7QvtCx0YnQtdC90LjRj9C80Lgg0L7RgiAxNC4xMC4xMy5wZGY=?="
Since this happens both on a server with a spam/virus filters and on a server without any of those, and it is not 100% reproducible (though frequent) I can guess that sometimes messages pass through channels such as (de-)fragmentation, or Sieve, or something, and this breaks them.
Any ideas? Is this a misconfiguration or a CommSuite bug?
Thanks,
//Jim Klimov

There is no reconstruction from anything involved, although perhaps there should be. The code simply checks the length of the parameter, and if it's bigger than the limit, truncates the string from the beginning. The idea behind truncating from the beginning is that way the file extension may perhaps be preserved.
I should have noted that use of encoded-words in parameters, while fairly common in practice, is nevertheless explicitly forbidden by RFC 2047. So this usage is problematic from the start. The standard way to encode utf-8 in content-type and content-disposition parameters is specified in RFC 2231, and it is what is being used in the content-disposition field. So whatever is producing this field is trying to work with both standards-compliant and standards-incompliant receivers. This sounds great right up to the point where an interaction like this occurs.
Additionally, agents should be keying preferentially off content-disposition information since this usage of a name parameter on a content-type for which it isn't defined is also incompliant.
I don't see any way how the intermittent nature of the problem could have anything to do with the charset used, other than the length of the same information encoded in different charsets can vary considerably. (iso-2022-jp is especially problematic in headers for various reasons I won't bother describing here.)
As for known issues, there certainly aren't any problems handling long parameters in Messaging Server. Outside of the known problem with parameters longer than 128 characters, I don't know the point at which other agents start to malfunction. But you also have to ask yourself: Given the hard limit of 255 octets imposed by many if not most filesystems, is it in way sensible to be sending stuff longer than that around? As such, it's hard to argue that something that exceeds, say, a 1K limit is worth accomodating.

Similar Messages

  • BUG: Extra characters at the end of attachment file names

    I received complaints that my attachments didn't open on the PC's of the recipients. After I saw the messages I noticed there were extra characters at the end of their file names. That's why they wouldn't open. When I looked into my sent mail folder it was there as well. The addition took place when I sent the mail, while composing everything looked fine. It took me a while to realize the pattern. There was one extra for every non-ASCII character in the file name.
    Apparently Mail.app is using two different libraries. The other one counts the non-ASCII characters as two while the other doesn't. I don't know whether Finder still uses MacRoman or Unicode, but this seems to relate to double-byte characters.
    The short term solution is to use only ASCII for file names, but that's not what OS X is all about.

    The class files are broken. Recompile them. If you're uploading them, doublecheck if the FTP program used doesn't do mad things with binary files.

  • Decode attachment file name RFC 2231

    Hello,
    according to the [RFC 2231|http://tools.ietf.org/html/rfc2231] , the headers are encoded to something like
    From: =?US-ASCII*EN?Q?Keith_Moore?= <[email protected]>
    How can decode such a string, in Java ? I've found only [this implementation|http://svn.apache.org/repos/asf/geronimo/specs/tags/geronimo-javamail_1.4_spec-1.5/src/main/java/org/apache/geronimo/mail/util/RFC2231Encoder.java] from Apache Geronimo. Are there other implementations ?
    Thanks,
    T.

    Your subject talks about attachment file names, but your example uses the From header.
    For attachment file names and other parameters, set the property mail.mime.decodeparameters
    to "true". See the javadocs for the javax.mail.internet package for the list of properties you can set.
    Unfortunately, JavaMail doesn't support the specification of a language ("EN") in addition to a charset
    ("US-ASCII") as in your example. That's a bug that I'll need to fix.

  • Mail adapter - how to dinamically change attachment file name in sending

    How can I dynamically change the attachment filename when preparig email to be sent? The attachment is an invoice in XML format and I have to put the invoice number into the attachment file name.
    Thanks in advance.
    Giuseppe.

    Hi,
    Go through this docs.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9e6c7911-0d01-0010-1aa3-8e1bb1551f05
    http://help.sap.com/saphelp_nw04/helpdata/en/6b/4493404f673028e10000000a1550b0/content.htm
    Hope these bloga are useful..
    /people/community.user/blog/2006/09/07/email-reporting
    /people/community.user/blog/2006/09/08/email-report-as-attachment-excelword
    /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
    /people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
    /people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken]
    /people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter
    Thanks,
    Satya

  • Mail adapter- Attachment file name of scheme ddmm

    Hi ,
    I am working on File to Mail scenario.
    I checked on SDN, but I could not find exact solution.
    My requirement is :
    I need to mail HTML report file as attachment.
    To generate attachment file, I have done XSL mapping.
    Attachment file name should be : yyyymmdd.htm
    Mail text should be: This is autogenerated mail, please do not reply.
    Mail subject: SAP XI report ddmmyyy
    Please provide your inputs.
    Best Regards,
    Divyesh

    Hi Henrique,
    Thanks a lot for your response.
    Your answer is very helpful.
    I tried your code.
    I am getting error in RWB:  here I am including audit Log:
    2009-04-02 17:39:41 Success MP: Entering module processor
    2009-04-02 17:39:41 Success MP: Processing local module localejbs/CreateAttachment
    2009-04-02 17:39:41 Success MP: Processing local module localejbs/sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean
    2009-04-02 17:39:41 Success Mail: message entering the adapter
    2009-04-02 17:39:41 Success Mail: Receiver adapter entered with qos ExactlyOnceInOrder
    2009-04-02 17:39:41 Success Mail: calling the adpter for processing
    2009-04-02 17:39:42 Error Mail: call failed; java.io.IOException: Missing mandatory element <sap:Manifest><sap:Payload><sap:Name>
    2009-04-02 17:39:42 Success Mail: sending a delivery error ack ...
    2009-04-02 17:39:42 Success Mail: sent a delivery error ack
    2009-04-02 17:39:42 Error MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: java.io.IOException: Missing mandatory element <sap:Manifest><sap:Payload><sap:Name>
    2009-04-02 17:39:42 Error Mail: error occured: com.sap.aii.af.ra.ms.api.RecoverableException: java.io.IOException: Missing mandatory element <sap:Manifest><sap:Payload><sap:Name>
    2009-04-02 17:39:42 Error Exception caught by adapter framework: java.io.IOException: Missing mandatory element <sap:Manifest><sap:Payload><sap:Name>
    2009-04-02 17:39:42 Error Delivery of the message to the application using connection Mail_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: java.io.IOException: Missing mandatory element <sap:Manifest><sap:Payload><sap:Name>.
    2009-04-02 17:39:42 Success The message status set to WAIT.
    Can you please provide me help on this?
    Best Regards,
    Divyesh

  • Mail to File - how to read the attachment file name from the subject.

    I need to use the SHeaderSUBJECT's value in the receiver file adapter's variable substitution.
    This is a Mail to File scenario without design part where the attachment file name comes in the subject of the mail.
    I see the below in the dynamicconfiguration section. How can i retrive the value from dynamicconfiguration section to the filename.
    <SAP:DynamicConfiguration xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
    <SAP:Record namespace="http://sap.com/xi/XI/System/Mail" name="SHeaderSUBJECT">PlainAttachment.txt</SAP:Record>
    </SAP:DynamicConfiguration>
    Points will be rewarded.

    Try to use sthg like this in a UDF :
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().getStreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create(“http://sap.com/xi/XI/System/Mail”,“SHeaderSUBJECT”);
    String value = conf.get(key);
    or in a JAVA mapping :
    DynamicConfiguration dynConf = (DynamicConfiguration) param.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey dynKey = DynamicConfigurationKey.create((“http://sap.com/xi/XI/System/Mail”,“SHeaderSUBJECT”);
    String keyValue = dynConf.get(dynKey);
    param is the map object from the execute() method of your mapping ...
    Hope this helps
    Chris
    Edited by: Christophe PFERTZEL on Apr 23, 2008 11:34 AM

  • Javamail API doesn't support special characters in attachment file name

    Hi,
    We are using Java Mail API to retrieve the attachment's file name, but it sometimes returns the file name as junk character (if the attachment contains special characters) and it is not able to return original file name for some attachments:
    Our code sample :
    void getFileName(Part part) {
    String fname=null;
    fname = part.getFileName();                          
    Actually the problem is with the attachment file name which contains special character. For example below is the attachment file name (please find the sample attached file which is causing this issue):
    Sample – 1234abc.doc
    From above you could see the file name contains a special character (Sample – 1234abc.doc), i.e. The character ‘–’ is not a regular hyphen character, it’s a special character. Hence the Java mail API returns the name as below:
    Sample ? 1234abc.doc
    So the special character is being replaced with ‘?’ symbol. But if I store this file in local folder and try reading the file name using Java IO packages, it returns the file name without adding ‘?’ symbol.
    Is there any way to handle such kind of special characters in Mail API?
    Regards,
    Vinodh

    We dealt with this issue in a private email conversation.
    JavaMail is returning the correct data for the filename.  The problem is in the way the filename is being displayed.

  • Issue with attachment file name

    Hi All,
    This is about an issue with attachment file name:
    we have a scenario wherein we have payload with attachments ...(attachments can be any doc ,pdf) , problem is main document is comming with messageid.sap.com and thats normal but attachments are comming with file names for example something.pdf or something.doc or something.txt ...this is failing in adapter as it expects same name as u have in main document...anybody have any idea to get through this issue...
    Regards
    kiran

    we have a scenario wherein we have payload with attachments ...(attachments can be any doc ,pdf) , problem is main document is comming with messageid.sap.com and thats normal but attachments are comming with file names for example something.pdf or something.doc or something.txt ...this is failing in adapter as it expects same name as u have in main document...anybody have any idea to get through this issue...
    - <SAP:Payload xlink:href="cid:payload-4CED452F17C601BDE10080000A492050---sap.com">
      <SAP:Name>1 .Header1.txt</SAP:Name>
    Error we are getting is
    Cannot cast 'Header' to boolean] in class com.sap.aii.mappingtool.flib7.NodeFunctions method createIf[Header, com.sap.aii.mappingtool.tf7.rt.Context---27a73bfa]
    So we have to change the File name Header1.txt to something which we can cast to creatif....(we cannot tell the sendr to change the file name as its is set already)
    Thanks for interste and assisting
    Regards
    Kiran

  • Set Attached File name to Table Cell

    Hello All,
    I have a scenario where:
    1. I have a dynamic table.
    2.Every Row has a Button for attaching the new File.
    3. When we add new Row to the Table, I want to get the attached file name in the corresponding cell. i.e Cell2 in following example.
    I have tried doing it this way
    The script which I'm using on Add button is
    app.execMenuItem(&quot;AddFileAttachment&quot;);
    var o = event.target.dataObjects;
    var n = &quot;&quot;;
    DataNode.Table1.Row1.Cell2.rawValue = &quot;&quot;;
    if (o !== null) {
              for (var i = 0; i < o.length; i += 1) {
                        n = o[this.parent.index].name;
    var countVal = (DataNode.Table1.Row1.instanceManager.count-1);
    xfa.resolveNode(&quot;DataNode.Table1.Row1[&quot;+countVal+&quot;].Cell2&quot;).rawValue = n;
      But I'm not able to display the attached file name in Cell2 of the Table.
    How can we do it?
    Thanks and Regards,
    Nikhil

    Hello All,
    I even tried doing the same using  http://eslifeline.wordpress.com/2009/04/06/adding-attachments-to-pdf-form/
    But I'm not able to add the file name to the table cell.
    Can anyone please guide me through this?
    Thanks and Regards,
    Nikhil Joshi

  • Attachment File Name

    I have a form that was created and is used by users on my local network. The problem is that when a user emails the form using the send by email button I get the email but the attachment file name is always the same. This creates a problem because when I go to save the attachment it wants to over write the files. I need to have the file name be unique for each email.

    no, not to my knowledge

  • Need attachment file name which had sent or received in entire days.

    Hi Friends
    I need your help for getting information on exchange mailbox user who had sent or received  mails along with attachment file name for entire day.
    Basically I get the information of entire mails which had received or sent in all days but I am unable to get the information about attachment file name.
    Please do the needful.
    Regards, Md Ehteshamuddin Khan All the opinions expressed here is mine. This posting is provided "AS IS" with no warranties or guarantees and confers no rights.

    Hi,
    Based on my knowledge, Exchange has no built-in feature to get the attachment statistics report. But you can check if EWS can achieve it.
    About issues related to EWS, actually, we have a dedicated support team regarding the Exchange Server Development. I recommend you ask your question on our Exchange Server Development forum which is staffed by more experts specializing in this kind of problems.
    Thanks for your understanding.
    For your convenience:
    http://social.technet.microsoft.com/Forums/en-US/exchangesvrdevelopment/threads
    Hope this can be helpful.
    Best regards,
    Amy Wang
    TechNet Community Support

  • Chnage attachment file name

    We have Oracle 10g application server ,i used rwlicent to send report as email and it works fine the only problem that i couldnot controll the attachment file name,
    is it possible to change the file name?
    any help so appritiated .
    Regards

    Are you using a distribution.xml for the emailed reports? If not you can pass destination=distribution.xml on your rwclient call.
    distribution.xml:
    <destinations>
    <foreach>
      <mail id="a6" to="[email protected]" subject="Personnel Reports">
        <attach format="pdf" name="attach.pdf" srcType="report" instance="this">
          <include src="mainSection"/>
        </attach>
        <attach format="rtf" name="attach.rtf" srcType="report" instance="this">
          <include src="trailerSection"/>
        </attach>
      </mail>
    </foreach>
    </destinations>You can change the attach.rtf to be a parameter value using &<parametername> syntax. Look here for details on using the distribution.xml file.

  • Attachment - File name with accents

    Hello,
    I finally realized why Mail was sending weird name attachements (.doc00, .doc\ca, etc.). It happens when a file name contains an accent (é, à, è...). Now, I'm French, so accents are very useful...
    I mean, why is this happening now? Is Mac OS becoming like Windows NT or 98?
    Any fixes in sight? Any solutions?
    Thanks,
    Daniel
    P.-S. : Tried 10.5.3, not better, plus the upgrade crashed my IBook G4 two times! Way to go, Apple!

    When I use Thunderbird/gmail to send my email, and the attachment with non-ASCII file name can be read correctly using the following codes:
    String attFileName = MimeUtility.decodeText(part.getFileName());
    but when I send the email use outlook2003, it just return bad file name.
    The following is the attachment related content:
    Thunderbird:
    --------------090808030807020200030902
    Content-Type: text/plain;
    name="=?GB2312?B?ztK1xLzGy+MudHh0?="
    Content-Transfer-Encoding: base64
    Content-Disposition: attachment;
    filename*=GB2312''%CE%D2%B5%C4%BC%C6%CB%E3%2E%74%78%74
    OUTLOOK:
    ------_=_NextPart_001_01CACBCD.3577323E
    Content-Type: text/plain;
    name="=?gb2312?B?ztK1xLzGy+MudHh0?="
    Content-Transfer-Encoding: base64
    Content-Description: =?gb2312?B?ztK1xLzGy+MudHh0?=
    Content-Disposition: attachment;
    filename="=?gb2312?B?ztK1xLzGy+MudHh0?="
    GMAIL:
    --000e0cd11976ac6e63048297dd06
    Content-Type: text/plain; name="=?GB2312?B?ztK1xLzGy+MudHh0?="
    Content-Disposition: attachment; filename="=?GB2312?B?ztK1xLzGy+MudHh0?="
    Content-Transfer-Encoding: base64
    X-Attachment-Id: f_g770st560
    What is the difference?

  • Apostrophe ( ' ) in the attachment file name

    Hi Guys,
    We have a EP application where the users are allowed to attach files. In the UAT and Prod box, there is apache server where as its not there in development.
    The issue is coming in UAT and production
    The user attached a file with (') in it e.g. SAP's.jpg
    The file was attached but when the user tries to view it, it gets error as
    FORBIDDEN
    you dont have permission to access /irj/go/km/docs/documents/SAP's.jpg
    I tried to use different file names such as  SAP~s.jpg. All seems to work so its not really a special character issue.
    BASIS team is not able to find any setting which could allow this.
    Appreciate if you can provide some explaination or the list of character which are not allowed.
    Thanks,
    Shailesh

    It seems (') is not allowed due to security reasons thus has a special meaning so not allowed

  • Icloud mail attachment file name error

    Here is what i found out on icloud.com using Mozilla Firefox ver 15.
    If attachment name starts with "Print" in iCloud mail, it will not save properly when you click it.
    File name contains only "Print" no matter the length of file name.

    Is the reciever using windows? If so you can choose Edit > Attachments > Always Send Windows Friendly Attachments.

Maybe you are looking for

  • Help needed in overriding the finalize() method!

    Hi I need some help in overwriting the finalize() method. I have a program, but at certain points, i would like to "kill" a particular object. I figured that the only way to do that is to make that object's class override the finalize method, and cal

  • 13'' dual-core with 16gb ram vs 15'' quad-core 8gb ram -- ram vs cores?

    Hello.  I am at a point between choosing a 13'' dual-core i5 with 16gb ram vs the 15'' quad-core with 8gb ram - both retinas. I will be using photoshop and illustrator while uploading/downloading large files constantly.  After much headscratching I a

  • Connecting my ibook to my G4 with firewire

    Hi, I just bought a used dual USB ibook and would like to connect it to my G4 AGP using the firewire connect to transfer files and what-not. Is there anything special I need to know or is it pretty straight forward? Thanks, Rick

  • Today is the day the preloading will work! Help...

    I've tried and tried to find different ways to make the preloading work correctly but there is always something that doesn't seem to work with each way. Could someone dumb it down for me and help me understand how to make this work. I've read everyth

  • Mac OS X Kernel Crash

    When watching a video stream on full screen (http://www.rtl.nl/components/shows/ditwashetnieuws/index_video.xml - won't stream outside of the NL), my macbook crashed twice in exactly the same way. It is as if a curtain goes down in the screen (top to