Email and SMTP

Receive mail as tickets or as agent conversations, reply in thread, and relay outbound notices through your SMTP server.

After reading this page you will be able to:
  • Start the built-in SMTP listener and turn mail into tickets
  • Give an agent an email door with allowed senders
  • Configure an outbound relay

Inbound: the built-in SMTP listener

Liyagent includes a small SMTP server. Mail it receives lands in an inbox table (5 MB per message limit).

VariableDefaultMeaning
TICKETIQ_MAIL_HOST127.0.0.1Listen address
TICKETIQ_MAIL_PORT2525Listen port
TICKETIQ_MAIL_AUTOSTARToffStart with the server
TICKETIQ_MAIL_AUTO_INGESToffTurn inbox mail into tickets automatically

Start, stop and test it with POST /api/mailserver/start, /stop and /send-test. Ingest the inbox by hand with POST /api/mailserver/ingest.

An email door for an agent

Mail addressed to an agent's email door becomes a conversation, and the agent replies in the same thread.

  1. On the agent's Triggers tab, add an Email trigger, or use PUT /api/triggers/{name}/email.
  2. Fill in Allowed senders, addresses or domains. An empty list means nobody is answered.
  3. Keep Require the receiving server to have authenticated the sender on (the default): the receiving server's Authentication-Results header must show DMARC or DKIM pass.
  4. Deliver mail either to the SMTP listener or by POST /api/email/inbound/{name} with the raw RFC 5322 message, signed with the door's signing secret (X-TicketIQ-Signature and X-TicketIQ-Timestamp).
Warning

Only trust Authentication-Results from your own relays. List their IP addresses in TICKETIQ_EMAIL_TRUSTED_RELAYS. Mail from any other peer can't satisfy that check.

Outbound relay

VariableMeaning
TICKETIQ_MAIL_RELAY_HOST / TICKETIQ_MAIL_RELAY_PORTYour SMTP relay (port 25 by default). Unset, replies go to TICKETIQ_MAIL_HOST, the built-in listener, and never reach the sender.
TICKETIQ_MAIL_RELAY_USER / TICKETIQ_MAIL_RELAY_PASSWORDRelay credentials
TICKETIQ_MAIL_FROMThe From address on notices and replies

Next steps