Mailq values into a mysql database...

Discussion in 'Server Operation' started by voltron81, Dec 15, 2009.

  1. voltron81

    voltron81 New Member

    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
     
  2. topdog

    topdog New Member HowtoForge Supporter

  3. voltron81

    voltron81 New Member

    Thanks topdog,
    I'll have a look on it...
     

Share This Page