NOTICE: All information contained herein is, and remains
the property of TechnoCore Automate.
Updated : 2026-03-25
ObjServiceEmailTicket is a hook-based service that
reads emails from bloom_imap_* staging tables
(populated by the ObjImap IMAP hook pipeline), uses an
AI model to classify each message, and creates tickets
for qualifying emails.
def_imap hook (ObjImapSet.Scan)
└── ObjImap.scan_folder() + parse_mail()
└── INSERT INTO bloom_imap_{hook}
└── ObjServiceEmailTicket (PostSql or scheduled)
└── SELECT WHERE TicketProcessed = 'N'
└── ObjAI.prompt() → classify
├── TICKET → ObjTicket.create_from_email()
│ UPDATE TicketProcessed = 'Y'
└── IGNORE → UPDATE TicketProcessed = 'Y'
Create a def_imap hook row:
INSERT INTO def_imap (
ImapCode, Package, IsActive,
Folder, TimeSlip, RunFrequency
) VALUES (
'ticket', 'base', 'Y',
'INBOX', 8, 300
);
Configure config.yaml:
email_ticket:
ai_model: "llama3"
imap_hook: "ticket"
max_body_chars: "2000"
Run the IMAP scan to populate the bloom table:
python factory.core/ObjImap.py scan ticket
Run this service to classify and create tickets:
python ObjServiceEmailTicket.py poll
Alternatively, set the hook's PostSql to call this
service automatically after each scan cycle.
The service adds two columns to bloom_imap_{hook}:
| Column | Type | Description |
|---|---|---|
| TicketProcessed | CHAR(1) | N=pending, Y=done |
| TicketGuid | VARCHAR(64) | Created ticket GUID |
The service sends the email subject and body to the
configured AI model with a classification prompt. The
model replies with:
TICKET <PRIORITY> — create a ticketIGNORE — skip the emailPriority is extracted from the AI response (CRITICAL,
HIGH, MEDIUM, or LOW). Defaults to MEDIUM if not
recognized.
# Process unclassified emails from bloom table
python ObjServiceEmailTicket.py poll
# Classify without creating
python ObjServiceEmailTicket.py classify "Subject" "Body"
| Action | Description |
|---|---|
poll |
Read bloom table, classify, create tickets |
classify |
Classify a single email (no ticket) |
ObjImap.py — IMAP hook pipelineObjTicket.py — ticket creationObjAI.py — AI model abstractionUpdated : 2026-03-25