You can use the access file to generate messages. For example, I got sick of spammers hitting an old email account of mine (oracle@mydomain.com.au) so in my access file I have:
Code:
oracle@mydomain.com.au ERROR:550 Mailbox disabled for this username
I re-generated the access db with the following command. That email address no longer receives mail and the sender gets the message I have set.
Code:
makemap -v hash /etc/mail/access < /etc/mail/access
To use the access file you need to have it enabled in sendmail.cf. You can enable it by adding
FEATURE(`access_db')dnl to sendmail.mc and re-generating sendmail.cf.