Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Module to count Postfix mailque outbound messages from specific user

by Anonymous Monk
on Oct 18, 2012 at 12:37 UTC ( #999720=perlquestion: print w/ replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello all knowing Perl Monks: I'd like to have a way tally deferred messages in Postfix mail queue, keep originating users together and the total count from that user, starting with the user with the highest amount in the queue to the least. Not sure if there is a module that can accomplish all this? So essentially would like to take mail queue output like this:
D3D1C45BF 16786 Mon Oct 15 13:58:30 customer@ourdomain.com (host relay.verizon.net[206.46.232.11] refused to talk to me: 571 Emai +l from 127.0.0.1 is currently blocked by Verizon Online's anti-spam s +ystem. The email sender or Email Service Provider may visit http://ww +w.verizon.net/whitelist and request removal of the block. 121017) destination@domain.com 1C9C247E2 5306 Mon Oct 15 20:38:02 customer@ourdomain.com (host hrndva-smtpin02.mail.rr.com[71.74.56.244] refused to talk to me: + 554 5.7.1 - ERROR: Mail refused - <127.0.0.1> - See http://postmaste +r.rr.com/amIBlockedByRR?ip=127.0.0.1) destination@domain.com 1B9C247E2 5306 Mon Oct 15 20:39:01 customer@ourdomain.com (host hrndva-smtpin02.mail.rr.com[71.74.56.244] refused to talk to me: + 554 5.7.1 - ERROR: Mail refused - <127.0.0.1> - See http://postmaste +r.rr.com/amIBlockedByRR?ip=127.0.0.1) destination2@domain.com And generate this: 2 1C9C247E2 5306 Mon Oct 15 20:38:02 customer@ourdomain.com destination@domain.com 1B9C247E2 5306 Mon Oct 15 20:39:01 customer@ourdomain.com destination2@domain.com 1 D3D1C45BF 16786 Mon Oct 15 13:58:30 customer@ourdomain.com destination@domain.com
If tried some solutions using regex,sed, awk and basic perl (limited knowledge) but am not getting the results I am after. Thank you kindly for any responses Darryl

Comment on Module to count Postfix mailque outbound messages from specific user
Download Code
Re: Module to count Postfix mailque outbound messages from specific user
by Kenosis (Priest) on Oct 18, 2012 at 17:16 UTC

    Hi, Anonymous Monk

    To assist with readability, please re-post your mail queue data within code tags. Also, you mentioned that you:

    ...tried some solutions using regex,sed, awk and basic perl...

    Posting your Perl scripting attempts will enable others to assist you with a solution.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://999720]
Approved by Kenosis
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2014-09-16 14:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (32 votes), past polls