Author: rdonkin
Date: Wed Jun 25 11:38:16 2008
New Revision: 671623
URL: http://svn.apache.org/viewvc?rev=671623&view=rev
Log:
Some additions to the script generator and some example mail with obscure MIME
headers.
Added:
james/server/trunk/experimental-seda-imap-function/src/test/resources/org/apache/james/test/functional/multipart-alt-translation.mail
james/server/trunk/experimental-seda-imap-function/src/test/resources/org/apache/james/test/functional/multipart-binary.mail
Modified:
james/server/trunk/experimental-seda-imap-function/src/test/java/org/apache/james/test/functional/CreateScript.java
james/server/trunk/experimental-seda-imap-function/src/test/java/org/apache/james/test/functional/ScriptBuilder.java
Modified:
james/server/trunk/experimental-seda-imap-function/src/test/java/org/apache/james/test/functional/CreateScript.java
URL:
http://svn.apache.org/viewvc/james/server/trunk/experimental-seda-imap-function/src/test/java/org/apache/james/test/functional/CreateScript.java?rev=671623&r1=671622&r2=671623&view=diff
==============================================================================
---
james/server/trunk/experimental-seda-imap-function/src/test/java/org/apache/james/test/functional/CreateScript.java
(original)
+++
james/server/trunk/experimental-seda-imap-function/src/test/java/org/apache/james/test/functional/CreateScript.java
Wed Jun 25 11:38:16 2008
@@ -35,7 +35,41 @@
public static final void main(String[] args) throws Exception {
ScriptBuilder builder = ScriptBuilder.open("localhost", 143);
- renameSelected(builder);
+ bodyStructure(builder);
+ }
+
+ public static void bodyStructure(ScriptBuilder builder) throws Exception {
+ builder.login();
+ builder.create();
+ builder.select();
+ builder.setFile("multipart-binary.mail");
+ builder.append();
+ builder.setFile("multipart-alt-translation.mail");
+ builder.append();
+ builder.fetchAllMessages();
+ builder.fetchSection("");
+ builder.fetchSection("TEXT");
+ builder.fetchSection("HEADER");
+ builder.fetchSection("1");
+ builder.fetchSection("2");
+ builder.fetchSection("3");
+ builder.fetchSection("3.HEADER");
+ builder.fetchSection("3.TEXT");
+ builder.fetchSection("3.1");
+ builder.fetchSection("3.2");
+ builder.fetchSection("4");
+ builder.fetchSection("4.1");
+ builder.fetchSection("4.1.MIME");
+ builder.fetchSection("4.2");
+ builder.fetchSection("4.2.HEADER");
+ builder.fetchSection("4.2.TEXT");
+ builder.fetchSection("4.2.1");
+ builder.fetchSection("4.2.2");
+ builder.fetchSection("4.2.2.1");
+ builder.fetchSection("4.2.2.2");
+ builder.resetFetch().setBodyFetch(true).setBodyStructureFetch(true);
+ builder.fetchAllMessages();
+ builder.quit();
}
public static void renameSelected(ScriptBuilder builder) throws Exception {
Modified:
james/server/trunk/experimental-seda-imap-function/src/test/java/org/apache/james/test/functional/ScriptBuilder.java
URL:
http://svn.apache.org/viewvc/james/server/trunk/experimental-seda-imap-function/src/test/java/org/apache/james/test/functional/ScriptBuilder.java?rev=671623&r1=671622&r2=671623&view=diff
==============================================================================
---
james/server/trunk/experimental-seda-imap-function/src/test/java/org/apache/james/test/functional/ScriptBuilder.java
(original)
+++
james/server/trunk/experimental-seda-imap-function/src/test/java/org/apache/james/test/functional/ScriptBuilder.java
Wed Jun 25 11:38:16 2008
@@ -109,8 +109,9 @@
this.fetch = fetch;
}
- public final void resetFetch() {
+ public final Fetch resetFetch() {
this.fetch = new Fetch();
+ return fetch;
}
public final int getMessageNumber() {
@@ -439,6 +440,10 @@
return this;
}
+ public void fetchBody() throws Exception {
+
+ }
+
public void fetch() throws Exception {
final String command = fetch.command(messageNumber);
command(command);
@@ -850,6 +855,7 @@
public static final class Fetch {
+
public static final String[] COMPREHENSIVE_HEADERS = {"DATE", "FROM",
"TO", "CC", "SUBJECT",
"REFERENCES", "IN-REPLY-TO", "MESSAGE-ID", "MIME-VERSION",
"CONTENT-TYPE",
"X-MAILING-LIST", "X-LOOP", "LIST-ID", "LIST-POST",
"MAILING-LIST", "ORIGINATOR", "X-LIST",
@@ -862,8 +868,28 @@
private boolean rfc822Size = false;
private boolean internalDate = false;
private boolean uid = false;
- private String bodyPeek = null;
+ private String body = null;
+ private boolean bodyFetch = false;
+ private boolean bodyStructureFetch = false;
+ public final boolean isBodyFetch() {
+ return bodyFetch;
+ }
+
+ public final Fetch setBodyFetch(boolean bodyFetch) {
+ this.bodyFetch = bodyFetch;
+ return this;
+ }
+
+ public final boolean isBodyStructureFetch() {
+ return bodyStructureFetch;
+ }
+
+ public final Fetch setBodyStructureFetch(boolean bodyStructureFetch) {
+ this.bodyStructureFetch = bodyStructureFetch;
+ return this;
+ }
+
public String command(int messageNumber) {
return "FETCH " + messageNumber + "(" + fetchData() + ")";
}
@@ -908,24 +934,24 @@
return this;
}
- public final String getBodyPeek() {
- return bodyPeek;
+ public final String getBody() {
+ return body;
}
- public final void setBodyPeek(String bodyPeek) {
- this.bodyPeek = bodyPeek;
+ public final void setBody(String bodyPeek) {
+ this.body = bodyPeek;
}
public void bodyPeekCompleteMessage() {
- setBodyPeek(buildBody(true, ""));
+ setBody(buildBody(true, ""));
}
public void bodyPeekNotHeaders(String[] fields) {
- setBodyPeek(buildBody(true, buildHeaderFields(fields, true)));
+ setBody(buildBody(true, buildHeaderFields(fields, true)));
}
public Fetch bodyPeekHeaders(String[] fields) {
- setBodyPeek(buildBody(true, buildHeaderFields(fields, false)));
+ setBody(buildBody(true, buildHeaderFields(fields, false)));
return this;
}
@@ -972,7 +998,13 @@
if (uid) {
first = add(buffer, first, "UID");
}
- add(buffer, first, bodyPeek);
+ if (bodyFetch) {
+ first = add(buffer, first, "BODY");
+ }
+ if (bodyStructureFetch) {
+ first = add(buffer, first, "BODYSTRUCTURE");
+ }
+ add(buffer, first, body);
return buffer.toString();
}
Added:
james/server/trunk/experimental-seda-imap-function/src/test/resources/org/apache/james/test/functional/multipart-alt-translation.mail
URL:
http://svn.apache.org/viewvc/james/server/trunk/experimental-seda-imap-function/src/test/resources/org/apache/james/test/functional/multipart-alt-translation.mail?rev=671623&view=auto
==============================================================================
---
james/server/trunk/experimental-seda-imap-function/src/test/resources/org/apache/james/test/functional/multipart-alt-translation.mail
(added)
+++
james/server/trunk/experimental-seda-imap-function/src/test/resources/org/apache/james/test/functional/multipart-alt-translation.mail
Wed Jun 25 11:38:16 2008
@@ -0,0 +1,46 @@
+################################################################
+# Licensed to the Apache Software Foundation (ASF) under one #
+# or more contributor license agreements. See the NOTICE file #
+# distributed with this work for additional information #
+# regarding copyright ownership. The ASF licenses this file #
+# to you under the Apache License, Version 2.0 (the #
+# "License"); you may not use this file except in compliance #
+# with the License. You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, #
+# software distributed under the License is distributed on an #
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY #
+# KIND, either express or implied. See the License for the #
+# specific language governing permissions and limitations #
+# under the License. #
+################################################################
+
+From: Timothy Tayler <[EMAIL PROTECTED]>
+To: Samual Smith <[EMAIL PROTECTED]>
+Date: Thu, 14 Feb 2008 12:00:00 +0000 (GMT)
+Subject: A Multipart Email
+Content-Type: multipart/alternative;boundary=1729
+
+Some translations of Hello, World!
+
+--1729
+Content-Type: text/plain; charset=US-ASCII
+Content-Language: en, en-US, en-CA
+
+Hello, World!
+
+--1729
+Content-Type: text/plain; charset=US-ASCII
+Content-Language: fr, fr-Latn-CA
+
+Bonjour, monde !
+
+--1729
+Content-Type: text/plain; charset=US-ASCII
+Content-Language: nl-BE
+
+Hello, Wereld!
+
+--1729--
Added:
james/server/trunk/experimental-seda-imap-function/src/test/resources/org/apache/james/test/functional/multipart-binary.mail
URL:
http://svn.apache.org/viewvc/james/server/trunk/experimental-seda-imap-function/src/test/resources/org/apache/james/test/functional/multipart-binary.mail?rev=671623&view=auto
==============================================================================
---
james/server/trunk/experimental-seda-imap-function/src/test/resources/org/apache/james/test/functional/multipart-binary.mail
(added)
+++
james/server/trunk/experimental-seda-imap-function/src/test/resources/org/apache/james/test/functional/multipart-binary.mail
Wed Jun 25 11:38:16 2008
@@ -0,0 +1,179 @@
+################################################################
+# Licensed to the Apache Software Foundation (ASF) under one #
+# or more contributor license agreements. See the NOTICE file #
+# distributed with this work for additional information #
+# regarding copyright ownership. The ASF licenses this file #
+# to you under the Apache License, Version 2.0 (the #
+# "License"); you may not use this file except in compliance #
+# with the License. You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, #
+# software distributed under the License is distributed on an #
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY #
+# KIND, either express or implied. See the License for the #
+# specific language governing permissions and limitations #
+# under the License. #
+################################################################
+
+Return-Path: <[EMAIL PROTECTED]>
+Received: (qmail 18554 invoked from network); 25 May 2008 14:38:53 -0000
+Received: from unknown (HELO p3presmtp01-16.prod.phx3.secureserver.net)
+ ([208.109.80.165]) (envelope-sender <[EMAIL PROTECTED]>) by
+ smtp20-01.prod.mesa1.secureserver.net (qmail-1.03) with SMTP for
+ <[EMAIL PROTECTED]>; 25 May 2008 14:38:53 -0000
+Received: (qmail 9751 invoked from network); 25 May 2008 14:38:53 -0000
+Received: from minotaur.apache.org ([140.211.11.9]) (envelope-sender
+ <[EMAIL PROTECTED]>) by
+ p3presmtp01-16.prod.phx3.secureserver.net (qmail-ldap-1.03) with SMTP
for
+ <[EMAIL PROTECTED]>; 25 May 2008 14:38:50 -0000
+Received: (qmail 46768 invoked by uid 1289); 25 May 2008 14:38:46 -0000
+Delivered-To: [EMAIL PROTECTED]
+Received: (qmail 46763 invoked from network); 25 May 2008 14:38:46 -0000
+Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by
+ minotaur.apache.org with SMTP; 25 May 2008 14:38:46 -0000
+Received: (qmail 61275 invoked by uid 500); 25 May 2008 14:38:48 -0000
+Delivered-To: [EMAIL PROTECTED]
+Delivered-To: [EMAIL PROTECTED]
+Delivered-To: [EMAIL PROTECTED]
+Received: (qmail 61272 invoked by uid 99); 25 May 2008 14:38:48 -0000
+Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136)
+ by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 May 2008 07:38:48
-0700
+X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS
+X-Spam-Check-By: apache.org
+Received-SPF: pass (athena.apache.org: domain of
+ [EMAIL PROTECTED] designates 195.188.213.5 as permitted
+ sender)
+Received: from [195.188.213.5] (HELO smtp-out2.blueyonder.co.uk)
+ (195.188.213.5) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 May
2008
+ 14:38:00 +0000
+Received: from [172.23.170.140] (helo=anti-virus02-07) by
+ smtp-out2.blueyonder.co.uk with smtp (Exim 4.52) id 1K0HMV-00087e-HY
for
+ [EMAIL PROTECTED]; Sun, 25 May 2008 15:38:15 +0100
+Received: from [82.38.65.6] (helo=[10.0.0.27]) by
+ asmtp-out5.blueyonder.co.uk with esmtpa (Exim 4.52) id
1K0HMU-0001A2-3q for
+ [EMAIL PROTECTED]; Sun, 25 May 2008 15:38:14 +0100
+Subject: This is an example of a multipart mixed email with image content
+From: Robert Burrell Donkin <[EMAIL PROTECTED]>
+To: Robert Burrell Donkin <[EMAIL PROTECTED]>
+Content-Type: multipart/mixed; boundary=\"=-tIdGYVstQJghyEDATnJ+\"
+Content-Location: http://www.example.org/
+Date: Sun, 25 May 2008 15:38:13 +0100
+Message-Id: <[EMAIL PROTECTED]>
+Mime-Version: 1.0
+X-Mailer: Evolution 2.12.3
+X-Virus-Checked: Checked by ClamAV on apache.org
+X-Nonspam: None
+X-fetched-from: mail.xmlmapt.org
+X-Evolution-Source: imap://[EMAIL PROTECTED]/
+
+
+--=-tIdGYVstQJghyEDATnJ+
+Content-Type: text/plain
+Content-Transfer-Encoding: 7bit
+Content-Location: relative/license.txt
+
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+\"License\"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+
+
+--=-tIdGYVstQJghyEDATnJ+
+Content-Disposition: attachment; filename=blob.png;
+ modification-date="Sun, 21 Jun 2008 15:32:18 +0000";
+ creation-date="Sat, 20 Jun 2008 10:15:09 +0000";
+ read-date="Mon, 22 Jun 2008 12:08:56 +0000";size=482;
+Content-Type: image/png; name=blob.png
+Content-Transfer-Encoding: base64
+Content-Location: http://www.example.org/blob.png
+
+iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAIAAAACUFjqAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAL
+EwAACxMBAJqcGAAAAAd0SU1FB9gFGQ4iJ99ufcYAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRo
+IEdJTVBXgQ4XAAAA0ElEQVQY02XMwUrDQBhF4XsnkyYhjWJaCloEN77/a/gERVwJLQiiNjYmbTqZ
+/7qIG/VsPziMTw+23Wj/ovZdMQJgViCvWNVusfa23djuUf2nugbnI2RynkWF5a2Fwdvrs7q9vhqE
+E2QAEIO6BhZBerUf6luMw49NyTR0OLw5kJD9sqk4Ipwc6GAREv5n5piXTDOQfy1JMSs8ZgXKq2kF
+iwDgEriEecnLlefFEmGAIvqD4ggJJNMM85qLtXfX9xYGuEQ+4/kIi0g88zlXd66++QaQDG5GPZyp
+rQAAAABJRU5ErkJggg==
+
+
+--=-tIdGYVstQJghyEDATnJ+
+Content-Disposition: attachment; filename=blob.png
+Content-Type: image/png; name=blob.png
+Content-Transfer-Encoding: base64
+Content-Location: (Comments before) http://www.example.org/blob.png (And
comments afterwards)
+
+iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAIAAAACUFjqAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAL
+EwAACxMBAJqcGAAAAAd0SU1FB9gFGQ4iJ99ufcYAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRo
+IEdJTVBXgQ4XAAAA0ElEQVQY02XMwUrDQBhF4XsnkyYhjWJaCloEN77/a/gERVwJLQiiNjYmbTqZ
+/7qIG/VsPziMTw+23Wj/ovZdMQJgViCvWNVusfa23djuUf2nugbnI2RynkWF5a2Fwdvrs7q9vhqE
+E2QAEIO6BhZBerUf6luMw49NyTR0OLw5kJD9sqk4Ipwc6GAREv5n5piXTDOQfy1JMSs8ZgXKq2kF
+iwDgEriEecnLlefFEmGAIvqD4ggJJNMM85qLtXfX9xYGuEQ+4/kIi0g88zlXd66++QaQDG5GPZyp
+rQAAAABJRU5ErkJggg==
+
+
+--=-tIdGYVstQJghyEDATnJ+
+Content-Disposition: attachment; filename=rhubarb.txt
+Content-Type: text/plain; name=rhubarb.txt; charset=us-ascii
+Content-Language: en, en-US, en-CA, en-AU
+Content-Transfer-Encoding: quoted-printable
+Content-Location: "ftp://ftp.example.org/lots/lots/lots/
+ lots/lots/lots/lots/lots/lots/lots/
+ rhubard.txt"
+
+Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhu=
+barb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubar=
+b Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb R=
+hubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhub=
+arb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb=
+ Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rh=
+ubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhuba=
+rb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb =
+Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhu=
+barb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubar=
+b Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb R=
+hubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhub=
+arb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb=
+ Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rh=
+ubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhuba=
+rb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb =
+Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhu=
+barb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubar=
+b Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb R=
+hubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhub=
+arb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb=
+ Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rh=
+ubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhuba=
+rb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb =
+Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhu=
+barb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubar=
+b Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb R=
+hubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhub=
+arb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb=
+ Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rh=
+ubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhuba=
+rb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb =
+Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhu=
+barb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubar=
+b Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb R=
+hubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhub=
+arb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb=
+ Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rh=
+ubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhuba=
+rb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb =
+Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb
+
+--=-tIdGYVstQJghyEDATnJ+--
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]