Package com.mimecast.robin.bots
Class SessionBot
java.lang.Object
com.mimecast.robin.bots.SessionBot
- All Implemented Interfaces:
BotProcessor
Session bot that replies with SMTP session analysis.
This bot analyzes the complete SMTP session including:
- Connection information (IP, TLS, authentication)
- SMTP transaction details
- Email headers and envelope
- DNS and infrastructure information
The response is sent as a JSON attachment with a text summary.
Address format supports reply-to sieve parsing:
- robotSession@example.com - replies to From or envelope sender
- robotSession+token@example.com - same as above with token
- robotSession+token+user+domain.com@example.com - replies to user@domain.com
In the sieve format, the reply address is encoded with + instead of @.
Example: robotSession+abc+admin+internal.com@robin.local → replies to admin@internal.com
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate StringcreateTextSummary(Session session) Creates the text summary for the email body.getName()Gets the name of this bot for factory registration.voidprocess(Connection connection, EmailParser emailParser, String botAddress) Processes the session bot request.private voidqueueResponse(Session session, String botAddress, String replyTo) Queues the response for delivery.
-
Field Details
-
log
private static final org.apache.logging.log4j.Logger log -
GSON
private static final com.google.gson.Gson GSONGson instance for serializing session data with exclusion strategy.
-
-
Constructor Details
-
SessionBot
public SessionBot()
-
-
Method Details
-
process
Processes the session bot request.- Specified by:
processin interfaceBotProcessor- Parameters:
connection- SMTP connection.emailParser- Parsed email (may be null - bots run async after parser is closed).botAddress- The bot address that was matched.
-
createTextSummary
Creates the text summary for the email body.The complete session data will be attached as a JSON file by the queueResponse method.
- Parameters:
session- Original SMTP session.- Returns:
- Text summary of the session.
-
queueResponse
Queues the response for delivery.- Parameters:
session- Original SMTP session to analyze.botAddress- Bot address that received the request.replyTo- Recipient address.
-
getName
Description copied from interface:BotProcessorGets the name of this bot for factory registration.- Specified by:
getNamein interfaceBotProcessor- Returns:
- Bot name.
-