Mail Adapter Change File Extension

We have the receiver mail adapter setup to send the contents of a message to an internal email account. The adapter works and the message arrives as a soap.xml and payload.xml. The problem is that our mail system blocks the xml extension. Is there an easy way to switch the extensions from say xml to txt on the messages.
It looks like the PayloadSwapBean module can change the content type, but I just want to alter the extensions. I know I could use an XSLT to convert the contents to html and then just send the message as an html email but I was hoping to avoid design changes.
Regards

J,
Check note : 856599
<i>Q: Can I choose the name of an attachment in the mail?
           A: Yes. Most mail clients use some heuristics based on some MIME headers to derive the name of an attachment. The MIME headers involved in most heuristics are Content-Type, Content-Description, and Content-Disposition. When you create an XI message, the XI payload name is automatically set in the Content-Description. If you want to change or set all of these headers, you can use the MessageTransformBean module (Note 793922) in the adapter framework.
            Related questions: How can I set the file name of a mail attachment?
Q: How can I set the file name of a mail attachment?
            There are several MIME headers that play a role in how the client retrieves the file name of an attachment. Unfortunately, this behavior differs among various mail clients. The reason for this inconsistent behavior comes from the fact that this mechanism has been extended incrementally. The old way is to use the name parameter in the Content-Type header as specified in RFC1341. For example, you can set the content type of an XML attachment as:
           Content-Type: application/xml; name="abc.xml"
            RFC1521 discourages the use of this name parameter in anticipation of the new header Content-Disposition, which is defined in RFC1806.
            With this Content-Disposition header, you can set the file name as:
           Content-Disposition: attachment; filename="abc.xml"
            Some clients may show the Content-Description value as the file name. The Content-Description header is typically used to associate some descriptive information to an attachment (RFC1341) as in
           Content-Description: my xml file
            To avoid potential interpretation problems, it is recommended to combine the use of these headers.
How to use MailPackage in Receiver?
            A: When a mail message is sent out by the receiver adapter, normally the mail header information such as "From", "To", "Subject" are taken from the channel configuration. In order to dynamically set these headers, you can use the MailPackage mode. In this case, the XI payload must be formated in the Mail Package XML format. The format of this mail package XML document is defined in note 748024.</i>
Use the mail Package and the set the <b>Content-Disposition </b> with the file name and extension.
For info on how to use this mail package, take a look at this blog too,
/people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
Regards,
Bhavesh

Similar Messages

  • Change File Extensions (Newbie)

    I want to exchange .html extensions to .php in a folder. Actually, someone showed me how to it with AppleScript. However, someone else told me about Autmator, which looks like a really cool tool. Unfortunately, I can't figure out how to change file extensions with it.
    When I open Automator, I get a little window that lists seven scripts or functions, beginning with Change Extension. If I right-click on Change Extension and choose open with Automator 2.0, I get a bigger window ("untitled") with a long list of actions on the left. Again, I click Change Extensions.
    On the right is a little box titled "Ask for Finder Items." It includes three options:
    Prompt, Start at and Type. But I don't know how to precede. How do I indicate what file extension I want to change from or to?
    I first asked about Automator on a thread at
    http://discussions.apple.com/thread.jspa?messageID=9490359#9490359
    Someone posted an image that shows a second window where you type in the file extensions you want to work with. But I can't figure out how to make that window appear on my program.
    Thanks for any tips.

    Here's a simple solution. Select all the files in the folder by navigating to the folder in the Finder. With the files displayed press COMMAND-A to select them all. Press OPTION-COMMAND-I to open the Inspector window. In the Name and Extension field change the extension from .html to .php. Close the window.
    For more complete control over batch file changes download BatchRenameEm - VersionTracker or MacUpdate.

  • Mail.app Stripping File Extensions

    Greetings,
    I have had a very odd issue with Apple Mail stripping away file extensions from the end of attachments. Several folks I send to have issues opening these attachments and have to add the suffix onto the end of the filename (and yes they were on the end when sent). They are using both Macs and Windows boxes.
    I have tried to correct the issue in numerous ways including:
    - Defaulting Mail to send Windows friendly attachments
    - Defaulting my OS to always show file extensions
    - Trying numerous SMTP servers
    - Trying both my .Mac account and Earthlink account
    - Using different ISPs to send on all of the accounts and servers listed above
    - Sending in both RTF and plain text messaging
    The only way I have been successful in retaining the suffix has been to send through both the Earthlink and .Mac webmail services. The test file I have been using then arrives with no issues.
    All of the above makes me pretty sure it is a Mail.app issue. I am about to install Entourage (ick) but would prefer to find a solution. After lots of searching I am throwing it out there to see if anyone else has had the same issue.
    Any thoughts?
    PPC iMac and MacBook Pro   Mac OS X (10.4.10)  

    OK, here is the latest. Anyone else feel free to pipe in with possible solutions!
    - Sending to a Mac and receiving in Mailsmith from Mail.app results in the file extension being stripped away. The person I sent to has no issues with anyone else sending her files
    - Sending to the same Mac and using Mail instead of Mailsmith results in the extension being preserved.
    - I set up Outlook Express on my Parallels partition and it seemed to preserve the extension when I sent it from Mail.
    So it looks like there is some issue with Apple Mail and some e-mail clients. The ones I know I have had problems sending to are Mailsmith on Mac and Goldmine on Windows. At this point I am thinking it is not a server based problem.
    If anyone has any possible solutions I would appreciate the input.

  • Change file extension in receiver file adapter

    File to File Scenario
    Posted: Sep 11, 2006 3:47 PM      Reply      E-mail this post 
    I am working on a File to File scenario.
    Source System gives out a file: abc ( with no extension)
    We need to archive it as: abc.done
    And we need to send it to a FTP server ( receiver File adapter) as abc.txt.
    How can I append a file extension when I archive and
    how can I change the file extension in the receiver File adapter?
    FYI, we are using XI as FTP server so I have created dummy message interface with no mapping.

    Hi,
    If I understood correctly once XI picks up the file it should be archieved as filename.doc and then it should be FTP'ed to a different location with a change in extension filename.txt.
    1. To Archive in the sender communication channel you can use OS Commands after prosessing (>=SP14) to rename the file and archive it. Suggested write a batch file which will rename the file and call the batch file from the OS Command of the sender file adapter. You can either use Archive functionaliy of the Sender adapter or you can write one more command in batch file to move the file to different folder. Make sure you are using fullpath while writing batch file.
    2. As said use dynamic configuration in a dummy mapping and then get the source file name and change the extension.
    http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm
    Thanks,
    Prakash

  • Sender "Mail" adapter - CSV file attachment

    Hi there
    I'm looking for some help in configuring a sender mail adapter that receives ".csv" files. I did read some blogs that mention using the "PayloadSwapBean" module to read the mail attachment instead of the mail content. My problem is to now convert the ".csv" file into a message. Is there a module that I can use ( is it the "MessageTransfomBean" ) and how. Any help would be appreciated.
    Thanks
    Salil

    Hi Salil,
    If you want to send a mail with a body and attachments, the message sender HAS to provide an XI message with attachments. I doubt a CSV file does justice.
    As Renjith said you need to convert CSV to XmL.
    A short description about the Standard Modules:
    MessageTransformationBean is a standard module used to apply the XSLT mapping to the adapter module by using <i>Transform.class</i> ( This xslt mapping is done to create a mail package, Dont confuse with the actual mapping in your case this is NOT for converting csv to xml).
    Also this module can be used to change the name and type of payloads by using <i>Transform.contentType</i>, <i>Transform.contentDisposition</i>, <i>Transform.contentDescription</i>.
    PayloadSwapbean is a standard module for replacing payloads with other payloads (SWAP)
    If you want to give each attachment a certain name use Parameters, <i>swap.keyname</i> for name of the payload and <i>swap.keyvalue</i>.
    I Hope the use of standard modules is understood.

  • Mail Adapter - attachment file?

    Hi,
    I use the Mail Adapter (XIPAYLOAD) in order to send an email from XI to a Mail Server (Lotus Notes); but content of my email is inside an attachment file.
    If I choose "keep attachement", then I have an attachement file with "xxxx<b>.xml</b>".
    e.g: [email protected]
    If I don't choose "keep attachment", then I have an attachement file with "xxxx<b>.dat</b>".
    e.g: att4a5o8.dat
    Is there a solution to have the content directly in the email and not inside an attachement?
    And is it possible to change the file name?
    Regards
    Mickael.

    Use the Option 'Use Mail Package'. In this case the message will be sent out inside the mail.
    The mail package is a special message type you have to provide to the mail adapter. You have to do a mapping from your message to the mail package message type.
    Here is a sample XSLT for creating a mail package out of any XML Message:
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      <xsl:output method="xml" indent="yes" />
      <xsl:template match="*">
        <ns:Mail xmlns:ns="http://sap.com/xi/XI/Mail/30">
          <Subject>Hallo</Subject>
          <From>[email protected]</From>
          <To>[email protected]</To>
          <Content><xsl:copy-of select="/"/></Content>
        </ns:Mail>
      </xsl:template>
    </xsl:stylesheet>
    Regards
    Stefan

  • Change File Extension

    Hi Experts
    I am pulling a .txt file from a location and dropping it to another location using file adapter. Is there a way I can change  the file extension .txt to .xml when I drop the file?

    Hi Skaria -
    Make sure you're not using the Adapter Specific Message Attributes (ASMA) option on your receiver file channel.   If you need to use it for something other than the file name attribute, you can still select the "Use Adapter Specific Message Attributes", but then unselect "File Name".
    However, if you need use the same file name as is picked up, but just with a different extension, you have to change ASMA filename in the message header (e.g. in a mapping).
    Regards,
    Jin

  • Download ZIP file without changing file extension

    I regularly download a zipped csv file, of the format: "filename.csv.gz". As the name does not change, Firefox adds a digit to distinguish it, so for example I get "filename.csv-3.gz". This is a pain as it changes the file extension which means that I cannot open the extracted file without first renaming it. I want to keep an archive of all the files, so deleting them each time isn't really an option, and neither is moving them to a different location each time. Is there any way the naming convention for downloads can be changed?

    I think you have to disable it in your Operating system:
    8dot3NameCreation
    [http://support.microsoft.com/kb/121007]

  • Unzip attachment in Mail adapter or/ File Adapter

    Hi everyone,
    I need to get flat file from .zip attachment that comes with mail? Is it possible to get it with Mail adapter, unzip it and then make conversion? All steps in the Integration engine?
    Another option can be get .zip with File adapter, but again how to unzip it?
    Thanks,any help appriciated as I am doing my first XI project.
    Nataliya

    >
    Buffy76 wrote:
    > Thanks a lot,  guys. Unzipping is clear now.
    >
    > Prateek, it would be great if you can you point to "how-to" file or example for MessageTransformBean.
    >
    > Regards,
    >
    > Nataliya
    ref this https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/9e6c7911-0d01-0010-1aa3-8e1bb1551f05

  • 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

  • XI Mail Adapter TXT file as attachment

    Hi, I am using Mail Receiver adapter to receive data from Sender ABAP Proxy.The attachment file contains data with all Labels, i used in the Target Message Type.
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:XogisticsOB_MT1 xmlns:ns0="http://selectcomfort.com/sapcrm/xogistics/outbound"><HEADER1000><EDI_HEADER_STR></EDI_HEADER_STR><TASK_ID>8000001959</TASK_ID><TOT_BOXES>        1</TOT_BOXES><NAME_LAST>Di Capri</NAME_LAST><NAME_FIRST>Sheela</NAME_FIRST>
    Please let me know how can i exclude these labels such as
    <HEADER1000> </HEADER1000> , <TASK_ID></TASK_ID>,
    <NAME_LAST></NAME_LAST> etc...
    from appearing in the File Content.
    The ModuleKey contains
    Transform.ContentDisposition attachment;filename="Outbound1.txt"
    Transform.ContentDescription Outbound1
    Transform.ContentType text/txt;name="Outbdound1.txt"
    Thanks.
    Rushikesh

    Hi,
    If ur using the mail adapter as receiver then if u dont use mail package then the attachment will come as it is file.
    If u use mail package then it will come in XML format
    for reference please check some links.
    Receiver Mail Adapter.
    /people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
    eMail Reporting
    eMail Report as Attachment (Excel/Word)
    The specified item was not found.
    The specified item was not found.
    The specified item was not found.
    Regards,
    Phani

  • Mail Adapter and File content conversion.

    I have a scenario to send data from SAP to 4 different boards. I have used a Multi mapping for this scenario. I am using Proxy for SAP to xi and SOAP, File and Mail adapter for the external connections.
    Questions:
    1) I need to send a mail in CSV or Excell format in one scenario. I have used AF_StrictXml2Plain Module but its not working? any thoughts?
    2) In the file adapter I have to add the YYYYMMDD (current Date) to the file name? when I use timestamp i get the time too, any way of getting only date? I cant use the Variable substitution as i dont have date in my payload.
    3) Receiver File content conversion:
    My Message Type Looks like this
    MT_XX_XX
         Row
            title
            xxx
    I have used these parameters:
    Recordset Structure:  Row
    Row.addHeaderLine : 0
    Row.fieldSeparator : ,
    Row.endSeparator: 'nl'
    am I doing something worng, the file content conversion doesnt work.
    Please let me know
    Thanks in advance

    Hi,
    Make sure u are using the bean before the mail adapter bean.
    Before using the file content conversion make sure that there are no substructures in it , in order to use addheader line as 0. else use addheaderline 3 and give the headerline as comma seperated values
    for e.g if this is the type then addheader line= 0
    Type 1  :
    Record_Mt
         Row
             field1
             field2
    else if this the type then addheaderline = 3
    *Type 2: *
    Record_Mt
         Row1
             field1
             field2
         Row2
             field1
             field2
    add module like this
    localejbs/sap.com/AF_Modules/StrictXml2PlainBean
    with the module key e.g. key
    for type 1 struct (as above )add parameter- key as singleRecordType  and value as Row with comma seperated value. (remember header line is 0)
    for type 2 structure (as above )add parameter- key as recordTypes  and value as Row1, Row2 with comma seperated value. (remember header line is 3)

  • Mail Adapter ZIP File Attachment

    Hello,
    I have created an interface using the mail receiver to mail a file as an attachment to an email address. I have used an ABAP mapping to create the Mail message associating the required content of Mail message. This all works fine and the emails with the required attachments are delivered successfully.
    I now need the ability to ZIP the file attachments. I have had a look through some of the forum messages and it looks like I am going to have to create a java module for the receiver mail adapter to ZIP the file.
    Has anyone done this before? If so can you give me some pointers. I have developed modules for the file adapter but am not sure how to ZIP.
    Alternatively can this be done as part of the ABAP mapping. I have started looking at class CL_ABAP_ZIP. I am now able to compress the content but this does not create a valid archive as the attachment.
    Any help would be much appreciated.
    Thanks
    Gary

    Dear Sameer ,
    Can you send me the Java Code which zips the folder or files .
    My email id is [email protected]
    Regards
    Prabhat

  • Mail adapter flat file attachment

    Hi,
    From my limited knowledge of XI, I know that we can send an email attachment as an .xml file or a binary file. My question is how can I send a flat file as an attachment using XI's mail adapter? If this is possible, please suggest steps how to do this as I am clueless!!
    Thanks for your help...
    Chandu

    Hi,
    check out this Blog you will be able to do it.
    You can do either using Mail package or just using Mail adapter.
    /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/6d967fbc-0a01-0010-4fb4-91c6d38c5816
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/bf37423cf7ab04e10000000a1550b0/content.htm
    Thanks,
    Prakash

  • What kind of data is taken from mail adapter to file adapter

    hai
    i am learning mail to file adapter can u tell me in real time where it is use,
    well what data we will transfer from mail to file.

    sandeep,
    we are using the sender mail adapter to receive mails (IDOCS) from a Exchange server
      when a sales person gets PO thrugh mail then he sends this Po to Mainframes then we use mail to file.
    similarly we can have many situations to useit.
    Message was edited by:
            Sreeram Reddy

Maybe you are looking for