Mail sent via a script will not be shown in the user's sent email, technically because it's not actually sent using the user's email. These emails are tracked via the exim logs and running something like the following would get you all email sent from a script:
Code:
grep "cwd=/home/" /var/log/exim_mainlog
You could take it a bit further and make the output look really nice with something like this one-liner I just wrote:
Code:
grep "cwd=/home/" /var/log/exim_mainlog |awk '{print $3,$14}'|sed 's/cwd=//' |sort |uniq -c |sort -n
Which will output the number of emails sent and the directory location they were sent from, sorted into ascending numerical order