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.
Thread Tools Display Modes
Old 15th December 2009, 12: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:
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:
9BBF287C66     2827 Tue Dec 15 09:47:31  user@domain.com
                                                          (deferred transport)
so the result of the command
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?

Reply With Quote
Sponsored Links
Old 16th December 2009, 18:11
topdog topdog is offline
Senior Member
Join Date: Jan 2008
Location: South Africa
Posts: 1,352
Thanks: 0
Thanked 154 Times in 151 Posts

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
Old 18th December 2009, 13:29
voltron81 voltron81 is offline
Senior Member
Join Date: Sep 2009
Posts: 292
Thanks: 1
Thanked 4 Times in 3 Posts

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


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 14:58
phpmyadmin error lifeisboost Installation/Configuration 9 14th August 2008 20:19
Management/system config/settings & /server/settings not working!! dactor Installation/Configuration 9 6th February 2008 10:11
mysql clustering problem : cannot create table in database prince.fer Server Operation 2 16th April 2007 18:03
Mandriva 10.2 Perfect Setup Install Problems... ctroyp Installation/Configuration 12 30th December 2005 17:04

All times are GMT +2. The time now is 22:09.

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