org.mmbase.module.smtp
Class SMTPFetcher

java.lang.Object
  extended by org.mmbase.module.smtp.MailFetcher
      extended by org.mmbase.module.smtp.SMTPFetcher
All Implemented Interfaces:
Runnable

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?

Version:
$Id: SMTPFetcher.java 35335 2009-05-21 08:14:41Z michiel $
Author:
Johannes Verelst <johannes.verelst@eo.nl>

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
getHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SMTPFetcher

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

Method Detail

getSender

public MailHandler.Address getSender()

getRecipients

public List<MailHandler.Address> getRecipients()

getProperties

protected Map<String,String> getProperties()

run

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

getMaxAttachmentSize

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

interrupt

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



MMBase 2.0-SNAPSHOT - null