Find all Exim messages sent from an email address
Build a paste-ready command, then review its compatibility and effects before running it.
awk -v sender=<sender-email> '$4=="<=" && $5==sender' /var/log/exim4/mainlogComplete required fields to copy the generated command.
read-onlyno known side effects Compatibility
Exim mainlogMatches the standard Exim arrival marker (<=) and envelope sender fields in a mainlog file.
Operational knowledgereview due 2027-01-19
Requirementsawkawk must be installed and available on PATH.
Version supportawk Current supported releasesVerified for linux using posix, bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signals2026-07-23 09:12:04 1uH7aa-0004F2-2L <= alice@example.com H=mx.example.com [203.0.113.18] P=esmtps S=1842Representative successful output; values vary with the selected target and system state.
Known errorsawk: command not foundawk is missing or is not available on PATH.
Verifyawk -v sender={{sender}} '$4=="<=" && $5==sender' {{logFile}}The output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01awkCommandRuns the awk stage of this one-liner.
02-vOptionAssigns the following name and value before the awk program runs.
03sender=<sender-email>ParameterA value supplied in the Fill parameters section.
04'$4=="<=" && $5==sender'ArgumentPasses '$4=="<=" && $5==sender' to awk.
05<exim-log-file>ParameterA value supplied in the Fill parameters section.
Example input
awk -v sender=alice@example.com '$4=="<=" && $5==sender' /var/log/exim4/mainlog
Example output
2026-07-23 09:12:04 1uH7aa-0004F2-2L <= alice@example.com H=mx.example.com [203.0.113.18] P=esmtps S=1842
Illustrative output — exact values vary by system and data.
Official sources
Related commands