Page 1 of 1

Mail export error 'Nested Group'

PostPosted:Tue Apr 19, 2016 6:38 pm
by MKochS
Good evening everybody,

I am running 6.3.1 (community edition) an Debian 8. I recently upgraded from 6.3.0 to 6.3.1 to finish an annoying mail import problem.

After an apparently seamless upgrade, I am facing a new problem: when I am exporting mails from the mail repository, the process stops after a given percentage (2%, 53%, whatever) and throws this error in the RepositoryExporter.log:
Code: Select all
2016-04-19 20:30:50,431 ERROR MessagingException 'Nested group'

Another error I am getting is
Code: Select all
2016-04-19 20:37:22,122 ERROR MessagingException 'Missing '<''

Any ideas about what's wrong?

TIA
Matthias

Re: Mail export error 'Nested Group'

PostPosted:Sat Apr 23, 2016 10:39 am
by jllort
Probably while importing now we are parsing the mail accounts better, and format stored in database not corresponses with actual ( or contains some errors ). Is this the complete stack trace of the error or do you have a more detailed one ?

Re: Mail export error 'Nested Group'

PostPosted:Tue Apr 26, 2016 9:46 am
by pavila
Go to Administration > Utilities > Scripting and run (to detect badly imported mail addresses):
Code: Select all
import com.openkm.core.DatabaseException;
import com.openkm.dao.bean.NodeMail;
import com.openkm.dao.HibernateUtil;
import javax.mail.internet.*;
import org.hibernate.*;

String qs = "from NodeMail nm";
Session session = null;

try {
    session = HibernateUtil.getSessionFactory().openSession();
    session.beginTransaction();
 
    Query q = session.createQuery(qs);
    
 
    for (NodeMail nm : q.list()) {
        try {
            new InternetAddress(nm.getFrom());
        } catch (AddressException e) {
            print("Error con : " + nm.getUuid() + "<br>");
        }
    }
 
    HibernateUtil.commit(session.getTransaction());
} catch (HibernateException e) {
    HibernateUtil.rollback(session.getTransaction());
    throw new DatabaseException(e.getMessage(), e);
} finally {
    HibernateUtil.close(session);
}

Re: Mail export error 'Nested Group'

PostPosted:Tue Apr 26, 2016 3:41 pm
by MKochS
This is the result:
Code: Select all
Sourced file: inline evaluation of: ``import com.openkm.core.DatabaseException; import com.openkm.dao.bean.NodeMail; . . . '' : Object constructor : at Line: 19 : in file: inline evaluation of: ``import com.openkm.core.DatabaseException; import com.openkm.dao.bean.NodeMail; . . . '' : new InternetAddress ( nm .getFrom ( ) ) Target exception: java.lang.NullPointerException 
Sorry about the mess, I didn't know where to enter newline.

Re: Mail export error 'Nested Group'

PostPosted:Fri Apr 29, 2016 9:29 pm
by jllort
It's strange error, because seems nm.getFrom() returns null, what should never be possible to be received an e-mail from null. I think in your case should modify the code taking in consideration when from is null, and setting there some valid mail address like "empty@from.com"