Thanks. How would I go about geting the following for all deferred messages: qid, from, all recipients? Is there a better way of doing this besides parsing the output of mailq with regex? Thanks.
That code does it, you just have to look for 'Defered' in $entry->{message}. The only other alternative (for sendmail at least) is to parse all of the 'q' files in /var/spool/mqueue, which will almost certainly by more of a pain.