Page 1 of 1
Export of mail tree fails, Umlaut related?
PostPosted:Fri Jun 26, 2015 2:20 pm
by MKochS
Good afternoon everybody, I am using 6.3.0 build: 8156 on Debian Wheezy. When exporting a mail folder tree I am running into the following problem:
Export starts and the target folder is being filled. At a given point (in my case 70%) the process stops with the message
"Error Illegal Address". I have already found out that this is the point where the process hits a mail whose sender's name contains a German Umlaut. Specifically, the sender's name is
Code: Select allHarald Müller <hmueller@somehost.somedomain>.
The only way to avoid this problem is to delete the mail in question from the tree, which is clearly not what you want when you're archiving mails. Up to this point, the export is producing proper *.eml files, so the process in general is working. Is there a way to adapt the process to handle Umlauts?
TIA
Matthias
Re: Export of mail tree fails, Umlaut related?
PostPosted:Sun Jun 28, 2015 9:53 am
by jllort
On latest version we introduced mail address verification, but if you comes from older, could be some not valid Internet address. Try this script to looking for bad mail address into your repository ( will provide you a list of UUID with problematic from mail address ).
Code: Select allimport 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: Export of mail tree fails, Umlaut related?
PostPosted:Sun Jun 28, 2015 7:41 pm
by MKochS
Good evening, just to clarify this, the
mail address itself is valid, the prepending name contains a character that the process seems to be unable to handle.
I think editing the mail and removing the character in question before it is processed by the export process would work, but I cannot do that from the workdesk. Grepping the repository for the name produced a file containing this line:
Code: Select allFrom: =?iso-8859-1?Q?Harald_M=FCller?= <hmueller@somehost.somedomain>
Could I simply change this with a text editor, or would I mess things up?
Kind regards
Matthias
Re: Export of mail tree fails, Umlaut related?
PostPosted:Tue Jun 30, 2015 6:44 pm
by jllort
You can modify directly into OpenKM database
Code: Select allselect * from OKM_NODE_MAIL WHERE NBS_UUID='the node uuid'
You can get the mail uuid from properties tab view ( select and then CTRL+C to copy )
Re: Export of mail tree fails, Umlaut related?
PostPosted:Tue Jun 30, 2015 7:13 pm
by MKochS
Executing the query produces the mail in question - I just cannot find where to edit.
Re: Export of mail tree fails, Umlaut related?
PostPosted:Sun Jul 05, 2015 9:57 am
by jllort
do the SQL update
UPDATE OKM_NODE_MAIL SET 'SOMETHING HERE !!!!!' WHERE NBS_UUID='the node uuid';
Re: Export of mail tree fails, Umlaut related?
PostPosted:Mon Aug 03, 2015 4:53 pm
by psycho160
Hello,
i´m having the same Issue. I´m from Austria and many mails contain characters like "ö ä ü".
If i archive a mail with such characters, the export of the repository fails. error: illegal adress
the scripts in the above posts are only a workaround but not a solution for this problem.

Re: Export of mail tree fails, Umlaut related?
PostPosted:Tue Aug 04, 2015 10:11 am
by jllort
Are you also using version 6.3.0 ?
Re: Export of mail tree fails, Umlaut related?
PostPosted:Tue Aug 04, 2015 11:29 am
by psycho160
Yes same installation like the creator.
Version: 6.3.0 (build: 8156) on ubuntu server 14.04.
I found out that it looks like the problem is only with special characters in the subject of an email.
Because i exportet successful mails with such characters in the mail text
Re: Export of mail tree fails, Umlaut related?
PostPosted:Sat Aug 08, 2015 7:19 am
by jllort
Can you upgrade to night build
http://integration.openkm.com ( is nearly to be released as 6.3.1 ), here's the migration guide
http://wiki.openkm.com/index.php/Migrat ... 3_to_6.3.1
We've done some correction in this version and I would like to check there this issue. Please check with a new mail, not existing ones, because the correction could affect the way on how the data is inserted. Tell us if in that version the issue persist or not.
Re: Export of mail tree fails, Umlaut related?
PostPosted:Sat Aug 08, 2015 11:03 am
by psycho160
Yess man you are the best!
-i upgraded like in the tutorial described
-wrote a new e-mail with "äöüÄÖÜ" in the subject and the mail text
-imported it into OKM
-started an export of the repository
-SUCCESSFUL
..btw, in the Home Administration Tab it shows me Version: 6.3.0 (build: 8156) -> thats the same like before the update...

Re: Export of mail tree fails, Umlaut related?
PostPosted:Sun Aug 09, 2015 10:04 am
by jllort
Could be a problem with cached jsp files ( sometimes happens ).
Try:
Stop application.
Remove the $TOMCAT_HOME/webapps/OpenKM and $TOMCAT_HOME/work/Catalina/localhost folders
Start again.
You should get 6.3.1-DEV ( development ), I reviewed the pom.xml file and sure you should get it.
Re: Export of mail tree fails, Umlaut related?
PostPosted:Sun Aug 09, 2015 5:58 pm
by psycho160
alright, steps done. - shows me right version.
perfect.
thx