Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #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
  #2  
Old 16th December 2009, 17:11
topdog topdog is offline
Senior Member
 
Join Date: Jan 2008
Location: South Africa
Posts: 1,352
Thanks: 0
Thanked 153 Times in 150 Posts
Default

There is a cpan module u could use. http://search.cpan.org/~rjbs/Postfix...Parse/Mailq.pm
__________________
----
http://www.topdog.za.net - Got Linux problems ? - I can help.
http://www.baruwa.org - Try it.
Reply With Quote
  #3  
Old 18th December 2009, 12:29
voltron81 voltron81 is offline
Senior Member
 
Join Date: Sep 2009
Posts: 292
Thanks: 1
Thanked 4 Times in 3 Posts
 
Default

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

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ISPConfig3 Mail Warn Errors reason8 General 3 25th November 2009 13:58
phpmyadmin error lifeisboost Installation/Configuration 9 14th August 2008 19:19
Management/system config/settings & /server/settings not working!! dactor Installation/Configuration 9 6th February 2008 09:11
mysql clustering problem : cannot create table in database prince.fer Server Operation 2 16th April 2007 17:03
Mandriva 10.2 Perfect Setup Install Problems... ctroyp Installation/Configuration 12 30th December 2005 16:04


All times are GMT +2. The time now is 12:51.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.