Email in Znuny#
Email is the most common way customers reach a service desk. Znuny does not keep mails as loose messages. Every mail ends up as an article in a ticket, so the whole conversation with a customer stays in one place, in the order it happened.
A customer mail becomes a ticket#
Maria Keller writes to support@example.com: “The printer on floor 2 is offline.” When Znuny picks up the mail, three things decide what happens next:
A new ticket is created. The subject becomes the ticket title, the mail itself becomes the first article, and Maria is set as the customer.
The queue comes from the address the mail was sent to.
support@example.comis a system address, and each system address belongs to a queue. Mails tosupport@example.comland in the Service Desk queue, mails tosales@example.comin the Sales queue. See System Email Addresses.A ticket number is assigned. The number identifies the ticket in every later mail. In the default format it looks like
2026120321000385.
Znuny gets the mail in one of two ways. A mail account fetches it from a mailbox on a regular schedule, or the mail server hands it over directly.
Note
Postmaster filters can change what happens to a mail before the ticket is created, for example to put mails from a monitoring system into another queue, set a priority, or ignore automatic replies. See Email Filtering. Mails can also carry X-Znuny headers that set ticket values directly, see Mail accounts.
A reply finds its ticket#
Maria answers a mail from the service desk. The answer should land in her existing ticket, not open a second one. Znuny checks, in this order, whether an incoming mail belongs to a ticket:
Ticket number in the subject. A subject such as
Re: [Ticket#2026120321000385] Printer on floor 2 is offlineis matched to ticket2026120321000385. This works because every mail an agent sends carries the number in its subject. Customer mail programs keep it when they reply, and they add their own prefix such asAW:orRe:in front.Mail headers. If the number is gone from the subject, for example because Maria rewrote it, Znuny looks at the
In-Reply-ToandReferencesheaders. These point to the mail she is answering and lead to the same ticket.No match. The mail starts a new ticket, even if the subject is the same as an existing ticket.
When a mail matches, it is added to the ticket as a new customer article.
Which of these checks run, and whether a ticket number appears at the start or end of the subject, is controlled by System Configuration. The most useful settings are:
Ticket::HookandTicket::SubjectFormatfor the text and position of the ticket number in the subject.Ticket::NumberGeneratorfor the number format.PostMaster::CheckFollowUpModule###0100-SubjectandPostMaster::CheckFollowUpModule###0200-Referencesfor the two checks above. Further checks, for example one that searches the mail body, are available but switched off by default.
Replies to closed tickets#
When Maria replies to a ticket that is already closed, the follow-up option of the queue decides:
possible: the ticket is reopened and the reply is added to it.
reject: the reply is not added. The sender gets the reject auto response, if one is set up.
new ticket: a new ticket is created and linked to the old one.
The default for a new queue is possible. The follow-up options are set per queue, see Queues.
An agent reply goes out#
An agent opens the ticket and chooses Reply on Maria’s article. Znuny fills the form for the agent:
The recipient is the sender of the article.
The subject starts with
Re:and contains the ticket number.The sender address is the system address of the ticket’s queue, so Maria sees
support@example.comand not the agent’s personal address.Salutation, text template and signature come from the queue and from templates, so every agent answers in the same form.
When the agent sends the reply, it is stored in the ticket as an article from the agent and goes out through the module set in SendmailModule. By default this is Sendmail, which hands the mail to the sendmail program of the server. Most installations switch it to an SMTP mail server, see SMTP Settings. With MultiSendmail each sender address can have its own outbound email profile.
The mail does not leave at the moment the agent clicks send. Znuny puts it in a mail queue, and a daemon task sends the queued mails every minute by default (task MailQueueSend in System Configuration). If the mail server refuses a mail, Znuny tries again, three times by default (MailQueue, ItemMaxAttempts). When all attempts fail, the agent sees a message in the ticket and can use Resend in the article menu to correct the address and send the mail again. See Resend an Email. Failures are only reported back with the SMTP modules. With plain Sendmail a failed mail is not reported.
The ticket is locked to the agent while they work on it. See Ticket Lock.
Notes that are not for the customer#
Agents can add an internal note to a ticket. It is stored as an article too, but it is never sent by mail and the customer cannot see it. Use it for what the team needs to know and the customer does not, for example the result of a call with a supplier.
Automatic mails#
Besides replies from agents, Znuny sends mails on its own:
Auto responses confirm to the customer that a mail arrived and a ticket was created, or that a follow-up was received. See Automatic Responses.
Ticket notifications inform agents and customers about events such as a new ticket, a new follow-up or an escalation. See Ticket Notifications.
Sending mails to Znuny from systems that answer automatically can cause loops. Znuny detects loops and stops answering, and postmaster filters can ignore such mails from the start.