org.apache.james.transport.mailets
Class UseHeaderRecipients

java.lang.Object
  extended by org.apache.mailet.base.GenericMailet
      extended by org.apache.james.transport.mailets.UseHeaderRecipients
All Implemented Interfaces:
Mailet, MailetConfig

public class UseHeaderRecipients
extends GenericMailet

Mailet designed to process the recipients from the mail headers rather than the recipients specified in the SMTP message header. This can be useful if your mail is redirected on-route by a mail server that substitutes a fixed recipient address for the original.

To use this, match against the redirection address using the RecipientIs matcher and set the mailet 'class' to UseHeaderRecipients. This will cause the email to be re-injected into the root process with the recipient substituted by all the recipients in the Mail-For, To and Cc headers of the message.

e.g.


    <mailet match="RecipientIs=forwarded@myhost"
            class="UseHeaderRecipients">
    </mailet>
 

Version:
1.0.0, 24/11/2000

Constructor Summary
UseHeaderRecipients()
           
 
Method Summary
 java.lang.String getMailetInfo()
          Return a string describing this mailet.
 void init()
          Initialize the mailet initializes the DEBUG flag
 void service(Mail mail)
          Process an incoming email, removing the currently identified recipients and replacing them with the recipients indicated in the Mail-For, To and Cc headers of the actual email.
 
Methods inherited from class org.apache.mailet.base.GenericMailet
arrayToString, checkInitParameters, destroy, getInitParameter, getInitParameter, getInitParameter, getInitParameterNames, getMailetConfig, getMailetContext, getMailetName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UseHeaderRecipients

public UseHeaderRecipients()
Method Detail

init

public void init()
Initialize the mailet initializes the DEBUG flag

Overrides:
init in class GenericMailet

service

public void service(Mail mail)
             throws javax.mail.MessagingException
Process an incoming email, removing the currently identified recipients and replacing them with the recipients indicated in the Mail-For, To and Cc headers of the actual email.

Specified by:
service in interface Mailet
Specified by:
service in class GenericMailet
Parameters:
mail - incoming email
Throws:
javax.mail.MessagingException

getMailetInfo

public java.lang.String getMailetInfo()
Return a string describing this mailet.

Specified by:
getMailetInfo in interface Mailet
Overrides:
getMailetInfo in class GenericMailet
Returns:
a string describing this mailet


Copyright © 2008-2009 The Apache Software Foundation. All Rights Reserved.