You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by bt...@apache.org on 2021/06/29 01:34:28 UTC

[james-mime4j] branch master updated (8591c45 -> 3aa29d3)

This is an automated email from the ASF dual-hosted git repository.

btellier pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/james-mime4j.git.


    from 8591c45  MIME-298 DateTimeFieldLenientImpl: remove unneeded option
     new 6d2e664  [EXAMPLES] MessageTree should be easy to launch from an IDE
     new 0b34c69  [EXAMPLES] IterateOverMbox should be easy to launch from an IDE
     new 58bfaaa  [EXAMPLES] Migrate away from MessageBuilder
     new 598c3d7  [EXAMPLES] Add an example for parsing messages
     new eebe5a5  [EXAMPLES] Link github and sit examples from the Mime4J index
     new b3e1e27  [EXAMPLES] Fix a typo in NAV panel
     new 3886419  [EXAMPLES] Github links for examples
     new 3aa29d3  [EXAMPLES] RAT exceptions for newly added example resources

The 8 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../james/mime4j/samples/dom/MultipartMessage.java |  2 +-
 .../james/mime4j/samples/dom/ParsingMessage.java   | 57 +++++++++++++++++++++
 .../james/mime4j/samples/dom/TextPlainMessage.java |  2 +-
 .../james/mime4j/samples/mbox/IterateOverMbox.java | 20 +++++---
 .../mime4j/samples/transform/TransformMessage.java |  9 ++--
 .../james/mime4j/samples/tree/MessageTree.java     | 16 ++++--
 .../src/main/resources/mbox-example}/mbox.rlug     |  0
 .../src/main/resources/mbox-example}/mbox.rlug-0   |  0
 .../src/main/resources/mbox-example}/mbox.rlug-1   |  0
 .../src/main/resources/mbox-example}/mbox.rlug-2   |  0
 .../src/main/resources/mbox-example}/mbox.rlug-3   |  0
 .../src/main/resources/mbox-example}/mbox.rlug-4   |  0
 .../src/main/resources/mime-example.msg            |  0
 pom.xml                                            |  2 +
 src/site/site.xml                                  |  2 +-
 src/site/xdoc/index.xml                            | 46 ++++++++++-------
 src/site/xdoc/samples.xml                          | 58 ++++++++++------------
 17 files changed, 144 insertions(+), 70 deletions(-)
 create mode 100644 examples/src/main/java/org/apache/james/mime4j/samples/dom/ParsingMessage.java
 copy {mbox/src/test/resources/test-1 => examples/src/main/resources/mbox-example}/mbox.rlug (100%)
 copy {mbox/src/test/resources/test-1 => examples/src/main/resources/mbox-example}/mbox.rlug-0 (100%)
 copy {mbox/src/test/resources/test-1 => examples/src/main/resources/mbox-example}/mbox.rlug-1 (100%)
 copy {mbox/src/test/resources/test-1 => examples/src/main/resources/mbox-example}/mbox.rlug-2 (100%)
 copy {mbox/src/test/resources/test-1 => examples/src/main/resources/mbox-example}/mbox.rlug-3 (100%)
 copy {mbox/src/test/resources/test-1 => examples/src/main/resources/mbox-example}/mbox.rlug-4 (100%)
 copy core/src/test/resources/testmsgs/simple-attachment.msg => examples/src/main/resources/mime-example.msg (100%)

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-mime4j] 02/08: [EXAMPLES] IterateOverMbox should be easy to launch from an IDE

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-mime4j.git

commit 0b34c69f0dc668890342445d2a0884141a97cc65
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Jun 24 14:35:10 2021 +0700

    [EXAMPLES] IterateOverMbox should be easy to launch from an IDE
    
    We can default to a local resource if no argument is provided.
---
 .../james/mime4j/samples/mbox/IterateOverMbox.java |  20 +-
 examples/src/main/resources/mbox-example/mbox.rlug | 346 +++++++++++++++++++++
 .../src/main/resources/mbox-example/mbox.rlug-0    |  93 ++++++
 .../src/main/resources/mbox-example/mbox.rlug-1    |  69 ++++
 .../src/main/resources/mbox-example/mbox.rlug-2    |  50 +++
 .../src/main/resources/mbox-example/mbox.rlug-3    |  64 ++++
 .../src/main/resources/mbox-example/mbox.rlug-4    |  65 ++++
 7 files changed, 699 insertions(+), 8 deletions(-)

diff --git a/examples/src/main/java/org/apache/james/mime4j/samples/mbox/IterateOverMbox.java b/examples/src/main/java/org/apache/james/mime4j/samples/mbox/IterateOverMbox.java
index 4f00ab5..0b54b4c 100644
--- a/examples/src/main/java/org/apache/james/mime4j/samples/mbox/IterateOverMbox.java
+++ b/examples/src/main/java/org/apache/james/mime4j/samples/mbox/IterateOverMbox.java
@@ -34,6 +34,7 @@ import java.nio.CharBuffer;
 import java.nio.channels.FileChannel;
 import java.nio.charset.Charset;
 import java.nio.charset.CharsetEncoder;
+import java.nio.charset.StandardCharsets;
 
 /**
  * Simple example of how to use Apache Mime4j Mbox Iterator. We split one mbox file file into
@@ -41,15 +42,13 @@ import java.nio.charset.CharsetEncoder;
  */
 public class IterateOverMbox {
 
-    private final static CharsetEncoder ENCODER = Charset.forName("UTF-8").newEncoder();
+    private final static CharsetEncoder ENCODER = StandardCharsets.UTF_8.newEncoder();
 
     // simple example of how to split an mbox into individual files
     public static void main(String[] args) throws Exception {
-        if (args.length != 1) {
-            System.out.println("Please supply a path to an mbox file to parse");
-        }
-
-        final File mbox = new File(args[0]);
+        final String fileName = retrieveMBoxFileName(args);
+        System.out.println(fileName);
+        final File mbox = new File(fileName);
         long start = System.currentTimeMillis();
         int count = 0;
 
@@ -63,6 +62,13 @@ public class IterateOverMbox {
         System.out.println("Done in: " + (end - start) + " milis");
     }
 
+    private static String retrieveMBoxFileName(String[] args) {
+        if (args.length < 1) {
+            return ClassLoader.getSystemResource("test-1/mbox.rlug").getFile();
+        }
+        return args[0];
+    }
+
     private static void saveMessageToFile(int count, CharBuffer buf) throws IOException {
         FileOutputStream fout = new FileOutputStream(new File("target/messages/msg-" + count));
         FileChannel fileChannel = fout.getChannel();
@@ -77,8 +83,6 @@ public class IterateOverMbox {
      *
      * @param messageBytes the message as {@link java.io.InputStream}
      * @return String
-     * @throws IOException
-     * @throws MimeException
      */
     private static String messageSummary(InputStream messageBytes) throws IOException, MimeException {
         MessageBuilder builder = new DefaultMessageBuilder();
diff --git a/examples/src/main/resources/mbox-example/mbox.rlug b/examples/src/main/resources/mbox-example/mbox.rlug
new file mode 100644
index 0000000..815477d
--- /dev/null
+++ b/examples/src/main/resources/mbox-example/mbox.rlug
@@ -0,0 +1,346 @@
+From news@gmane.org Tue Mar 04 03:33:20 2003
+From: "mmihai" <mm...@netcompsj.ro>
+Subject: Din windows ma pot, din LINUX NU ma pot conecta (la ZAPP)
+Date: Fri, 7 Feb 2003 18:35:25 +0200
+Lines: 45
+Sender: rlug-bounce@lug.ro
+Message-ID: <00...@ok6f6gr01ta4hv>
+Reply-To: rlug@lug.ro
+Mime-Version: 1.0
+Content-Type: text/plain;
+	charset="iso-8859-2"
+Content-Transfer-Encoding: 7bit
+Return-path: <rl...@lug.ro>
+Received: from lug.lug.ro ([193.226.140.220])
+	by main.gmane.org with esmtp (Exim 3.35 #1 (Debian))
+	id 18hBoh-0007L5-00
+	for <go...@gmane.org>; Fri, 07 Feb 2003 17:57:31 +0100
+Received: from lug.lug.ro (localhost.localdomain [127.0.0.1])
+	by lug.lug.ro (Postfix) with ESMTP
+	id 70A5332D87; Fri,  7 Feb 2003 18:38:06 +0200 (EET)
+Received: with LISTAR (v0.129a; list rlug); Fri, 07 Feb 2003 18:38:05 +0200 (EET)
+Delivered-To: rlug@lug.ro
+Received: from ns.zappmobile.ro (ns.zapp.ro [80.96.151.2])
+	by lug.lug.ro (Postfix) with ESMTP id 2C3BD32CC7
+	for <rl...@lug.ro>; Fri,  7 Feb 2003 18:38:02 +0200 (EET)
+Received: from mail.zappmobile.ro (mail-server.zappmobile.ro [172.31.254.14])
+	by ns.zappmobile.ro (Postfix) with ESMTP id AFDC2490D
+	for <rl...@lug.ro>; Fri,  7 Feb 2003 18:37:48 +0200 (EET)
+Received: from localhost (localhost [127.0.0.1])
+	by mail.zappmobile.ro (Postfix) with ESMTP
+	id 994A6A0BB1; Fri,  7 Feb 2003 18:37:12 +0200 (EET)
+Received: from ok6f6gr01ta4hv (unknown [172.16.28.148])
+	by mail.zappmobile.ro (Postfix) with SMTP id 292599D67B
+	for <rl...@lug.ro>; Fri,  7 Feb 2003 18:37:09 +0200 (EET)
+To: <rl...@lug.ro>
+X-Priority: 3
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook Express 6.00.2600.0000
+X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
+X-Virus-Scanned: by AMaViS perl-11
+X-archive-position: 23608
+X-listar-version: Listar v0.129a
+Errors-To: rlug-bounce@lug.ro
+X-original-sender: mmihai@netcompsj.ro
+Precedence: bulk
+X-list: rlug
+
+Buna Ziua tuturor,
+
+Am o placa de baza, cu mare probabilitate J-542B, Chipset Ali M1542/M1543,
+Aladdin-V chipset.
+Vreau sa ma conectez la ZAPP, din Linux, pe portul USB
+Un lucru este absolut cert: portul exista si este functional intrucit ma pot
+conecta din XP.
+In Control Panel-ul din XP la "Sectiunea USB" scrie:
+ALI PCI to USB Open Host Controller
+USB Root Hub # Iar sistemul il asigneaza pe COM 4 !!??!!
+L-am lasat in pace ca de mers merge........
+
+Ies din Windows. Pe alta partitie este RH-8.0
+Ma duc in LINUX, RH-8.0, kernel-ul distributiei, nemodificat.
+Inserez modulele:
+1) modprobe usbcore # totul e OK
+2) modprobe usb-ohci # Sistemul imi spune:
+" usb.c: USB device 2 (vend/prod 0X678/0/2303) is not claimed by
+any actine driver.
+#si cele doua module sunt inserate.
+3) Instalez scriptul celor de la ZAPP ( install_hy.sh, e functional, la
+slujba lucreaza excelent)
+4) Incerc conectarea si dau comanda "zapp"
+Modific (de nervi) in /etc/ppp/peers/hyundai-zappmobile de la /dev/ttyUSB0
+pina la /dev/tty/USB4
+si nimic bun, in tail -f /var/log/messages imi zice:
+"Failed to open /dev/ttyUSB0 (#sau cit o fi): No such device.
+Am incercat si pe /dev/ttyS0.......3 si zice:
+Can't get terminal parameters: Input output error
+
+Va rog indrumati-ma si spuneti-mi ce sa fac ca sa lucreze ZAPP-ul  (si) in
+linux, (ca in windows e clar ca e OK ) ??
+
+Va multumesc
+
+
+
+
+---
+Pentru dezabonare, trimiteti mail la 
+listar@lug.ro cu subiectul 'unsubscribe rlug'.
+REGULI, arhive si alte informatii: http://www.lug.ro/mlist/
+
+
+
+
+
+From news@gmane.org Tue Mar 04 03:33:20 2003
+From: lonely wolf <wo...@pcnet.ro>
+Subject: Re: RH 8.0 boot floppy
+Date: Fri, 07 Feb 2003 19:21:04 +0200
+Lines: 27
+Sender: rlug-bounce@lug.ro
+Message-ID: <3E...@pcnet.ro>
+References: <3E...@myrealbox.com> <3E...@apsro.com> <3E...@myrealbox.com> <3E...@apsro.com>
+Reply-To: rlug@lug.ro
+Mime-Version: 1.0
+Content-Type: text/plain; charset=us-ascii; format=flowed
+Content-Transfer-Encoding: 7bit
+Return-path: <rl...@lug.ro>
+Received: from lug.lug.ro ([193.226.140.220])
+	by main.gmane.org with esmtp (Exim 3.35 #1 (Debian))
+	id 18hCBB-0001J4-00
+	for <go...@gmane.org>; Fri, 07 Feb 2003 18:20:45 +0100
+Received: from lug.lug.ro (localhost.localdomain [127.0.0.1])
+	by lug.lug.ro (Postfix) with ESMTP
+	id 63CDE32D58; Fri,  7 Feb 2003 19:21:17 +0200 (EET)
+Received: with LISTAR (v0.129a; list rlug); Fri, 07 Feb 2003 19:21:16 +0200 (EET)
+Delivered-To: rlug@lug.ro
+Received: from mail.nobugconsulting.ro (nobugconsulting.ro [213.157.160.38])
+	by lug.lug.ro (Postfix) with ESMTP id 4F31632CC7
+	for <rl...@lug.ro>; Fri,  7 Feb 2003 19:21:14 +0200 (EET)
+Received: from 127.0.0.1 (localhost.localdomain [127.0.0.1])
+	by buick.nobugconsulting.ro (Postfix) with SMTP id 146354EDCE
+	for <rl...@lug.ro>; Fri,  7 Feb 2003 19:21:04 +0200 (EET)
+Received: from pcnet.ro (unknown [192.168.1.2])
+	by mail.nobugconsulting.ro (Postfix) with ESMTP id DC16D4ED96
+	for <rl...@lug.ro>; Fri,  7 Feb 2003 19:21:03 +0200 (EET)
+User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01
+X-Accept-Language: en-us, fr, ro
+To: rlug@lug.ro
+X-archive-position: 23609
+X-listar-version: Listar v0.129a
+Errors-To: rlug-bounce@lug.ro
+X-original-sender: wolfy@pcnet.ro
+Precedence: bulk
+X-list: rlug
+
+Nicu Buculei wrote:
+> Daniel Pavel a scris, in 2/7/03 4:09 PM:
+> 
+>> :) nu _am_ CD-ul de instalare...  Imaginea am luat-o de pe un rh mirror.
+> 
+>                                     ^^^^^^^^
+> 
+> si ce ai facut cu imaginea ? nu ai tras-o pe cd ?
+> 
+
+ia cu incredere o discheta de 1.44 (sper ca macar floppy ai), scrie pe 
+ea bootnet.img copiat de pe net si apoi (multumindu-i in gind lui cioby) 
+zici asa:
+- linux rescue (la lilo prompt)
+- alegi ftp ca modalitate de lucru
+- ftp.ines.ro (server)
+- /pub/linux/distributions/redhat-8.0/ftpinstall (path catre distributie)
+
+
+
+---
+Pentru dezabonare, trimiteti mail la 
+listar@lug.ro cu subiectul 'unsubscribe rlug'.
+REGULI, arhive si alte informatii: http://www.lug.ro/mlist/
+
+
+
+
+
+From news@gmane.org Tue Mar 04 03:33:20 2003
+From: Adrian Rapa <ad...@dtedu.net>
+Subject: Qmail mysql virtualusers +ssl + smtp auth +pop3
+Date: Fri, 7 Feb 2003 19:36:01 +0200
+Organization: Asociatia Studenteasca a Retelelor din Drumul Taberei
+Lines: 12
+Sender: rlug-bounce@lug.ro
+Message-ID: <20...@dtedu.net>
+Reply-To: rlug@lug.ro
+Mime-Version: 1.0
+Content-Type: text/plain; charset=US-ASCII
+Content-Transfer-Encoding: 7bit
+Return-path: <rl...@lug.ro>
+Received: from lug.lug.ro ([193.226.140.220])
+	by main.gmane.org with esmtp (Exim 3.35 #1 (Debian))
+	id 18hCPk-0002ZW-00
+	for <go...@gmane.org>; Fri, 07 Feb 2003 18:35:48 +0100
+Received: from lug.lug.ro (localhost.localdomain [127.0.0.1])
+	by lug.lug.ro (Postfix) with ESMTP
+	id DC08032D8E; Fri,  7 Feb 2003 19:36:21 +0200 (EET)
+Received: with LISTAR (v0.129a; list rlug); Fri, 07 Feb 2003 19:36:20 +0200 (EET)
+Delivered-To: rlug@lug.ro
+Received: from www.dtedu.net (tabara.imago.ro [193.254.242.5])
+	by lug.lug.ro (Postfix) with SMTP id 3794D32CC7
+	for <rl...@lug.ro>; Fri,  7 Feb 2003 19:36:17 +0200 (EET)
+Received: (qmail 10170 invoked from network); 7 Feb 2003 17:36:02 -0000
+Received: from games.tabara.net (HELO games) (10.39.2.5)
+  by tabara.imago.ro with SMTP; 7 Feb 2003 17:36:02 -0000
+To: rlug@lug.ro
+X-Mailer: Sylpheed version 0.8.9 (GTK+ 1.2.10; i686-pc-linux-gnu)
+X-archive-position: 23610
+X-listar-version: Listar v0.129a
+Errors-To: rlug-bounce@lug.ro
+X-original-sender: adrian@dtedu.net
+Precedence: bulk
+X-list: rlug
+
+Salut,
+poate cineva sa imi dea combinatia aceasta? am incercat sa pun patchurile dar dadeau erori
+
+
+Adrian Rapa
+---
+Pentru dezabonare, trimiteti mail la 
+listar@lug.ro cu subiectul 'unsubscribe rlug'.
+REGULI, arhive si alte informatii: http://www.lug.ro/mlist/
+
+
+
+
+
+From news@gmane.org Tue Mar 04 03:33:20 2003
+From: teo.55@home.ro
+Subject: Re: Din windows ma pot, din LINUX NU ma pot conecta (la ZAPP)
+Date: Sat, 8 Feb 2003 01:41:31 +0200
+Lines: 25
+Sender: rlug-bounce@lug.ro
+Message-ID: <20...@home.ro>
+References: <00...@ok6f6gr01ta4hv>
+Reply-To: rlug@lug.ro
+Mime-Version: 1.0
+Content-Type: text/plain; charset=US-ASCII
+Content-Transfer-Encoding: 7bit
+Return-path: <rl...@lug.ro>
+Received: from lug.lug.ro ([193.226.140.220])
+	by main.gmane.org with esmtp (Exim 3.35 #1 (Debian))
+	id 18hI9b-0003OX-00
+	for <go...@gmane.org>; Sat, 08 Feb 2003 00:43:31 +0100
+Received: from lug.lug.ro (localhost.localdomain [127.0.0.1])
+	by lug.lug.ro (Postfix) with ESMTP
+	id 6064032D4F; Sat,  8 Feb 2003 01:44:08 +0200 (EET)
+Received: with LISTAR (v0.129a; list rlug); Sat, 08 Feb 2003 01:44:07 +0200 (EET)
+Delivered-To: rlug@lug.ro
+Received: from s1.home.ro (home.rdsnet.ro [193.231.236.40])
+	by lug.lug.ro (Postfix) with SMTP id 0EEE832D02
+	for <rl...@lug.ro>; Sat,  8 Feb 2003 01:44:05 +0200 (EET)
+Received: (qmail 3538 invoked from network); 7 Feb 2003 23:37:23 -0000
+Received: from unknown (HELO linbox) (213.233.108.98)
+  by s1.home.ro with SMTP; 7 Feb 2003 23:37:23 -0000
+To: rlug@lug.ro
+In-Reply-To: <00...@ok6f6gr01ta4hv>
+X-Mailer: Sylpheed version 0.8.6 (GTK+ 1.2.10; i686-pc-linux-gnu)
+X-archive-position: 23611
+X-listar-version: Listar v0.129a
+Errors-To: rlug-bounce@lug.ro
+X-original-sender: teo.55@home.ro
+Precedence: bulk
+X-list: rlug
+
+On Fri, 7 Feb 2003 18:35:25 +0200
+"mmihai" <mm...@netcompsj.ro> wrote:
+
+> Buna Ziua tuturor,
+> 
+> Am o placa de baza, cu mare probabilitate J-542B, Chipset Ali
+> M1542/M1543, Aladdin-V chipset.
+> Vreau sa ma conectez la ZAPP, din Linux, pe portul USB
+> Un lucru este absolut cert: portul exista si este functional intrucit
+> ma pot conecta din XP.
+> In Control Panel-ul din XP la "Sectiunea USB" scrie:
+> 
+pl2303.o ?
+ai modulul pentru cipul ala de pe cablu ?
+compileaza, insereaza, bla...
+apoi merge
+
+
+---
+Pentru dezabonare, trimiteti mail la 
+listar@lug.ro cu subiectul 'unsubscribe rlug'.
+REGULI, arhive si alte informatii: http://www.lug.ro/mlist/
+
+
+
+
+
+From news@gmane.org Tue Mar 04 03:33:20 2003
+From: "Dragosh M." <dr...@lsd.ro>
+Subject: LSTP problem - solved
+Date: 08 Feb 2003 01:58:32 +0200
+Lines: 27
+Sender: rlug-bounce@lug.ro
+Message-ID: <10...@snow.lsd.ro>
+Reply-To: rlug@lug.ro
+Mime-Version: 1.0
+Content-Type: text/plain
+Content-Transfer-Encoding: 7bit
+Return-path: <rl...@lug.ro>
+Received: from lug.lug.ro ([193.226.140.220])
+	by main.gmane.org with esmtp (Exim 3.35 #1 (Debian))
+	id 18hIID-0003pf-00
+	for <go...@gmane.org>; Sat, 08 Feb 2003 00:52:25 +0100
+Received: from lug.lug.ro (localhost.localdomain [127.0.0.1])
+	by lug.lug.ro (Postfix) with ESMTP
+	id 461C532D55; Sat,  8 Feb 2003 01:53:03 +0200 (EET)
+Received: with LISTAR (v0.129a; list rlug); Sat, 08 Feb 2003 01:53:02 +0200 (EET)
+Delivered-To: rlug@lug.ro
+Received: from rdsnet.ro (mail.rdsnet.ro [193.231.236.16])
+	by lug.lug.ro (Postfix) with SMTP id F315032D02
+	for <rl...@lug.ro>; Sat,  8 Feb 2003 01:52:59 +0200 (EET)
+Received: (qmail 5162 invoked from network); 7 Feb 2003 23:52:49 -0000
+Received: from unknown (HELO snow.lsd.ro) (81.196.12.127)
+  by mail.rdsnet.ro with SMTP; 7 Feb 2003 23:52:49 -0000
+To: rlug@lug.ro
+X-Mailer: Ximian Evolution 1.0.8 (1.0.8-10) 
+X-archive-position: 23612
+X-listar-version: Listar v0.129a
+Errors-To: rlug-bounce@lug.ro
+X-original-sender: dragosh@lsd.ro
+Precedence: bulk
+X-list: rlug
+
+In sfarsit am rezolvat crapu, cu ajutorul lui James McQuillan (taticul
+LTSP). E foarte simplu si foarte nedocumentat, 16 mega NU sunt
+suficienti pentru o statie desi peste tot se zice ca si 8 sunt ok, motiv
+pentru care e imperativ necesar sa se foloseasca swap-over-NFS care
+merge super bine (stiu ca majoritatea au o reticenta in a folosi
+swap/nfs, don't be shy, it rocks). Am mai adaugat 64 de ram pe NFS si
+acum rupe tovarashu' terminal, am load 2 la server si totul merge f
+bine.  
+Un 32 de MB sunt minim, 8/16 cat are sistemul + 32 e safe. 
+Sper ca observatia asta sa apara in viitoarea versiune a documentatiei
+ce vine cu LTSP, cel putin asa mi s-a promis.
+
+You've got yourself a happy smilin' motherfucker.
+
+Good fight, good night.
+
+Dragosh "smilin'" M.
+-- 
+I/O error while opening .signature file
+
+---
+Pentru dezabonare, trimiteti mail la 
+listar@lug.ro cu subiectul 'unsubscribe rlug'.
+REGULI, arhive si alte informatii: http://www.lug.ro/mlist/
+
+
+
+
+
+
diff --git a/examples/src/main/resources/mbox-example/mbox.rlug-0 b/examples/src/main/resources/mbox-example/mbox.rlug-0
new file mode 100644
index 0000000..af164e5
--- /dev/null
+++ b/examples/src/main/resources/mbox-example/mbox.rlug-0
@@ -0,0 +1,93 @@
+From: "mmihai" <mm...@netcompsj.ro>
+Subject: Din windows ma pot, din LINUX NU ma pot conecta (la ZAPP)
+Date: Fri, 7 Feb 2003 18:35:25 +0200
+Lines: 45
+Sender: rlug-bounce@lug.ro
+Message-ID: <00...@ok6f6gr01ta4hv>
+Reply-To: rlug@lug.ro
+Mime-Version: 1.0
+Content-Type: text/plain;
+	charset="iso-8859-2"
+Content-Transfer-Encoding: 7bit
+Return-path: <rl...@lug.ro>
+Received: from lug.lug.ro ([193.226.140.220])
+	by main.gmane.org with esmtp (Exim 3.35 #1 (Debian))
+	id 18hBoh-0007L5-00
+	for <go...@gmane.org>; Fri, 07 Feb 2003 17:57:31 +0100
+Received: from lug.lug.ro (localhost.localdomain [127.0.0.1])
+	by lug.lug.ro (Postfix) with ESMTP
+	id 70A5332D87; Fri,  7 Feb 2003 18:38:06 +0200 (EET)
+Received: with LISTAR (v0.129a; list rlug); Fri, 07 Feb 2003 18:38:05 +0200 (EET)
+Delivered-To: rlug@lug.ro
+Received: from ns.zappmobile.ro (ns.zapp.ro [80.96.151.2])
+	by lug.lug.ro (Postfix) with ESMTP id 2C3BD32CC7
+	for <rl...@lug.ro>; Fri,  7 Feb 2003 18:38:02 +0200 (EET)
+Received: from mail.zappmobile.ro (mail-server.zappmobile.ro [172.31.254.14])
+	by ns.zappmobile.ro (Postfix) with ESMTP id AFDC2490D
+	for <rl...@lug.ro>; Fri,  7 Feb 2003 18:37:48 +0200 (EET)
+Received: from localhost (localhost [127.0.0.1])
+	by mail.zappmobile.ro (Postfix) with ESMTP
+	id 994A6A0BB1; Fri,  7 Feb 2003 18:37:12 +0200 (EET)
+Received: from ok6f6gr01ta4hv (unknown [172.16.28.148])
+	by mail.zappmobile.ro (Postfix) with SMTP id 292599D67B
+	for <rl...@lug.ro>; Fri,  7 Feb 2003 18:37:09 +0200 (EET)
+To: <rl...@lug.ro>
+X-Priority: 3
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook Express 6.00.2600.0000
+X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
+X-Virus-Scanned: by AMaViS perl-11
+X-archive-position: 23608
+X-listar-version: Listar v0.129a
+Errors-To: rlug-bounce@lug.ro
+X-original-sender: mmihai@netcompsj.ro
+Precedence: bulk
+X-list: rlug
+
+Buna Ziua tuturor,
+
+Am o placa de baza, cu mare probabilitate J-542B, Chipset Ali M1542/M1543,
+Aladdin-V chipset.
+Vreau sa ma conectez la ZAPP, din Linux, pe portul USB
+Un lucru este absolut cert: portul exista si este functional intrucit ma pot
+conecta din XP.
+In Control Panel-ul din XP la "Sectiunea USB" scrie:
+ALI PCI to USB Open Host Controller
+USB Root Hub # Iar sistemul il asigneaza pe COM 4 !!??!!
+L-am lasat in pace ca de mers merge........
+
+Ies din Windows. Pe alta partitie este RH-8.0
+Ma duc in LINUX, RH-8.0, kernel-ul distributiei, nemodificat.
+Inserez modulele:
+1) modprobe usbcore # totul e OK
+2) modprobe usb-ohci # Sistemul imi spune:
+" usb.c: USB device 2 (vend/prod 0X678/0/2303) is not claimed by
+any actine driver.
+#si cele doua module sunt inserate.
+3) Instalez scriptul celor de la ZAPP ( install_hy.sh, e functional, la
+slujba lucreaza excelent)
+4) Incerc conectarea si dau comanda "zapp"
+Modific (de nervi) in /etc/ppp/peers/hyundai-zappmobile de la /dev/ttyUSB0
+pina la /dev/tty/USB4
+si nimic bun, in tail -f /var/log/messages imi zice:
+"Failed to open /dev/ttyUSB0 (#sau cit o fi): No such device.
+Am incercat si pe /dev/ttyS0.......3 si zice:
+Can't get terminal parameters: Input output error
+
+Va rog indrumati-ma si spuneti-mi ce sa fac ca sa lucreze ZAPP-ul  (si) in
+linux, (ca in windows e clar ca e OK ) ??
+
+Va multumesc
+
+
+
+
+---
+Pentru dezabonare, trimiteti mail la 
+listar@lug.ro cu subiectul 'unsubscribe rlug'.
+REGULI, arhive si alte informatii: http://www.lug.ro/mlist/
+
+
+
+
+
diff --git a/examples/src/main/resources/mbox-example/mbox.rlug-1 b/examples/src/main/resources/mbox-example/mbox.rlug-1
new file mode 100644
index 0000000..1aabe84
--- /dev/null
+++ b/examples/src/main/resources/mbox-example/mbox.rlug-1
@@ -0,0 +1,69 @@
+From: lonely wolf <wo...@pcnet.ro>
+Subject: Re: RH 8.0 boot floppy
+Date: Fri, 07 Feb 2003 19:21:04 +0200
+Lines: 27
+Sender: rlug-bounce@lug.ro
+Message-ID: <3E...@pcnet.ro>
+References: <3E...@myrealbox.com> <3E...@apsro.com> <3E...@myrealbox.com> <3E...@apsro.com>
+Reply-To: rlug@lug.ro
+Mime-Version: 1.0
+Content-Type: text/plain; charset=us-ascii; format=flowed
+Content-Transfer-Encoding: 7bit
+Return-path: <rl...@lug.ro>
+Received: from lug.lug.ro ([193.226.140.220])
+	by main.gmane.org with esmtp (Exim 3.35 #1 (Debian))
+	id 18hCBB-0001J4-00
+	for <go...@gmane.org>; Fri, 07 Feb 2003 18:20:45 +0100
+Received: from lug.lug.ro (localhost.localdomain [127.0.0.1])
+	by lug.lug.ro (Postfix) with ESMTP
+	id 63CDE32D58; Fri,  7 Feb 2003 19:21:17 +0200 (EET)
+Received: with LISTAR (v0.129a; list rlug); Fri, 07 Feb 2003 19:21:16 +0200 (EET)
+Delivered-To: rlug@lug.ro
+Received: from mail.nobugconsulting.ro (nobugconsulting.ro [213.157.160.38])
+	by lug.lug.ro (Postfix) with ESMTP id 4F31632CC7
+	for <rl...@lug.ro>; Fri,  7 Feb 2003 19:21:14 +0200 (EET)
+Received: from 127.0.0.1 (localhost.localdomain [127.0.0.1])
+	by buick.nobugconsulting.ro (Postfix) with SMTP id 146354EDCE
+	for <rl...@lug.ro>; Fri,  7 Feb 2003 19:21:04 +0200 (EET)
+Received: from pcnet.ro (unknown [192.168.1.2])
+	by mail.nobugconsulting.ro (Postfix) with ESMTP id DC16D4ED96
+	for <rl...@lug.ro>; Fri,  7 Feb 2003 19:21:03 +0200 (EET)
+User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01
+X-Accept-Language: en-us, fr, ro
+To: rlug@lug.ro
+X-archive-position: 23609
+X-listar-version: Listar v0.129a
+Errors-To: rlug-bounce@lug.ro
+X-original-sender: wolfy@pcnet.ro
+Precedence: bulk
+X-list: rlug
+
+Nicu Buculei wrote:
+> Daniel Pavel a scris, in 2/7/03 4:09 PM:
+> 
+>> :) nu _am_ CD-ul de instalare...  Imaginea am luat-o de pe un rh mirror.
+> 
+>                                     ^^^^^^^^
+> 
+> si ce ai facut cu imaginea ? nu ai tras-o pe cd ?
+> 
+
+ia cu incredere o discheta de 1.44 (sper ca macar floppy ai), scrie pe 
+ea bootnet.img copiat de pe net si apoi (multumindu-i in gind lui cioby) 
+zici asa:
+- linux rescue (la lilo prompt)
+- alegi ftp ca modalitate de lucru
+- ftp.ines.ro (server)
+- /pub/linux/distributions/redhat-8.0/ftpinstall (path catre distributie)
+
+
+
+---
+Pentru dezabonare, trimiteti mail la 
+listar@lug.ro cu subiectul 'unsubscribe rlug'.
+REGULI, arhive si alte informatii: http://www.lug.ro/mlist/
+
+
+
+
+
diff --git a/examples/src/main/resources/mbox-example/mbox.rlug-2 b/examples/src/main/resources/mbox-example/mbox.rlug-2
new file mode 100644
index 0000000..26ea560
--- /dev/null
+++ b/examples/src/main/resources/mbox-example/mbox.rlug-2
@@ -0,0 +1,50 @@
+From: Adrian Rapa <ad...@dtedu.net>
+Subject: Qmail mysql virtualusers +ssl + smtp auth +pop3
+Date: Fri, 7 Feb 2003 19:36:01 +0200
+Organization: Asociatia Studenteasca a Retelelor din Drumul Taberei
+Lines: 12
+Sender: rlug-bounce@lug.ro
+Message-ID: <20...@dtedu.net>
+Reply-To: rlug@lug.ro
+Mime-Version: 1.0
+Content-Type: text/plain; charset=US-ASCII
+Content-Transfer-Encoding: 7bit
+Return-path: <rl...@lug.ro>
+Received: from lug.lug.ro ([193.226.140.220])
+	by main.gmane.org with esmtp (Exim 3.35 #1 (Debian))
+	id 18hCPk-0002ZW-00
+	for <go...@gmane.org>; Fri, 07 Feb 2003 18:35:48 +0100
+Received: from lug.lug.ro (localhost.localdomain [127.0.0.1])
+	by lug.lug.ro (Postfix) with ESMTP
+	id DC08032D8E; Fri,  7 Feb 2003 19:36:21 +0200 (EET)
+Received: with LISTAR (v0.129a; list rlug); Fri, 07 Feb 2003 19:36:20 +0200 (EET)
+Delivered-To: rlug@lug.ro
+Received: from www.dtedu.net (tabara.imago.ro [193.254.242.5])
+	by lug.lug.ro (Postfix) with SMTP id 3794D32CC7
+	for <rl...@lug.ro>; Fri,  7 Feb 2003 19:36:17 +0200 (EET)
+Received: (qmail 10170 invoked from network); 7 Feb 2003 17:36:02 -0000
+Received: from games.tabara.net (HELO games) (10.39.2.5)
+  by tabara.imago.ro with SMTP; 7 Feb 2003 17:36:02 -0000
+To: rlug@lug.ro
+X-Mailer: Sylpheed version 0.8.9 (GTK+ 1.2.10; i686-pc-linux-gnu)
+X-archive-position: 23610
+X-listar-version: Listar v0.129a
+Errors-To: rlug-bounce@lug.ro
+X-original-sender: adrian@dtedu.net
+Precedence: bulk
+X-list: rlug
+
+Salut,
+poate cineva sa imi dea combinatia aceasta? am incercat sa pun patchurile dar dadeau erori
+
+
+Adrian Rapa
+---
+Pentru dezabonare, trimiteti mail la 
+listar@lug.ro cu subiectul 'unsubscribe rlug'.
+REGULI, arhive si alte informatii: http://www.lug.ro/mlist/
+
+
+
+
+
diff --git a/examples/src/main/resources/mbox-example/mbox.rlug-3 b/examples/src/main/resources/mbox-example/mbox.rlug-3
new file mode 100644
index 0000000..6cac1ce
--- /dev/null
+++ b/examples/src/main/resources/mbox-example/mbox.rlug-3
@@ -0,0 +1,64 @@
+From: teo.55@home.ro
+Subject: Re: Din windows ma pot, din LINUX NU ma pot conecta (la ZAPP)
+Date: Sat, 8 Feb 2003 01:41:31 +0200
+Lines: 25
+Sender: rlug-bounce@lug.ro
+Message-ID: <20...@home.ro>
+References: <00...@ok6f6gr01ta4hv>
+Reply-To: rlug@lug.ro
+Mime-Version: 1.0
+Content-Type: text/plain; charset=US-ASCII
+Content-Transfer-Encoding: 7bit
+Return-path: <rl...@lug.ro>
+Received: from lug.lug.ro ([193.226.140.220])
+	by main.gmane.org with esmtp (Exim 3.35 #1 (Debian))
+	id 18hI9b-0003OX-00
+	for <go...@gmane.org>; Sat, 08 Feb 2003 00:43:31 +0100
+Received: from lug.lug.ro (localhost.localdomain [127.0.0.1])
+	by lug.lug.ro (Postfix) with ESMTP
+	id 6064032D4F; Sat,  8 Feb 2003 01:44:08 +0200 (EET)
+Received: with LISTAR (v0.129a; list rlug); Sat, 08 Feb 2003 01:44:07 +0200 (EET)
+Delivered-To: rlug@lug.ro
+Received: from s1.home.ro (home.rdsnet.ro [193.231.236.40])
+	by lug.lug.ro (Postfix) with SMTP id 0EEE832D02
+	for <rl...@lug.ro>; Sat,  8 Feb 2003 01:44:05 +0200 (EET)
+Received: (qmail 3538 invoked from network); 7 Feb 2003 23:37:23 -0000
+Received: from unknown (HELO linbox) (213.233.108.98)
+  by s1.home.ro with SMTP; 7 Feb 2003 23:37:23 -0000
+To: rlug@lug.ro
+In-Reply-To: <00...@ok6f6gr01ta4hv>
+X-Mailer: Sylpheed version 0.8.6 (GTK+ 1.2.10; i686-pc-linux-gnu)
+X-archive-position: 23611
+X-listar-version: Listar v0.129a
+Errors-To: rlug-bounce@lug.ro
+X-original-sender: teo.55@home.ro
+Precedence: bulk
+X-list: rlug
+
+On Fri, 7 Feb 2003 18:35:25 +0200
+"mmihai" <mm...@netcompsj.ro> wrote:
+
+> Buna Ziua tuturor,
+> 
+> Am o placa de baza, cu mare probabilitate J-542B, Chipset Ali
+> M1542/M1543, Aladdin-V chipset.
+> Vreau sa ma conectez la ZAPP, din Linux, pe portul USB
+> Un lucru este absolut cert: portul exista si este functional intrucit
+> ma pot conecta din XP.
+> In Control Panel-ul din XP la "Sectiunea USB" scrie:
+> 
+pl2303.o ?
+ai modulul pentru cipul ala de pe cablu ?
+compileaza, insereaza, bla...
+apoi merge
+
+
+---
+Pentru dezabonare, trimiteti mail la 
+listar@lug.ro cu subiectul 'unsubscribe rlug'.
+REGULI, arhive si alte informatii: http://www.lug.ro/mlist/
+
+
+
+
+
diff --git a/examples/src/main/resources/mbox-example/mbox.rlug-4 b/examples/src/main/resources/mbox-example/mbox.rlug-4
new file mode 100644
index 0000000..9e3668d
--- /dev/null
+++ b/examples/src/main/resources/mbox-example/mbox.rlug-4
@@ -0,0 +1,65 @@
+From: "Dragosh M." <dr...@lsd.ro>
+Subject: LSTP problem - solved
+Date: 08 Feb 2003 01:58:32 +0200
+Lines: 27
+Sender: rlug-bounce@lug.ro
+Message-ID: <10...@snow.lsd.ro>
+Reply-To: rlug@lug.ro
+Mime-Version: 1.0
+Content-Type: text/plain
+Content-Transfer-Encoding: 7bit
+Return-path: <rl...@lug.ro>
+Received: from lug.lug.ro ([193.226.140.220])
+	by main.gmane.org with esmtp (Exim 3.35 #1 (Debian))
+	id 18hIID-0003pf-00
+	for <go...@gmane.org>; Sat, 08 Feb 2003 00:52:25 +0100
+Received: from lug.lug.ro (localhost.localdomain [127.0.0.1])
+	by lug.lug.ro (Postfix) with ESMTP
+	id 461C532D55; Sat,  8 Feb 2003 01:53:03 +0200 (EET)
+Received: with LISTAR (v0.129a; list rlug); Sat, 08 Feb 2003 01:53:02 +0200 (EET)
+Delivered-To: rlug@lug.ro
+Received: from rdsnet.ro (mail.rdsnet.ro [193.231.236.16])
+	by lug.lug.ro (Postfix) with SMTP id F315032D02
+	for <rl...@lug.ro>; Sat,  8 Feb 2003 01:52:59 +0200 (EET)
+Received: (qmail 5162 invoked from network); 7 Feb 2003 23:52:49 -0000
+Received: from unknown (HELO snow.lsd.ro) (81.196.12.127)
+  by mail.rdsnet.ro with SMTP; 7 Feb 2003 23:52:49 -0000
+To: rlug@lug.ro
+X-Mailer: Ximian Evolution 1.0.8 (1.0.8-10) 
+X-archive-position: 23612
+X-listar-version: Listar v0.129a
+Errors-To: rlug-bounce@lug.ro
+X-original-sender: dragosh@lsd.ro
+Precedence: bulk
+X-list: rlug
+
+In sfarsit am rezolvat crapu, cu ajutorul lui James McQuillan (taticul
+LTSP). E foarte simplu si foarte nedocumentat, 16 mega NU sunt
+suficienti pentru o statie desi peste tot se zice ca si 8 sunt ok, motiv
+pentru care e imperativ necesar sa se foloseasca swap-over-NFS care
+merge super bine (stiu ca majoritatea au o reticenta in a folosi
+swap/nfs, don't be shy, it rocks). Am mai adaugat 64 de ram pe NFS si
+acum rupe tovarashu' terminal, am load 2 la server si totul merge f
+bine.  
+Un 32 de MB sunt minim, 8/16 cat are sistemul + 32 e safe. 
+Sper ca observatia asta sa apara in viitoarea versiune a documentatiei
+ce vine cu LTSP, cel putin asa mi s-a promis.
+
+You've got yourself a happy smilin' motherfucker.
+
+Good fight, good night.
+
+Dragosh "smilin'" M.
+-- 
+I/O error while opening .signature file
+
+---
+Pentru dezabonare, trimiteti mail la 
+listar@lug.ro cu subiectul 'unsubscribe rlug'.
+REGULI, arhive si alte informatii: http://www.lug.ro/mlist/
+
+
+
+
+
+

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-mime4j] 05/08: [EXAMPLES] Link github and sit examples from the Mime4J index

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-mime4j.git

commit eebe5a5a89134b696fb4ce01fc6003e9be39469d
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Jun 24 14:46:50 2021 +0700

    [EXAMPLES] Link github and sit examples from the Mime4J index
    
    This makes discovering the examples easier.
---
 src/site/xdoc/index.xml | 46 ++++++++++++++++++++++++++++------------------
 1 file changed, 28 insertions(+), 18 deletions(-)

diff --git a/src/site/xdoc/index.xml b/src/site/xdoc/index.xml
index c25ba1f..930cb2a 100644
--- a/src/site/xdoc/index.xml
+++ b/src/site/xdoc/index.xml
@@ -1,23 +1,23 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <!-- 
-/****************************************************************
- * 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.                                           *
- ****************************************************************/
+/****************************************************************
+ * 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.                                           *
+ ****************************************************************/
 
  -->
 <document>
@@ -66,5 +66,15 @@
                 representation constructed by the JavaMail API:s but is more
                 tolerant to messages violating the standards. </p>
         </section>
+        <section name="Examples">
+            <p>
+                As part of our git repository we provide a couple of
+                <a href="https://github.com/apache/james-mime4j/tree/master/examples">
+                examples</a> to ease the use of MIME4J.
+            </p>
+            <p>
+                Read the following <a href="samples.html">page</a>.
+            </p>
+        </section>
     </body>
 </document>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-mime4j] 03/08: [EXAMPLES] Migrate away from MessageBuilder

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-mime4j.git

commit 58bfaaa9c25f38d510915dbe3b4763687fd49a88
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Jun 24 14:35:42 2021 +0700

    [EXAMPLES] Migrate away from MessageBuilder
---
 .../org/apache/james/mime4j/samples/dom/MultipartMessage.java    | 2 +-
 .../org/apache/james/mime4j/samples/dom/TextPlainMessage.java    | 2 +-
 .../apache/james/mime4j/samples/transform/TransformMessage.java  | 9 +++------
 3 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/examples/src/main/java/org/apache/james/mime4j/samples/dom/MultipartMessage.java b/examples/src/main/java/org/apache/james/mime4j/samples/dom/MultipartMessage.java
index 298074b..d8b2fc2 100644
--- a/examples/src/main/java/org/apache/james/mime4j/samples/dom/MultipartMessage.java
+++ b/examples/src/main/java/org/apache/james/mime4j/samples/dom/MultipartMessage.java
@@ -50,7 +50,7 @@ public class MultipartMessage {
     public static void main(String[] args) throws Exception {
         // 1) start with an empty message
         StorageBodyFactory bodyFactory = new StorageBodyFactory();
-        Message message = MessageBuilder.create()
+        Message message = Message.Builder.of()
         // 2) set header fields
         //    Date and From are required fields
         //    Message-ID should be present
diff --git a/examples/src/main/java/org/apache/james/mime4j/samples/dom/TextPlainMessage.java b/examples/src/main/java/org/apache/james/mime4j/samples/dom/TextPlainMessage.java
index 22c4880..1683bd2 100644
--- a/examples/src/main/java/org/apache/james/mime4j/samples/dom/TextPlainMessage.java
+++ b/examples/src/main/java/org/apache/james/mime4j/samples/dom/TextPlainMessage.java
@@ -35,7 +35,7 @@ import org.apache.james.mime4j.message.MessageBuilder;
 public class TextPlainMessage {
     public static void main(String[] args) throws Exception {
         // 1) start with an empty message
-        Message message = MessageBuilder.create()
+        Message message = Message.Builder.of()
         // 2) set header fields
         //    Date and From are required fields
         //    Message-ID should be present
diff --git a/examples/src/main/java/org/apache/james/mime4j/samples/transform/TransformMessage.java b/examples/src/main/java/org/apache/james/mime4j/samples/transform/TransformMessage.java
index 996aeaf..d5c591e 100644
--- a/examples/src/main/java/org/apache/james/mime4j/samples/transform/TransformMessage.java
+++ b/examples/src/main/java/org/apache/james/mime4j/samples/transform/TransformMessage.java
@@ -19,7 +19,6 @@
 
 package org.apache.james.mime4j.samples.transform;
 
-import java.io.IOException;
 import java.util.Date;
 import java.util.Random;
 
@@ -32,7 +31,6 @@ import org.apache.james.mime4j.dom.Multipart;
 import org.apache.james.mime4j.message.BodyPart;
 import org.apache.james.mime4j.message.BodyPartBuilder;
 import org.apache.james.mime4j.message.DefaultMessageWriter;
-import org.apache.james.mime4j.message.MessageBuilder;
 import org.apache.james.mime4j.message.MultipartBuilder;
 import org.apache.james.mime4j.storage.StorageBodyFactory;
 import org.apache.james.mime4j.storage.StorageProvider;
@@ -56,7 +54,7 @@ public class TransformMessage {
         // Create a template message. It would be possible to load a message
         // from an input stream but for this example a message object is created
         // from scratch for demonstration purposes.
-        Message template = MessageBuilder.create()
+        Message template = Message.Builder.of()
                 .setBody(MultipartBuilder.create("mixed")
                         .addBodyPart(BodyPartBuilder.create()
                                 .use(bodyFactory)
@@ -80,7 +78,7 @@ public class TransformMessage {
         // Create a new message by transforming the template.
         // Create a copy of the template. The copy can be modified without
         // affecting the original.
-        final MessageBuilder messageBuilder = MessageBuilder.createCopy(template);
+        final Message.Builder messageBuilder = Message.Builder.of(template);
         // In this example we know we have a multipart message. Use
         // Message#isMultipart() if uncertain.
         Multipart multipart = (Multipart) messageBuilder.getBody();
@@ -137,8 +135,7 @@ public class TransformMessage {
         // messages and body parts have been disposed of properly.
     }
 
-    private static byte[] createRandomBinary(int numberOfBytes)
-            throws IOException {
+    private static byte[] createRandomBinary(int numberOfBytes) {
         byte[] data = new byte[numberOfBytes];
         new Random().nextBytes(data);
         return data;

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-mime4j] 08/08: [EXAMPLES] RAT exceptions for newly added example resources

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-mime4j.git

commit 3aa29d376e6d80ba82e9eccf3a323f3b3b1316d3
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Jun 24 17:00:46 2021 +0700

    [EXAMPLES] RAT exceptions for newly added example resources
---
 pom.xml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/pom.xml b/pom.xml
index 143c76e..87f2322 100644
--- a/pom.xml
+++ b/pom.xml
@@ -173,6 +173,8 @@
                                 <exclude>**/test/resources/mimetools-testmsgs/*</exclude>
                                 <exclude>**/test/resources/test-1/*</exclude>
                                 <exclude>**/test/resources/*.msg</exclude>
+                                <exclude>**/main/resources/*.msg</exclude>
+                                <exclude>**/main/resources/mbox-example/*</exclude>
                                 <!-- Generated by Maven -->
                                 <exclude>release.properties</exclude>
                                 <exclude>dist/**/*</exclude>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-mime4j] 01/08: [EXAMPLES] MessageTree should be easy to launch from an IDE

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-mime4j.git

commit 6d2e66423fa50fec84b4684ed94819ffd18bab31
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Jun 24 14:34:31 2021 +0700

    [EXAMPLES] MessageTree should be easy to launch from an IDE
    
    We can default to a local resource if no argument is provided.
---
 .../james/mime4j/samples/tree/MessageTree.java     | 16 ++++++--
 examples/src/main/resources/mime-example.msg       | 43 ++++++++++++++++++++++
 2 files changed, 55 insertions(+), 4 deletions(-)

diff --git a/examples/src/main/java/org/apache/james/mime4j/samples/tree/MessageTree.java b/examples/src/main/java/org/apache/james/mime4j/samples/tree/MessageTree.java
index 17bd138..9cd7fd2 100644
--- a/examples/src/main/java/org/apache/james/mime4j/samples/tree/MessageTree.java
+++ b/examples/src/main/java/org/apache/james/mime4j/samples/tree/MessageTree.java
@@ -362,9 +362,10 @@ public class MessageTree extends JPanel implements TreeSelectionListener {
     }
 
     public static void main(String[] args) {
+        final String fileName = retrieveFileName(args);
         try {
             final MessageBuilder builder = new DefaultMessageBuilder();
-            final Message message = builder.parseMessage(new FileInputStream(args[0]));
+            final Message message = builder.parseMessage(new FileInputStream(fileName));
 
             javax.swing.SwingUtilities.invokeLater(new Runnable() {
                 public void run() {
@@ -377,12 +378,19 @@ public class MessageTree extends JPanel implements TreeSelectionListener {
             System.err.println("Usage: org.mime4j.samples.tree.MessageTree"
                              + " path/to/message");
         } catch (FileNotFoundException e) {
-            System.err.println("The file '" + args[0] + "' could not be found.");
+            System.err.println("The file '" + fileName + "' could not be found.");
         } catch (IOException e) {
-            System.err.println("The file '" + args[0] + "' could not be read.");
+            System.err.println("The file '" + fileName + "' could not be read.");
         } catch (MimeException e) {
-            System.err.println("The file '" + args[0] + "' is invalid.");
+            System.err.println("The file '" + fileName + "' is invalid.");
         }
     }
 
+    private static String retrieveFileName(String[] args) {
+        if (args.length < 1) {
+            return ClassLoader.getSystemResource("mime-example.msg").getFile();
+        }
+        return args[0];
+    }
+
 }
diff --git a/examples/src/main/resources/mime-example.msg b/examples/src/main/resources/mime-example.msg
new file mode 100644
index 0000000..5ee0dd5
--- /dev/null
+++ b/examples/src/main/resources/mime-example.msg
@@ -0,0 +1,43 @@
+Date: Fri, 27 Apr 2007 16:08:23 +0200
+From: Foo Bar <ba...@example.com>
+MIME-Version: 1.0
+To:  foo@example.com
+Subject: Here is the attachment I was waiting for.
+Content-Type: multipart/mixed;
+ boundary="------------090404080405080108000909"
+
+This is a multi-part message in MIME format.
+--------------090404080405080108000909
+Content-Type: text/plain; charset=ISO-8859-15
+Content-Transfer-Encoding: 7bit
+
+Body.
+
+--------------090404080405080108000909
+Content-Type: application/octet-stream;
+ name="data.bin"
+Content-Transfer-Encoding: base64
+Content-Disposition: attachment;
+ filename="data.bin"
+
+lLzmyQjBC2gw/hiUrcy/DDI5K6CBqFSs4NKCF67G5XBzOnSInWpZ+9Uv9IxFpz8rf871xAE+
++y0ZYES9LXDdP12svxsJ4hRsekH2HJ953Kglb3hxko7LlPlxeDX15FKH0VBE8Ggr4RbwoP+c
+mkyyhKyaiV95ycRzRd5ozVDGhmW/eQIZgw3nYJOt99vyPxolkHD8PLevmx4PTteIO4hIWjHG
+XtKCTNwBG0z4cW3EOHWxsvo5v6JUEueDaxfFWKrA/MWP2TkYREXMj+q0XC4MpKZgIjqRL/9E
+s6gqpJTb4eyYL6FBdgrNeLqDQ5ozgu1zaQi9+yuoCABIHKCEPv32W+9Wt/MjMqCnKdk+Zdsw
+ZBna0Fq/168oqKh0S++trpgndHvWZWojNY+rDqnl5o3T9IvTgTuG8IHPSxUODbWFy1vim+jU
+eGNpCfko6DGo5oBCKzg5BTlz2kAED6F1X6/a+w0/9zGJZJ9Tyg6fb8LE7OwDFp1pH99x6SgR
+xa+IFHoXhbjRzkRi/ZRZKrqm4jxvhFTXlx9w70SL0GawHUwuNOgEUKJM75ADmDEEtRB0pQ8S
+RPoKn/b1RLGQPsvHzcqtSJljgbMMBmoiBFkAnzopnVn1RJfBzI6x9YcXtNqtJCTXdHzPg4D+
+WhwkCB0AF7W8EoVqvmlP2g0vAdPz4gR8+I6AFdGQtC52CMhX/1mHAeTjDCnuvTzZvKrACcVB
+9Ea12w10KLYbsgAr2+2vfAdiLUdUZDKHPPtWC+lSrvkTJtivU+YOSw7PCkWF7BIC7pTdp7Wu
+tqGCmVo0eHKfJxXcpkH++9ALeAQ8tfQw9K20JJW18fSAw/hs8fxs5FWjhNpYpUvQlqznN98K
+/pnaXQo373NufYHy1+yT3sSVEwBbClv7yOjrYrmyRe6ojw+ZxXziWk8r+VkFpotwvgW41vOu
+vkhd94rzr1Mj7WNEssTrJOQC5Uda2DPZkHgxBbZch2ru65Jmivr493iTF157c6MZhJUSW+P5
+Xd+WoDrUwzcpMx7QdyZaNSPVsL7uD4xOKoqm4OcdyzEj4qqDvBLA0TJ8sQ4Fp0A5h7nNTuoU
+vxKMan0J4rRKc7T4eswuLEaTPCDtKpsmlTS+rG4jPaCOlPM++qrI6VMgJBZOL/zG7mLub/IY
+KmU6Svelyk91XQF23dhbSqlLjeLlGjwtlHhqRuFASVIgIqcxbsrxa6CSmTrHmxr0NU5hmEWb
+lBPvZwYZhZMu2c/yTirvknIijyTRjFmgwpB73uJHv0oQotC6myXTGNCc0MihBMOsDQs3Fhsl
+JFQcH6VA0bze/FSZoGi+sM90lyrufQngenV1EVptFBx5DQYWEWXKOi2ZS6JQGYRh1R+EXA==
+--------------090404080405080108000909--
+

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-mime4j] 06/08: [EXAMPLES] Fix a typo in NAV panel

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-mime4j.git

commit b3e1e27ce714055a404bb772ccc12cfda920fff1
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Jun 24 14:47:15 2021 +0700

    [EXAMPLES] Fix a typo in NAV panel
    
    We have several examples...
---
 src/site/site.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/site/site.xml b/src/site/site.xml
index 7549182..b87dec5 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -68,7 +68,7 @@
         <menu name="MIME4J">
             <item name="Overview" href="/index.html"/>
             <item name="Status" href="/status.html"/>
-            <item name="Example" href="/samples.html"/>
+            <item name="Examples" href="/samples.html"/>
             <item name="Usage" href="/usage.html"/>
             <item name="Mailing List" href="http://james.apache.org/mail.html#Mime4j" />
             <item name="Javadoc" href="/apidocs/index.html" />

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-mime4j] 04/08: [EXAMPLES] Add an example for parsing messages

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-mime4j.git

commit 598c3d71c9bbd15e72052f05656499bc2913bf47
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Jun 24 14:35:59 2021 +0700

    [EXAMPLES] Add an example for parsing messages
---
 .../james/mime4j/samples/dom/ParsingMessage.java   | 57 ++++++++++++++++++++++
 1 file changed, 57 insertions(+)

diff --git a/examples/src/main/java/org/apache/james/mime4j/samples/dom/ParsingMessage.java b/examples/src/main/java/org/apache/james/mime4j/samples/dom/ParsingMessage.java
new file mode 100644
index 0000000..324ae66
--- /dev/null
+++ b/examples/src/main/java/org/apache/james/mime4j/samples/dom/ParsingMessage.java
@@ -0,0 +1,57 @@
+/****************************************************************
+ * 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.                                           *
+ ****************************************************************/
+
+package org.apache.james.mime4j.samples.dom;
+
+import java.io.ByteArrayInputStream;
+import java.nio.charset.StandardCharsets;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.james.mime4j.dom.Message;
+import org.apache.james.mime4j.dom.TextBody;
+import org.apache.james.mime4j.message.DefaultMessageBuilder;
+import org.apache.james.mime4j.stream.MimeConfig;
+
+public class ParsingMessage {
+    private static String MESSAGE = "MIME-Version: 1.0\r\n" +
+        "From: John Doe <jd...@machine.example>\r\n" +
+        "To: Mary Smith <ma...@example.net>\r\n" +
+        "Subject: Saying Hello\r\n" +
+        "Date: Thu, 24 Jun 2021 14:04:28 +0700\r\n" +
+        "Message-ID:\r\n" +
+        " <Mi...@interview1-HP-ProBook-440-G6>\r\n" +
+        "Content-Type: text/plain; charset=ISO-8859-1\r\n" +
+        "\r\n" +
+        "This is a message just to say hello.\r\n" +
+        "So, \"Hello\".\r\n";
+
+    public static void main(String[] args) throws Exception {
+        DefaultMessageBuilder defaultMessageBuilder = new DefaultMessageBuilder();
+        defaultMessageBuilder.setMimeEntityConfig(MimeConfig.PERMISSIVE);
+
+        Message message = defaultMessageBuilder.parseMessage(new ByteArrayInputStream(MESSAGE.getBytes(StandardCharsets.UTF_8)));
+
+        System.out.println("The subject is " + message.getSubject());
+
+        TextBody textBody = (TextBody) message.getBody();
+        System.out.println("------------------------------");
+        System.out.println("Content: " + IOUtils.toString(textBody.getInputStream(), textBody.getMimeCharset()));
+        System.out.println("------------------------------");
+    }
+}

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-mime4j] 07/08: [EXAMPLES] Github links for examples

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-mime4j.git

commit 38864197be1f6d5c0501970b585b8b7816743f4d
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Jun 24 14:48:40 2021 +0700

    [EXAMPLES] Github links for examples
    
     - One can then easily find them without
     requiring to clone the repository
     - Mention explaining they could easily be
     launched from within an IDE
     - Also, I added the new `Parsing` example.
---
 src/site/xdoc/samples.xml | 58 ++++++++++++++++++++++-------------------------
 1 file changed, 27 insertions(+), 31 deletions(-)

diff --git a/src/site/xdoc/samples.xml b/src/site/xdoc/samples.xml
index ebf1371..fcbb68d 100755
--- a/src/site/xdoc/samples.xml
+++ b/src/site/xdoc/samples.xml
@@ -1,23 +1,23 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <!-- 
-/****************************************************************
- * 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.                                           *
- ****************************************************************/
+/****************************************************************
+ * 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.                                           *
+ ****************************************************************/
 
  -->
 <document>
@@ -27,12 +27,13 @@
     <body>
         <section name="Samples">
             <p>
-            The Mime4j distribution includes samples
+            The Mime4j distribution includes <a href="https://github.com/apache/james-mime4j/tree/master/examples">examples</a>
             which demonstrate how the library could be used. This section
             gives you a short review of those samples. For more information
             you should download the distribution and study the sample sources.
             The samples are in the <code>examples/</code> sub-directory.
             </p>
+            <p>Each one of these examples can be run easily from an IDE.</p>
             <table>
                     <tr>
                         <th>Sample</th>
@@ -41,6 +42,7 @@
                     <tr>
                         <td>
                             <code>org.apache.james.mime4j.samples.tree.MessageTree</code>
+                            <a href="https://github.com/apache/james-mime4j/tree/master/examples/src/main/java/org/apache/james/mime4j/samples/tree.MessageTree.java">org.apache.james.mime4j.samples.tree.MessageTree</a>
                         </td>
                         <td>Displays a tree of the contents of a
                             Mime4j <code>Message</code> object in a Swing GUI.
@@ -54,7 +56,7 @@
                     </tr>
                     <tr>
                         <td>
-                            <code>org.apache.james.mime4j.samples.transform.TransformMessage</code>
+                            <a href="https://github.com/apache/james-mime4j/tree/master/examples/src/main/java/org/apache/james/mime4j/samples/transform/TransformMessage.java">org.apache.james.mime4j.samples.transform.TransformMessage</a>
                         </td>
                         <td>Illustrate how to transform a message into another message without 
                             modifying the original.
@@ -62,7 +64,7 @@
                     </tr>
                     <tr>
                         <td>
-                            <code>org.apache.james.mime4j.samples.dom.TextPlainMessage</code>
+                            <a href="https://github.com/apache/james-mime4j/tree/master/examples/src/main/java/org/apache/james/mime4j/samples/dom/TextPlainMessage.java">org.apache.james.mime4j.samples.dom.TextPlainMessage</a>
                         </td>
                         <td>Illustrate the use of Mime4j DOM API. This example generates a message 
                         very similar to the one from 
@@ -72,7 +74,7 @@
                     </tr>
                     <tr>
                         <td>
-                            <code>org.apache.james.mime4j.samples.dom.MultipartMessage</code>
+                            <a href="https://github.com/apache/james-mime4j/tree/master/examples/src/main/java/org/apache/james/mime4j/samples/dom/MultipartMessage.java">org.apache.james.mime4j.samples.dom.MultipartMessage</a>
                         </td>
                         <td>Illustrate the use of Mime4j DOM API. This example creates a
                             multipart/mixed message that consists of a text/plain and an image/png
@@ -80,18 +82,12 @@
                             to create PDF or XML attachments, for example.
                         </td>
                     </tr>
-               <!--      <tr>
-                        <td>
-                            <code>org.apache.james.mime4j.samples.sax.Mime2Sax</code>
-                        </td>
-                        <td></td>
-                    </tr>
                     <tr>
                         <td>
-                            <code>org.apache.james.mime4j.samples.pgp.PGPSignatureVerifier</code>
+                            <a href="https://github.com/apache/james-mime4j/tree/master/examples/src/main/java/org/apache/james/mime4j/samples/dom/ParsingMessage.java">org.apache.james.mime4j.samples.dom.ParsingMessage</a>
                         </td>
-                        <td></td>
-                    </tr> -->
+                        <td>Illustrate the use of Mime4j DOM API in order to parse messages.</td>
+                    </tr>
                 </table>
         </section>
     </body>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org