Fail read filename from attachment in multipart message

Hi,
I use Javamail 1.4 for reading mail from imap server.
Sometimes i have received mail with this header (this mail was produced with thunderbird):
--------------040307090809070400040607
Content-Type: application/pdf;
name*0="20060908 - DOCUMENT.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename*0="20060908 - DOCUMENT.pdf"
When i use the method part.getFileName() the result is null.
Why?
Thanks all.

Interesting. What version of Thunderbird?
These headers are using a feature of RFC 2231 that allows
a parameter in a header to be split over multiple lines.
In this particular case, there's no need to use this feature
since clearly these parameters are short enough to fit on
one line.
While JavaMail supports part of RFC 2231 - the part that
allows parameters to be encoded - it doesn't support this
aspect of RFC 2231.
I would suggest reporting this as a "bug" in Thunderbird, that
it's gratuitously using this new feature in cases where it's not
needed, and thus reducing interoperability with other mailers
that don't support this feature.

Similar Messages

  • How can we read filenames from a specific folder

    Hi forum,
    I have a situation that, there are several files coming daily in a specific folder.
    I want to read filenames from that folder and want to get that filename in a variable.
    That filename contains account nos. which I need for further processing.
    Now, how can we read filenames from a specific folder with using Oracle PL/SQL Procedure?
    Please suggest.
    Thanks & regards,
    Kiran

    If you are on 10g (not sure which exact release I'm afraid) you might look at Chris Poole's XUTL_FINDFILES that lists the files in a directory using PL/SQL and DBMS_BACKUP_RESTORE.SEARCHFILES (all a bit undocumented as it seems to be provided as part of rman).
    The conventional (i.e. supported) approach is to use a Java stored procedure - there is an example on AskTom.
    Message was edited by:
    William Robertson

  • Read filenames from jar-file

    Hi,
    I want to read image names in a jar-file directory in a web start application. This used to work in previous versions of jdk,
    but when I use jdk 1.6.0_20 I get this errormessage:
    "http:\server:8080\test\client.jar The filename, directory name, or volume label syntax is incorrect".
    Why doesn´t this work anymore?
    Some of my code looks like this:
         getFiles("images/toolbuttons/val/", ".gif", true);
         public String[] getFiles(String catalog, String fileNameEnd,
             boolean removePath)
              JarFileFinder jarFileFinder = new JarFileFinder();
              String jarFilePath = jarFileFinder.getClassLocation(
                  this.getClass().getName());
              String[] files = null;
              try
                   if (fileNameEnd != null)
                        fileNameEndFilter = new FileNameEndFilter(fileNameEnd);
                   files = getFilesInJar(jarFilePath, fileNameEndFilter, catalog,
                       removePath);
              catch (Exception e)
                   MessageUtil.messageOk(null, this.getClass().getName(), e.getMessage());
              return files;
         private String[] getFilesInJar(String jarFilePath, FilenameFilter filter,
             String catalog, boolean removePath)
             throws Exception
              ZipFile zipFile = new ZipFile(jarFilePath);
              Enumeration e = zipFile.entries();
              String name;
              ZipEntry zipEntry;
              ArrayList filesList = new ArrayList();
              while (e.hasMoreElements())
                   zipEntry = (ZipEntry) e.nextElement();
                   name = zipEntry.getName();
                   if ((filter == null || !filter.accept(null, name)) ||
                       (catalog != null && !name.startsWith(catalog)))
                        continue;
                   if (removePath == true)
                        name = name.substring(name.lastIndexOf("/") + 1);
                   filesList.add(name);
              String[] files = new String[filesList.size()];
              for (int i = 0; i < filesList.size(); i++)
                   String s = (String) filesList.get(i);
                   files[i] = s;
              return files;
    public class JarFileFinder
         public String getClassLocation(String classname)
              try
                   Class clazz = Class.forName(classname);
                   if (clazz == null) return null;
                   URL url =
                       clazz.getProtectionDomain().getCodeSource().getLocation();
                   String location = url.toString();
                   if (location.startsWith("jar"))
                        url = ((JarURLConnection)
                            url.openConnection()).getJarFileURL();
                        location = url.toString();
                   if (location.startsWith("file"))
                        return new File(URLDecoder.decode(url.getFile(), "UTF-8")).getAbsolutePath();
                   else
                        return URLDecoder.decode(url.toString(), "UTF-8");
              catch (Exception e)
                   MessageUtil.messageOk(null, this.getClass().getName(), e.getMessage());
              return null;
    }

    AndrewThompson64 wrote:
    Lisa_R wrote:
    ..I tried to remove the URLDecoder, but the result was the same. I still get:
    "http:\server:8080\test\client.jar The filename, directory name, or volume label syntax is incorrect".Given an URL should use '/' as opposed to '\', and starts with 2 '/' rather than one, it is not surprising that URL was rejected. Strange as it may seem, programming by typing random characters into an editor will rarely, if ever, work to create a working application.Yes, I agre that it´s not that surprising that the URL was rejected (even though the URL work in firefox and IE). But I didn´t write it that way. The code that put the URL together worked fine in previous versions of the jdk.
    >
    ..The reason why I want to read the filenames from the jar instead of including a list of the names is that if you
    want to add an image then all you have to do is include it in the directory.. That is largely irrelevant, since the Jar needs to be freshly built, uploaded by the developer, and downloaded by the client. Since all of that needs to be done for the addition of a single image, you might as well add an Ant task to the build that provides a single file (like I suggested earlier) that lists the resources of interest. It would take less time to write an Ant task, than debug all the hoops the code is currently jumping through(1) in order to get the information of interest.
    If this was the only place were this method was used I would agre with you, but unfortunatelly it´s not. The application dosen´t only read image filenames it also reads class-names.
    1) And even if you got that working, it would be likely that Sun would introduce some change in the next version of Java that breaks it again. My advice is to stop fighting it, and go with the flow.Thats not good of course! But it has been working for a long time, so I think I will try to make it work again....
    Is there someone out there who has done this or knows how to do it I would appreciate some help! :-)

  • Get Filename from attachements payload

    hallo,
    I receive email with attachement.I would like store the attachements on the file system (with a receiver File Adapter) with the same name.
    Could someone give a tipps.
    Thanks a lot
    Mat

    Hi,
    Option 1: Use the Module Processor code in the Mail Adapter and get the file name and use it in the Receiver File Adapter as a variable substitution.
    Option 2: Use java Proxy to invoke the MailBox and detach the attachment and construct the XML message and send into XI.
    Hope this helps..
    Regards,
    Moorthy

  • Read Filename form Adapter-Specific Message Attributes in Java Mapping

    Hi,
    I have scenario File to Mail adapter. How can i read filename from Adapter-Specific Message Attributes
    in java mapping.
    Thank you and Best regards
    Fernand

    Hello Fernand,
    Are u using DOM or SAX parser?
    In any case just put the Dynamic config code in the execute function or the other option is to define it as a private functionand call it in the execute,My personal advice would be the former.
    Just put this code in ur java mapping
    As fellow sdn ers have mentioned there is no need of the container method,just initialise the set param method and use it in the dynamice config code as follows
    public class YourClass implements StreamTransformation
         private Map map;
    public void setParameter(Map param)
         map = param;
    public void execute(InputStream in, OutputStream out) throws StreamTransformationException
                   DynamicConfiguration conf =(DynamicConfiguration) map.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
                   DynamicConfigurationKey KEY_FILENAME =DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    // read value
    File = conf.get(KEY_FILENAME);
    Now just call File in the mapping program,
    Should help u out 
    Regards,
    Tauseef

  • How to read file from server

    Hi,
    When i try to read file from server,the following message is displayed .
    ORA-29532: Java call terminated by uncaught Java exception: java.security.AccessControlException: the Permission (java.io.FilePermission /tmp read) has not been granted to EWMTRACKTEST. The PL/SQL to grant this is dbms_java.grant_permission( 'EWMTRACKTEST', 'SYS:java.io.FilePermission', ' /tmp', 'read' )
    ORA-06512: at "EWMTRACKTEST.GET_DIRLIST_EWM", line 1
    ORA-06512: at line 1
    thanks and regards
    P Prakash

    it seems obvious, user EWMTRACKTEST doesn`t have access to directory /tmp and the file under that.
    try to give read permission and try again.
    you could use command line like 'chmod' to grant permissions.

  • Read email from microsoft exchangeserver 2010 and save attachement

    Hello,
    I want to read email from microsoft exchangeserver 2010 and save attachement into a folder.I created an Java program to import attachments from a exchange server mailbox using "POP3S".It works fine when run as a java application.But when i put this inside Oracle11g R2 using load java and while executing from a procedure it gives an error at parsing message into Multipart
    Error at line : Multipart mp = (Multipart)m.getContent();
    Error:
    Content-Type: multipart/mixed;
    boundary="_002_A0C2E09A..................................."
    java.lang.ClassCastException
    at mailPop3.checkmail(mailPop3:71)
    My Java Class is as follows,
    import java.io.*;
    import java.util.Properties;
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.util.Date;
    The function i used to check for attachments is given below.
    public static boolean hasAttachments(Message m) throws java.io.IOException, MessagingException
    Boolean hasAttachments = false;
    try
    // if it is a plain/html text - no attachements
    if (m.isMimeType("text/*"))
    return hasAttachments;
    else if (m.isMimeType("multipart/alternative"))
    return hasAttachments;
    else if (m.isMimeType("multipart/*"))
    Multipart mp = (Multipart)m.getContent();
    if (mp.getCount() > 1)
    hasAttachments = true;
    return hasAttachments;
    catch (Exception e) {
    e.printStackTrace();
    } finally {
    return hasAttachments;
    My Java Details as follows
    java Version :1.5.0_10
    java.vm.specification.version:1.0
    java.vm.version :1.5.0_01
    java.specification.version:1.5
    java.class.version:48.0
    Java mail API:javamail-1.4.4
    Used Jars:mail.jar
    Could someone explain why I am getting this error? What can I do to resolve this error?
    Is any other Jar need other than mail.jar?
    Any help would be much appreciated.
    Regards,
    Nisanth

    889509 wrote:
    This java class has no error.Then it should work - not only at compile time, but at run-time too.
    Because it does not, it means there are errors. And as the error you've posted is not an Oracle SQL or PL/SQL error, your question is off-topic to this forum.
    Why would the code not work at run-time? Numerous reasons, including environmental ones. Java inside Oracle are subjected to a number of restrictions and limitations that do not exist in a Java VM outside Oracle (for good reasons).
    So you need to consider that too - and that is why I referred you to the documentation... which is IMO mandatory reading for all Oracle developers.

  • Mail to File: Use filename from MailBody to store attachement on filesystem

    Hi
    I have a Mail to File scenario. The mail contains a body and one binary attachment. The goal is to store the binary attachment on the filesystem with a specific filename which should come from the mail body.
    So I have to use PayloadSwapBean to have the attachment. But after this I can't access the mail body through a mapping to store the filename from the body content in DynamicConfiguraton (Adapter Specific Message Properties).
    How can I transport the filename from the mail body from the mail sender adapter to the file receiver adapter? Is this only possible with an self-written adapter module?
    Thx
    manuku

    > In the meantime I found a very easy solution (without adapter module). The solution was to switch the PayloadSwapBean from the MailSenderAdatper to the FileReceiverAdapter. Due to this small change the mail content was as normal payload present for eg. message mapping. So I was able to use the dynamic configuration to generate the dynamic filename.
    Hi Tobias,
    I should read the requirements more carefully. You wanted the filename from payload, I gave you a solution for reading the attachment name of the mail
    Cheers
    Stefan

  • Read filename of email attachment for sender mail adapter

    Hi All,
    We have a requirement to read filename of email attachment received from Sender email adapter and send details to SAP by Proxy call.
    Can we retrieve the filename of email attachment ?
    Any help on this will be really useful.
    Regards,
    Ashish

    Hi,
    >>>Can we retrieve the filename of email attachment ?
    Please see the below link, it might be useful to you.
    http://wiki.sdn.sap.com/wiki/display/XI/AdapterModulePI7.0GetAttachmentName
    Regards,
    P.Rajesh

  • Unable to read payload from the message object in XI

    Hello Guys,
    Please help me about my problem in XI version 7.0.im quite new here.
    im trying to test my config but error message occured. "Unable to read payload from the message object"
    when i checked the comm channel this is the error message :
    Error during database connection to the database URL 'jdbc:sqlserver://172.16.40.20:1433;databasename=TRAVEL:SelectMethod=cursor' using the JDBC driver 'com.microsoft.sqlserver.jdbc.SQLServerDriver': 'com.sap.aii.adapter.jdbc.sql.DriverManagerException: Cannot establish connection to URL 'jdbc:sqlserver://172.16.40.20:1433;databasename=TRAVEL:SelectMethod=cursor': com.microsoft.sqlserver.jdbc.SQLServerException: Cannot open database "TRAVEL:SelectMethod=cursor" requested by the login. The login failed.'
    when i tried my login in sql it works...but in this message the login is failed..what shall i  do..
    Please advice.
    Thanks in advance
    aVaDuDz

    Hi
    Check with the connection string & Authorization of user you have used.
    MSSQL string is
    jdbc:microsoft:sqlserver://dbhost:1433;databaseName=example;SelectMethod=Cursor
    While doing JDBC its good to refer Note 831162 lot of problems can be resolved.
    Thanks
    Gaurav

  • Tab from Subject field to message text with attachment

    When I choose "Send to Mail Recipient as attachment" from Word, Mail creates a new message with the attachment in the message body area, and places the cursor in the "To" field.
    I can enter the recipient name, then tab to the Subject field and enter a subject, but can't tab out of Subject into the message text area. Shift-Tab goes backward through the BCC, CC and "To" fields, but that won't get to the message body area either. In order to add text to the body of the message one has to reach for the mouse and actually click in the message body area.
    Anyone else had this experience? Any suggestions?

    Try going to the Keyboard and Mouse system preference, Keyboard Shortcuts tab, and checking "Text boxes and lists only" instead of all "All controls". This will let you use return or tab to advance to the next field including the message field.
    MacBook Pro   Mac OS X (10.4.6)  

  • Failed to read PID from file /run/nginx.pid: Invalid argument

    Hi,
    tried to get an nginx server running to set up an owncloud environment.
    When starting the nginx server
      $  systemctl start nginx.service
    I get the message: "Failed to read PID from file /run/nginx.pid: Invalid argument"
    [root@klaus /etc/nginx]# systemctl status nginx
    nginx.service - A high performance web server and a reverse proxy server
    Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled)
    Active: active (running) since Sat 2013-10-12 17:50:46 CEST; 8min ago
    Process: 1823 ExecStart=/usr/bin/nginx -g pid /run/nginx.pid; daemon on; master_process on; (code=exited, status=0/SUCCESS)
    Process: 1821 ExecStartPre=/usr/bin/nginx -t -q -g pid /run/nginx.pid; daemon on; master_process on; (code=exited, status=0/SUCCESS)
    Main PID: 1825 (nginx)
    CGroup: /system.slice/nginx.service
    ├─1825 nginx: master process /usr/bin/nginx -g pid /run/nginx.pid; daemon on; master_process on;
    └─1826 nginx: worker process
    Oct 12 17:50:46 klaus systemd[1]: Failed to read PID from file /run/nginx.pid: Invalid argument
    Oct 12 17:50:46 klaus systemd[1]: Started A high performance web server and a reverse proxy server.
    but /run/nginx.pid is readable:
    # cat /run/nginx.pid
    2058
    # ll /run/nginx.pid
    -rw-r--r-- 1 root root 4 Oct 12 17:39 /run/nginx.pid
    It seems nginx is runnung thought but in my browser I only get a blank page.
    Any help appreciated.
    Last edited by wombalton (2013-10-13 14:17:46)

    Actually it's the first time I tried to set up one.
    I Basically followed this guide [1] adopting it to arch.
    That's where i got my nginx.conf from. Taking the standard nginx.conf that comes by install and replacing the server part.
    After some searching I found the owncloud manual[2] with an example nginx.conf. Comparing that with my one I found some differences. Applying them works out fine.
    I get now the owncloud page.
    The systemd error  still ocurs, but I think it does not matter to run the server.
    Thanks for your help.
    [1] https://docs.google.com/file/d/0B0ZsTQd … ring&pli=1
    [2] http://doc.owncloud.org/server/5.0/admi … figuration
    EDIT:
    Just in case someone stumbles over this and tries to use the config:
    This one [3] really works
    [3] http://doc.owncloud.org/server/5.0/admi … thers.html
    Last edited by wombalton (2013-10-14 13:31:22)

  • Failed to read data from report file, failed to read parameter object

    Error message when doing a u201CSchedule List of Valuesu201D
    failed to read data from report file,
    c:\docume~1\user........
    failed to read parameter object
    Earlier in the day it worked just fine nothing had been changed.
    I have admin right on the windows server and in central management console
    Can someone please help with this issue.

    Hi Glenn
    Please let us know the following:
    1.What is the exact version of Crystal Reports Designer?
    2.What is the version of Business objects Enterprise installed on the machine?
    3.Are reports based on Business views,Deski,Webi?
    4.Are the reports migrated from older version of Crystal Reports to new Version?
    Thanks
    Shraddha

  • Server error: "The attempt to read data from the server '(null)' failed"

    Multiple times during each day my client (Mail.app) puts up a little exclamation mark "!" next to the mail account hosted on our Leopard Server. Clicking on this little alert icon pops up a message that reads:
    +There may be a problem with the mail server or network. Verify the settings for account “Leopard Server Account” or try again.+
    +The server returned the error: The attempt to read data from the server “(null)” failed.+
    I can make the "!" go away by choosing Mailbox>Synchronize>Leopard Server Account. And everything seems peachy but it inevitably pops up again in another hour or two. It's annoying because I'm not sure if mail is getting through or not when the "!" is up.
    Any ideas why this is happening?

    MY SOLUTION REPOSTED FROM ANOTHER THREAD:
    I've just solved a similar issue.
    I have a dedicated server running Plesk 9.5 and when I upgraded to iLife 11 and Snow Leopard this error appeared. I could quickly click "get mail" and I'd get all my mail, but only 3-4 of my 9 mail accounts would connect. Theo others would have the error:
    "The server error encountered was: The attempt to read data from the server..."
    I found solutions for those using IMAP mail:
    modify the /etc/courier-imap/imapd configuration file and change MAXDAEMONS from 40 to 80 and MAXPERIP from 4 to 40. This allows all the machines behind my home firewall to connect to multiple accounts on the e-mail server with mailbox caching enabled.
    I'd made this change on my server but it didn't seem to have any effect. It dawned on me that I'm using POP, not IMAP. So I found in /etc/courier-imap/pop3d the same settings. I changed the MAXDAEMONS from 40 to 80 and MAXPERIP from 4 to 40 and voila, all my connections concurrently worked.
    This has taken me more than two days to fix and I hope posting this helps someone else with the same issue.

  • Failed to read data from Lock tables

    Hi,
    When i trying to update data using T_CODE j1i8. I am getting message (Failed to read data from Lock tables ) but where as my database tables are not been locked. can anyone plz help me out.
    Regards,
    Anaveer

    Hi
    Probably some other transation is modifying the Database table you are using & it may have locke the table using FOR UPDATE stmt.
    Using Deque_all FM module you can remove the locks
    Thanks
    Sandeep
    Reward if helpful

Maybe you are looking for