Class SMTPFetcher

  extended by org.mmbase.module.smtp.MailFetcher
      extended by org.mmbase.module.smtp.SMTPFetcher
All Implemented Interfaces:

public class SMTPFetcher
extends MailFetcher
implements Runnable

Listener thread, that accepts connection on port 25 (default) and delegates all work to its worker threads. It is a minimum implementation, it only implements commands listed in section 4.5.1 of RFC 2821.

How are multiparts dispatched to mmbase objects?

If the mimetype of the message itself is not multipart, then the message can simply be stored in a object of the type 'emails'. The mime-type of the mail can be sotred in the mime-type field of the message.

If the mimetype of the orignal message is multipart/alternative, then only the 'best' part is stored in the mmbase email node. Currently only text/plain and text/html alternatives are recognized. text/html is supposed to be better.

If the mimetype of the orignal message is multipart/mixed, then the INLINE part can be stored in the object. If no disposition given on a part, then it is considered INLINE if text/*. If the disposition if ATTACHMENT, then those are stored as related attachment-objects.

TODO: What happens which attached mail-messages? Will those not cause a big mess?

$Id: 35335 2009-05-21 08:14:41Z michiel $
Johannes Verelst <>

Nested Class Summary
(package private) static class SMTPFetcher.State
Constructor Summary
SMTPFetcher(Socket socket, Map<String,String> properties)
          Public constructor.
Method Summary
static int getMaxAttachmentSize(Map<String,String> properties)
protected  Map<String,String> getProperties()
 List<MailHandler.Address> getRecipients()
 MailHandler.Address getSender()
 void interrupt()
          Interrupt method, is called only during shutdown
 void run()
          The main run method of this thread.
Methods inherited from class org.mmbase.module.smtp.MailFetcher
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public SMTPFetcher(Socket socket,
                   Map<String,String> properties)
Public constructor. Set all data that is needed for this thread to run.

Method Detail


public MailHandler.Address getSender()


public List<MailHandler.Address> getRecipients()


protected Map<String,String> getProperties()


public void run()
The main run method of this thread. It will read data from the given socket line by line, and it will call the parser for this data.

Specified by:
run in interface Runnable


public static int getMaxAttachmentSize(Map<String,String> properties)


public void interrupt()
Interrupt method, is called only during shutdown

MMBase 2.0-SNAPSHOT - null