Mail log
Mailocity logs its mail the way Exim does, so the tools and habits that work for Exim work here.
The files
In the log directory (CORPSUITE_LOG_DIR; /var/log/corpsuite in the packaged setup):
- mainlog: every event, one line each.
- rejectlog: refusals only (also in mainlog).
- paniclog: internal errors that made the server refuse mail for now (look in the server's own log,
journalctl -u corpsuited, for the cause).
Lines start with the time (UTC) and, for a message, its id, such as 1u2v3w-00AbCd-Xy. Every line of one message carries the same id, from its arrival to its last delivery, so grep 1u2v3w-00AbCd-Xy mainlog shows its whole story.
| Line | Meaning |
|---|---|
<= sender H=host [ip] P=esmtps S=size id=<Message-ID> | A message arrived. P=esmtpa A=plain:user is a user's own mail; P=webmail was sent from webmail. |
=> recipient R=local T=mailbox | Delivered to a mailbox here (F=Junk when filed in Junk). |
=> recipient H=mx.example [ip] R=dnslookup T=remote_smtp | Delivered to another server. |
== recipient ... defer: reason | Not delivered yet; it is tried again. |
** recipient ...: reason | Failed for good; the sender gets a failure notice. |
Completed | Every recipient is done. |
H=host [ip] F=<sender> rejected RCPT <recipient>: 550 reason | Refused, also in rejectlog. rejected (temporarily) for a 4xx answer. |
Mail the server makes itself (forwards, automatic replies, notices) is logged under an id starting with Q when it goes out.
Rotate the files with logrotate; for example /etc/logrotate.d/corpsuite:
/var/log/corpsuite/*log {
daily
rotate 30
compress
delaycompress
missingok
notifempty
copytruncate
}
Searching in the panels
The same lines are kept in the database for searching:
- Mailocity admin panel → Mail log (staff): search by message id, address, IP or any text, choose a log, and page back with Older. Choosing a message id shows that message's lines. How many days lines are kept is set at the bottom of the page (30 by default); the files are not affected.
- Domain admin panel → Mail log (team admins): the lines about the team's mailboxes, and every line of those messages.
Command line: corpsuite maillog q=carol@example.com, corpsuite maillog log=reject, corpsuite maillog team TEAM, corpsuite maillog settings set days:=90.