Menu

#7 Commandline MsgToEml

1.0
open
nobody
None
2018-11-15
2016-05-01
alcs2000
No

Hi is it possible to use your tool from the commandline to convert all .msg in a folder to .eml? Would it be possible for this to be implemented? Thanks!

Discussion

  • Lolo101

    Lolo101 - 2017-02-19

    Yes it is possible. In the Linux shell, type :
    java -jar MSGViewer.jar -msg2eml /home/toto/mails/*.msg
    Shell expansion will do the trick.

     

    Last edit: Lolo101 2017-02-19
  • Daniel

    Daniel - 2018-03-26

    Is it possible to do this using the Terminal in Mac OS X?

     
  • David Kossack

    David Kossack - 2018-11-13

    MSGViewer fails to convert .msg email to either .mbox or *.eml on OS X High Sierra. This is an issue for both the SourceForge MSGViewer.jar as well as the NetBean build described in “howto_build_msgviewer.odt”. The MSGViewer.jar used below was complied using NetBeans/howto_build_msgviewer.odt SVN. This would be a useful tool for converting msg2mbox, any insight in to getting this working would be appreciated especially the cmdline tool…

    +++

    Ghost:10-18-18 Production user1$ java -jar "/Users/user1/NetBeansProjects/MSGViewer/dist/MSGViewer.jar" -h
    MSGViewer - MSGViewer
    Version: 1.10

    COMMAND LINE OPTIONS

    -v Print version and licence informations
    -h Print this screen
    -msg2mbox Converts a msg file to a mbox file.
    -msg2eml Converts a msg file to an eml file.
    -mbox2msg Converts a mbox file to a msg file.
    This feature is in pre alpla state and may never will work.
    -t Converts the message to the users temporary directory.
    -o Opens the converted message with the associated standard application.

    GUI OPTIONS

    -hidemenubar Hide menubar.
    In this mode MSGViewer can only show messages. There is no file save as,
    or somthing like this avaliable. This mode is use by internet kiosks.

    NetBeans IDE:
    Product Version: Apache NetBeans IDE 9.0 (Build incubator-netbeans-release-334-on-20180708)
    Java: 10; Java HotSpot(TM) 64-Bit Server VM 10+46
    Runtime: Java(TM) SE Runtime Environment 10+46
    System: Mac OS X version 10.13.6 running on x86_64; UTF-8; en_US (nb)

    +++

    1. MSGViewer cmd line mail format conversion fails with the following error:

    Ghost:10-18-18 Production user1$ java -jar "/Users/user1/NetBeansProjects/MSGViewer/dist/MSGViewer.jar" -msg2mbox *.msg
    2018-11-12 15:18:26,128 INFO (CLIFileConverter.java:103): conversion source file: FW_ City of Santa Cruz - Briefing Materials.msg
    java.lang.NullPointerExceptionjava.lang.NullPointerException
    at net.sourceforge.MSGViewer.CLIFileConverter.processFile(CLIFileConverter.java:114)
    at net.sourceforge.MSGViewer.CLIFileConverter.work(CLIFileConverter.java:89)
    at net.sourceforge.MSGViewer.ModuleLauncher.invoke(ModuleLauncher.java:80)
    at net.sourceforge.MSGViewer.ModuleLauncher.main(ModuleLauncher.java:178)
    2018-11-12 15:18:26,137 INFO (CLIFileConverter.java:103): conversion source file: FW_ Quote from Report from City of Santa Cruz - Briefing Materials (1).msg
    java.lang.NullPointerExceptionjava.lang.NullPointerException
    at net.sourceforge.MSGViewer.CLIFileConverter.processFile(CLIFileConverter.java:114)
    at net.sourceforge.MSGViewer.CLIFileConverter.work(CLIFileConverter.java:89)
    at net.sourceforge.MSGViewer.ModuleLauncher.invoke(ModuleLauncher.java:80)
    at net.sourceforge.MSGViewer.ModuleLauncher.main(ModuleLauncher.java:178)

    1. Opening a *.msg file in the GUI and then saving it back to a .msg works, saved as text. Saving the same file to .mbox or .eml fails with the following error messages, respectively:

    Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: javax/activation/DataSource
    at net.sourceforge.MSGViewer.factory.MessageParserFactory.saveMBoxFile(MessageParserFactory.java:107)
    at net.sourceforge.MSGViewer.factory.MessageParserFactory.saveMessage(MessageParserFactory.java:90)
    at net.sourceforge.MSGViewer.ViewerPanel.exportFile(ViewerPanel.java:887)
    at net.sourceforge.MSGViewer.SingleWin$12.do_stuff(SingleWin.java:301)
    at at.redeye.FrameWork.base.AutoMBox.invoke(AutoMBox.java:64)
    at at.redeye.FrameWork.base.AutoMBox.<init>(AutoMBox.java:50)
    at net.sourceforge.MSGViewer.SingleWin$12.<init>(SingleWin.java:287)
    at net.sourceforge.MSGViewer.SingleWin.jMFileSaveActionPerformed(SingleWin.java:287)
    at net.sourceforge.MSGViewer.SingleWin.access$400(SingleWin.java:31)
    at net.sourceforge.MSGViewer.SingleWin$4.actionPerformed(SingleWin.java:146)
    at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
    at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
    at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
    at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
    at java.desktop/javax.swing.AbstractButton.doClick(AbstractButton.java:369)
    at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:980)
    at java.desktop/com.apple.laf.AquaMenuItemUI.doClick(AquaMenuItemUI.java:157)
    at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1024)
    at java.desktop/java.awt.Component.processMouseEvent(Component.java:6589)
    at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
    at java.desktop/java.awt.Component.processEvent(Component.java:6354)
    at java.desktop/java.awt.Container.processEvent(Container.java:2260)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4966)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2318)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4798)
    at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4906)
    at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535)
    at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2304)
    at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4798)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
    at java.desktop/java.awt.EventQueue.access$600(EventQueue.java:97)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
    Caused by: java.lang.ClassNotFoundException: javax.activation.DataSource
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
    ... 49 more</init></init>

    Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: javax/activation/DataSource
    at net.sourceforge.MSGViewer.factory.MessageParserFactory.saveEMLFile(MessageParserFactory.java:120)
    at net.sourceforge.MSGViewer.factory.MessageParserFactory.saveMessage(MessageParserFactory.java:92)
    at net.sourceforge.MSGViewer.ViewerPanel.exportFile(ViewerPanel.java:887)
    at net.sourceforge.MSGViewer.SingleWin$12.do_stuff(SingleWin.java:301)
    at at.redeye.FrameWork.base.AutoMBox.invoke(AutoMBox.java:64)
    at at.redeye.FrameWork.base.AutoMBox.<init>(AutoMBox.java:50)
    at net.sourceforge.MSGViewer.SingleWin$12.<init>(SingleWin.java:287)
    at net.sourceforge.MSGViewer.SingleWin.jMFileSaveActionPerformed(SingleWin.java:287)
    at net.sourceforge.MSGViewer.SingleWin.access$400(SingleWin.java:31)
    at net.sourceforge.MSGViewer.SingleWin$4.actionPerformed(SingleWin.java:146)
    at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
    at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
    at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
    at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
    at java.desktop/javax.swing.AbstractButton.doClick(AbstractButton.java:369)
    at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:980)
    at java.desktop/com.apple.laf.AquaMenuItemUI.doClick(AquaMenuItemUI.java:157)
    at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1024)
    at java.desktop/java.awt.Component.processMouseEvent(Component.java:6589)
    at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
    at java.desktop/java.awt.Component.processEvent(Component.java:6354)
    at java.desktop/java.awt.Container.processEvent(Container.java:2260)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4966)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2318)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4798)
    at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4906)
    at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535)
    at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2304)
    at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4798)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
    at java.desktop/java.awt.EventQueue.access$600(EventQueue.java:97)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
    Caused by: java.lang.ClassNotFoundException: javax.activation.DataSource
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
    ... 49 more</init></init>

    Thanks.

     
    • Lolo101

      Lolo101 - 2018-11-15

      Hi David and thanks for your feedback.
      You may find this fork of the project a little more active : https://github.com/lolo101/MsgViewer
      I suggest you get a try with version 1.2.0
      That said, I think you found a bug that is still present on 1.2.0.
      I've permitted myself to copy a part of your message in a new issue : https://github.com/lolo101/MsgViewer/issues/3

       

Log in to post a comment.