org.apache.james.protocols.smtp.hook
Class SimpleHook

java.lang.Object
  extended by org.apache.james.protocols.smtp.hook.SimpleHook
All Implemented Interfaces:
ProtocolHandler, HeloHook, Hook, MailHook, MessageHook, RcptHook

public class SimpleHook
extends Object
implements HeloHook, MailHook, RcptHook, MessageHook

Simple Hook implementation which can be used as base class when writing simple Hook's The SMTP-Server will just accept email with this Hook in place and discard it


Constructor Summary
SimpleHook()
           
 
Method Summary
 HookResult doHelo(SMTPSession session, String helo)
          Return HookResult with HookReturnCode.DECLINED
 HookResult doMail(SMTPSession session, org.apache.mailet.MailAddress sender)
          Return HookResult with HookReturnCode.DECLINED
 HookResult doRcpt(SMTPSession session, org.apache.mailet.MailAddress sender, org.apache.mailet.MailAddress rcpt)
          Return HookResult with HookReturnCode.DECLINED
 HookResult onMessage(SMTPSession session, MailEnvelope mail)
          Return HookResult with HookReturnCode.OK
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleHook

public SimpleHook()
Method Detail

onMessage

public HookResult onMessage(SMTPSession session,
                            MailEnvelope mail)
Return HookResult with HookReturnCode.OK

Specified by:
onMessage in interface MessageHook

doRcpt

public HookResult doRcpt(SMTPSession session,
                         org.apache.mailet.MailAddress sender,
                         org.apache.mailet.MailAddress rcpt)
Return HookResult with HookReturnCode.DECLINED

Specified by:
doRcpt in interface RcptHook
Parameters:
session - the SMTPSession
sender - the sender MailAddress
rcpt - the recipient MailAddress
Returns:
HookResult

doMail

public HookResult doMail(SMTPSession session,
                         org.apache.mailet.MailAddress sender)
Return HookResult with HookReturnCode.DECLINED

Specified by:
doMail in interface MailHook
Parameters:
session - the SMTPSession
sender - the sender MailAddress
Returns:
HockResult

doHelo

public HookResult doHelo(SMTPSession session,
                         String helo)
Return HookResult with HookReturnCode.DECLINED

Specified by:
doHelo in interface HeloHook
Parameters:
session - the SMTPSession
helo - the helo name
Returns:
HockResult


Copyright © 2010-2011 The Apache Software Foundation. All Rights Reserved.