Hi to everybody. I'm trying to create from mailq a database with the details of all the emails queued. I saw that with the command: Code: mailq | grep [email protected] | awk '{print($1);}' I'll have the value for the field 1, 2 for 2, etc... The problem is coming for the "sender/recipient", that is actually on 2 lines: Code: 9BBF287C66 2827 Tue Dec 15 09:47:31 [email protected] (deferred transport) [email protected] so the result of the command Code: mailq | grep [email protected] | awk '{print($7);}' will be just the sender... Any idea how can obtain the value of the receiver? And an idea how to put this values into a mysql database? Thanks Michele
There is a cpan module u could use. http://search.cpan.org/~rjbs/Postfix-Parse-Mailq-1.001/lib/Postfix/Parse/Mailq.pm