Not directly to your exact question, but do you have something like rspamd set up? I would consider doing some filtering with rspamd modules. It’s a lot of learning to go through, but has some good defaults. It can filter outgoing mail as well as incoming.
Are you using docker compose? You can set the container hostname for telegraf, https://community.influxdata.com/t/incorrect-hostname-picked-up-by-telegraf-docker-container/24469/6