Skip to content

log

The log output writes the fields of each email to the standard output of the server, between two separator lines:

INFO Email received 2026-11-30T09:15:02.204Z from 127.0.0.1
--------------------------------------------------------------------------------
from: "Alice" <alice@example.com>
to: bob@example.com
bcc: carol@example.com
subject: Hello
text: Hi Bob,
see you tomorrow.
--------------------------------------------------------------------------------

fields chooses the fields and their order, among from, to, cc, bcc, subject, text and html. The default is every field but html. A field without a value is skipped.

  • from, to and cc come from the email headers.
  • bcc lists the recipients of the flow (RCPT TO) that are not in the To or Cc headers: the blind copies.
  • A debug server with nothing to clean up: the emails are in the server output, for example docker logs.
  • Tracing what a flow receives while setting up other outputs.

The output prints directly to the console: it does not go through the configured loggers, so it is not written to a FILE logger, and "loggers": [] does not silence it.

The text and HTML bodies are logged in full, so avoid text and html in fields where logs are kept or shared.

OptionTypeDescription
fieldsstring[]
default ["from","to","cc","bcc","subject","text"]

Fields of the email to log, among from, to, cc, bcc, subject, text and html, fields without a value are skipped

bcc lists the recipients of the flow (RCPT TO) missing from the To and Cc headers

namestring

Name of the component, used in the logs and the output metrics, defaults to <type>_<position in the list>

typerequired"log"

Type of the component

Accept emails from the local machine on port 10026 and log them:

configs/fake-smtp-log.jsonc
// Can replace fakeSMTP.jar
{
"$schema": "https://raw.githubusercontent.com/loopingz/smtp-relay/main/config.schema.json",
"flows": {
"localhost": {
"filters": [
// Allow only localhost
{
"type": "whitelist",
"ips": ["127.0.0.1"]
}
],
"outputs": [
{
// We just log to the console
"type": "log"
}
]
}
},
"port": 10026,
"options": {
"disableReverseLookup": false,
// Do not require auth
"authOptional": true
}
}