R$* $: $(log Subject: $1 $) $1
Make sure that the blank spaces after R$8 is a tab and not 4 spaces.
Build the macro
m4 sendmail.mc > sendmail.cf
You should now start to see the subject as a separate line in the log. Use the unique id to find the subject line
sendmail: w182kQTv021030: Subject:test123