mxgate

The message log

The mxgate log has one row for each message: forwarded, sent, deferred, bounced, expired or rejected, with the reply of the other server.

mxgate writes a log row for each message that it forwards, sends or refuses. The row says what happened, what the other server answered, and what to do.

Read the log

$ npx mxgate logs example.com
2026-11-14 09:14:02  in   forwarded  client@example.org -> hello@example.com -> you@gmail.com
2026-11-14 09:20:41  in   rejected   promo@example.net -> hello@example.com
    rspamd scored it as spam and mxgate refused it at SMTP time. The sender got an error; nothing was forwarded.
2026-11-14 10:02:10  in   bounced    client@example.org -> sales@example.com -> old@example.org
    The destination mailbox does not exist.
2026-11-14 10:30:55  out  sent       ada@example.com -> client@example.org

The newest row is first. Times are in UTC. A row for forwarded mail shows the sender, the alias, and the destination. For a message that failed, the CLI also prints a line that starts with server said: and has the reply of the server.

The log has one row for each message and destination. A message to an alias with two destinations has two rows. A message that mxgate refused has one row.

Statuses

StatusMeaning
forwardedThe destination server accepted the forwarded message.
sentThe server of the recipient accepted a message that you sent.
deferredThe other server did not accept the message yet. mxgate tries again for up to 2 days. The row changes when a later try has a result.
bouncedThe other server refused the message. For forwarded mail, the sender gets no bounce message. For mail that you sent, you get a bounce message.
expiredmxgate tried for 2 days and stopped.
rejectedmxgate refused the message at SMTP time. The sending side got an error, and nothing was forwarded or sent.

The most frequent causes of rejected for incoming mail are spam, an address with no alias and no catch-all, an alias with no confirmed destination, and a domain that is not verified. For outgoing mail the causes are the send limit of the plan, a sender address at a different domain, and the spam filter.

Direction

in is mail to your domain that mxgate forwards. out is mail that you send through smtp.mxgate.io or the send API.

Fields of a row

mxgate logs --json and GET /v1/logs give each row with these fields:

FieldMeaning
received_atWhen mxgate got the message.
updated_atWhen the status last changed.
directionin or out.
statusOne of the six statuses.
senderThe original sender. It is null for a bounce.
recipientFor in: the alias address. For out: the recipient.
destinationThe mailbox that mxgate forwarded to. It is empty for a refused message and for sent mail.
domainYour domain.
reasonWhat the other server or mxgate said.
explanationThe same in one plain sentence, with what to do.
dsnThe status code of the delivery, for example 5.1.1.
relayThe server that mxgate delivered to.
clientThe server that gave the message to mxgate.
message_idThe Message-ID of the message. Use it as in_reply_to when you answer: see Send as your domain.
attemptsThe number of delivery tries.

Filters

CLIAPI parameterShows
mxgate logs example.comdomainOne domain. Without it: all your domains.
--in, --outdirectionin or out.
--status bouncedstatusOne status.
--address a@baddressRows where this address is the alias, the destination or the sender.
--before <time>beforeRows received before this ISO 8601 time.
--limit 100limitThe number of rows: 1 to 500. The default is 50.
npx mxgate logs example.com --status bounced
npx mxgate logs --out --address client@example.org --json

curl "https://api.mxgate.io/v1/logs?domain=example.com&status=bounced&limit=100" \
  -H "Authorization: Bearer $MXGATE_API_KEY"

Paging

The API answer is {entries, next_before, retention_days}. When there are more rows, next_before has a time. Give it as before in the next call. At the end, next_before is null. The CLI prints the command for the next page:

More: mxgate logs example.com --before 2026-11-14T09:14:02.000Z

What the log does not keep

The log has no subject and no body. It has the addresses, the time, the servers, the Message-ID, and the result.

Retention

The free plan keeps a row for 7 days. The paid plan keeps a row for 90 days. retention_days in the API answer shows the number for your account.

On this page