View Single Post
  #1  
Old 15th December 2009, 11:56
voltron81 voltron81 is offline
Senior Member
 
Join Date: Sep 2009
Posts: 292
Thanks: 1
Thanked 4 Times in 3 Posts
Default Mailq values into a mysql database...

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 user@domain.com | 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  user@domain.com
                                                          (deferred transport)
                                         user@gmail.com
so the result of the command
Code:
mailq | grep user@domain.com | 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
Reply With Quote
Sponsored Links