Class ProxyBehaviour
java.lang.Object
com.mimecast.robin.smtp.extension.client.DefaultBehaviour
com.mimecast.robin.smtp.extension.client.ProxyBehaviour
- All Implemented Interfaces:
Behaviour
Proxy client behaviour.
This behaviour is designed for a single envelope proxy connection.
It executes the SMTP exchange up to the MAIL command and then waits for individual RCPT calls before accepting the DATA command.
Unlike DefaultBehaviour, it does NOT automatically execute the data method.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) MessageEnvelopeEnvelope being proxied.private booleanFlag to track if MAIL FROM was sent.Fields inherited from class com.mimecast.robin.smtp.extension.client.DefaultBehaviour
connection, log -
Constructor Summary
ConstructorsConstructorDescriptionProxyBehaviour(MessageEnvelope envelope) Constructs a new ProxyBehaviour instance. -
Method Summary
Modifier and TypeMethodDescription(package private) voidmail()Executes MAIL FROM.voidprocess(Connection connection) Executes delivery up to MAIL FROM.booleansendData()Sends DATA command and streams the email.voidsendQuit()Sends QUIT command.Sends RCPT TO for a single recipient.
-
Field Details
-
envelope
MessageEnvelope envelopeEnvelope being proxied. -
mailSent
private boolean mailSentFlag to track if MAIL FROM was sent.
-
-
Constructor Details
-
ProxyBehaviour
Constructs a new ProxyBehaviour instance.- Parameters:
envelope- The envelope to proxy.
-
-
Method Details
-
process
Executes delivery up to MAIL FROM.Does NOT execute DATA - that must be called separately via sendData().
- Specified by:
processin interfaceBehaviour- Overrides:
processin classDefaultBehaviour- Parameters:
connection- Connection instance.- Throws:
IOException- Unable to communicate.
-
mail
Executes MAIL FROM.- Throws:
IOException- Unable to communicate.
-
sendRcpt
Sends RCPT TO for a single recipient.This is called by ServerRcpt for each matching recipient.
- Parameters:
recipient- The recipient address.- Returns:
- The SMTP response from the proxy server.
- Throws:
IOException- Unable to communicate.
-
sendData
Sends DATA command and streams the email.This is called by ServerData when ready to send the message.
- Returns:
- Boolean indicating success.
- Throws:
IOException- Unable to communicate.
-
sendQuit
Sends QUIT command.- Throws:
IOException- Unable to communicate.
-