Need to get return code from mutt if an address is invalid/undeliverable from Unix shell script

I am using mutt on ksh Unix to send emails to addresses plucked from the database. If the "To:" email address is not longer valid and so the email is not sent to the "To:" recipient, but is sent to the valid cc address, I need to be able to get an error code returned to the shell script so that the CC recipient is aware that the "To" user did NOT get the email.. Is this possible? If so, how would I do it?

Thanks!!
Jenifer :wall:

That's the thing. mutt doesn't know if an address is undeliverable. Email doesn't work that way. If there's something wrong with an email, or a mailbox is full or something, you get a bounce message later. Potentially much much later. Something along the chain somewhere might get it into its head to retry for hours or days until it's sure the destination's really dead.

Is there any way to do a lookup in email directory?

---------- Post updated at 01:27 PM ---------- Previous update was at 01:27 PM ----------

Also, I am aliasing the From address so I will not know if it bounced.

If you had an open directory of valid email addresses, you could sell it to spammers for a fair chunk of cash.

So no.