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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.