Day CQ Mail Service does not work on AEM Forms JEE

Issue

The Day CQ Mail Service configuration does not work on AEM Forms JEE.

Resolution

Perform the following steps to resolve the issue:

  1. Create a text file by the name javaxmail.mf on your desktop.

  2. Copy-paste the following text in the javaxmail.mf file and save the file.

    Bundle-Version: 1.0
    Bundle-Name: My custom java mail bundle
    Created-By: 1.6.0_45 (Sun Microsystems Inc.)
    Bundle-ManifestVersion: 2
    Bundle-Description: Bundle exporting javax.mail
    Bundle-SymbolicName: de.ibb.mail
    Fragment-Host: system.bundle; extension:=framework
  3. Go to AEM web console bundles at http://[server]:[port]/lc/system/console/bundles/.
    Find and click JavaMail API (compat) (javax.mail) to open the bundle configuration.

  4. Copy the text in the Exported Packages section of the bundle configuration and append it to the javaxmail.mf file and save the file.

    The file contents look similar to the following:

    Bundle-Version: 1.0
    Bundle-Name: My custom java mail bundle
    Created-By: 1.6.0_45 (Sun Microsystems Inc.)
    Bundle-ManifestVersion: 2
    Bundle-Description: Bundle exporting javax.mail
    Bundle-SymbolicName: de.ibb.mail
    Fragment-Host: system.bundle; extension:=framework 
    Export-Package: javax.mail.internet; uses:="com.sun.mail.util, javax.m
     ail, javax.activation, javax.mail.util"; version="1.5", javax.mail.ut
     il; uses:="javax.activation, javax.mail.internet"; version="1.5", jav
     ax.mail.search; uses:="javax.mail.internet, javax.mail"; version="1.5
     ", javax.mail; uses:="javax.mail.event, javax.mail.search, javax.acti
     vation, com.sun.mail.util"; version="1.5", javax.mail.event; uses:="j
     avax.mail"; version="1.5", com.sun.mail.imap; uses:="com.sun.mail.iap
     , javax.mail, com.sun.mail.imap.protocol, javax.activation, com.sun.m
     ail.util, javax.mail.internet, javax.mail.search, javax.mail.event"; 
     version="1.5.0", com.sun.mail.imap.protocol; uses:="com.sun.mail.iap,
      com.sun.mail.util, javax.mail.internet, javax.mail, com.sun.mail.ima
     p, javax.mail.search, javax.security.sasl, javax.security.auth.callba
     ck"; version="1.5.0", com.sun.mail.iap; uses:="com.sun.mail.util, jav
     ax.net.ssl"; version="1.5.0", com.sun.mail.pop3; uses:="javax.mail, c
     om.sun.mail.util, javax.mail.internet, javax.net.ssl, javax.mail.util
     "; version="1.5.0", com.sun.mail.smtp; uses:="com.sun.mail.util, java
     x.mail.internet, javax.mail, javax.security.sasl, javax.security.auth
     .callback, javax.net.ssl"; version="1.5.0", com.sun.mail.util; uses:=
     "javax.mail, javax.net.ssl, javax.mail.internet, javax.mail.util, jav
     ax.net, javax.security.auth.x500"; version="1.5.0", com.sun.mail.util
     .logging; uses:="javax.mail, javax.mail.internet, javax.mail.util, ja
     vax.activation, com.sun.mail.smtp"; version="1.5.0", com.sun.mail.han
     dlers; uses:="javax.activation, javax.mail.internet, javax.mail, java
     x.xml.transform, javax.xml.transform.stream"; version="1.5.0"
  5. Execute the following command to create a JAR file from the javaxmail.mf file.

    jar -cfm java.mail-1.0.jar javaxmail.mf

  6. Go to AEM web console bundles, uninstall the JavaMail API (compat) (javax.mail) bundle, and install the JAR file created in the previous step. 

  7. Restart the application server.