Skip to content

Add EICAR test file send via --eicar flag - #82

Closed
steffenfritz wants to merge 1 commit into
mainfrom
feature/eicar-send-test
Closed

Add EICAR test file send via --eicar flag#82
steffenfritz wants to merge 1 commit into
mainfrom
feature/eicar-send-test

Conversation

@steffenfritz

Copy link
Copy Markdown
Owner

Summary

  • Adds a new -e / --eicar flag that sends the EICAR standard test string as an email attachment (eicar.com) to the target mail server on port 25
  • The SMTP server response (accepted / rejected) is reported neutrally — no claim is made about AV filtering, since post-acceptance processing is asynchronous and not visible to the client
  • The EICAR string is assembled at runtime from two substrings to prevent false-positive AV detection in the mxcheck binary and source files

Notes

  • Only runs when port 25 is open and reachable (fits naturally into the existing port scan loop)
  • Uses the existing --mailfrom / --mailto flags for sender and recipient
  • No new dependencies

Test plan

  • Run mxcheck -s <domain> -e -n against a known test server and verify the "EICAR AV Test" section appears in output
  • Verify accepted by server is reported when the server accepts the DATA command
  • Verify rejected by server and the server response are reported when the server rejects during DATA
  • Run go vet ./... and go test -v ./... — all green
  • Confirm no AV tool flags the mxcheck binary after build

Closes #37

🤖 Generated with Claude Code

Adds a new -e/--eicar flag that sends the EICAR test string as an email
attachment (eicar.com) to the target mail server on port 25. The server's
response (accepted/rejected) is reported. The EICAR string is assembled at
runtime from two parts to avoid false-positive AV detection in the binary.

Closes #37

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Steffen Fritz <steffen@fritz.wtf>
@steffenfritz

Copy link
Copy Markdown
Owner Author

Closing this PR. In practice, mxcheck runs on workstations or laptops with residential IP addresses, which are blocked by most mail servers before the DATA phase — regardless of content. The EICAR string never reaches the AV filter. Sending from a real MTA account would require SMTP auth support, which is a separate, larger feature. Closing in favor of a more focused discussion in #37.

@steffenfritz
steffenfritz deleted the feature/eicar-send-test branch March 29, 2026 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add EICAR send test

1 participant