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?
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.