All help articles

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):

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.

LineMeaning
<= 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=mailboxDelivered to a mailbox here (F=Junk when filed in Junk).
=> recipient H=mx.example [ip] R=dnslookup T=remote_smtpDelivered to another server.
== recipient ... defer: reasonNot delivered yet; it is tried again.
** recipient ...: reasonFailed for good; the sender gets a failure notice.
CompletedEvery recipient is done.
H=host [ip] F=<sender> rejected RCPT <recipient>: 550 reasonRefused, 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:

Command line: corpsuite maillog q=carol@example.com, corpsuite maillog log=reject, corpsuite maillog team TEAM, corpsuite maillog settings set days:=90.