Archive for the ‘en: Java’ Category

alfresco

Thursday, November 16th, 2006

Today I installed alfresco 1.4.0, an open-source web-application, for document management and more. It is implemented in Java, based on open standards (WebDAV, JSR168, JSR170, …). I like the user-interface. But it seems to be affected by the
jsf-back-button problem: After using the back-button the link of the old page is not valid anymore and only leads to a page-refresh. So you have to click twice.

Anyway: They recently announced WCM, a Web-CMS that integrates with alfresco. (sourceforge, heise newsticker) When they release a stable version, I will check it out.

Tool for Parsing mbox files to get delivery status messages

Sunday, July 30th, 2006

You send out newsletters? You manage online-accounts which are connected to an e-mail-address? So you have to keep track of the e-mail-addresses which become temporary or permanently unavailable. A good starting point is to provide a return-path in the header of every message you send.
Return-Path:
So you will get a delivery status notification (DSN) on failure.

[code]
Date: Sat, 22 Jul 2006 22:58:27 +0200 (CEST)
From: MAILER-DAEMON@your0815provider.com (Mail Delivery System)
Subject: Undelivered Mail Returned to Sender
To: sample-return-path@in-a-nutshell.net
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
boundary=”346A8BD40B6.1153601907/your0815provider.com”
Content-Transfer-Encoding: 8bit
Message-Id: <20060722205827.7A544BD40AD@your0815provider.com>

This is a MIME-encapsulated message.

–346A8BD40B6.1153601907/your0815provider.com
Content-Description: Notification
Content-Type: text/plain

This is the Postfix program at host your0815provider.com.

I’m sorry to have to inform you that the message returned
below could not be delivered to one or more destinations.

For further assistance, please send mail to

If you do so, please include this problem report. You can
delete your own text from the message returned below.

The Postfix program

: host mx-ha01.web.de[217.72.192.149] said: 550
Benutzer hat zuviele Mails auf dem Server. / User has too
many messages on the server. (in reply to RCPT TO command)

–346A8BD40B6.1153601907/your0815provider.com
Content-Description: Delivery error report
Content-Type: message/delivery-status

Reporting-MTA: dns; your0815provider.com
Arrival-Date: Sat, 22 Jul 2006 22:58:27 +0200 (CEST)

Final-Recipient: rfc822; user_xy@web.de
Action: failed
Status: 5.0.0
Diagnostic-Code: X-Postfix; host mx-ha01.web.de[217.72.192.149] said: 550
Benutzer hat zuviele Mails auf dem Server. / User has too
many messages on the server. (in reply to RCPT TO command)

–346A8BD40B6.1153601907/your0815provider.com
Content-Description: Undelivered Message
Content-Type: message/rfc822
Content-Transfer-Encoding: 8bit
[/code]

The DSN info has a special content-type:
Content-Type: message/delivery-status

I implemented a small, greedy command-line-driven program in java, that parses an Mbox file and collects e-mail-addresses that caused an dsn with Action: failed.

For each e-mail-address there is one output, which can be configured using a template string.

I am using this to generate a sql-script where each line contains an update-statement to a refresh the availability status for a special e-mail-address.

The call looks like:
java -jar dnsextractor -t "update email_availability set dsn_email={sql:email:}, dsn_sent_time={:unixtime:}, dsn_classification={:dfnclass:}, dsn_obsolete={:obsolete:} where email = {sql:email:}; # ({dfn:Status}) {:date:}: {dfn:Diagnostic-Code:}" returnedmsgs -s sentmsgs

I am using this program to parse Thunderbird message-box files. Thunderbird uses a variation of the mboxrd format and I have not encountered any compatibility problems.

The program uses the Libraries from the GNU Classpath project to parse the mbox files. At the moment these libraries are a little bit buggy. I reported some bugs and did some workarounds.
The problems: 1. The library writes some stack-traces to System.err. 2. There are some example with e-mail-addresses of the kind "localpart."@gmx.de.

The program uses the dsn.jar from suns javamail library, to parse the DSN message-part.

The status of the DSN was not very useful. So the program includes an uncomplete list of regular expression patterns to cluster the DSNs by searching for these patterns within the Diagnostic-Code string.

There is also a feature to compare the sent-time of the last message sent to user A and the DSN received for the e-mail-address of user A. This is useful to recognize that a temporary problem has gone away.

Last but not least there is a feature, to parse DSNs which are delivered as plain text.

If there is some interest, I will try to publish the program and its source-code.

Which tool do you use to keep track of delivery status notifications?

package junit.framework does not exist on building swingx.jar

Friday, July 21st, 2006

The current swingx branch does not build successful using eclilpse to execute the ant-default-target:

DefaultDateSelectionModelTest.java:26: package junit.framework does not exist

build-impl.xml:142: Could not create task or type of type: junit

That seems to be an junit-classpath-issue. So it was easy to pass these problems by, by running the jar-target only.

Anybody out there, who wants to comment how to fix this problem?

missing java.awt.SystemColor.gradientActiveCaption

Friday, July 7th, 2006

I am missing the static fields gradientActiveCaption and SystemColor.gradientInactiveCaption in the class SystemColor of javas awt package. These values could be null if this information is not available.

also see: msdn about windows system colors