Postfix::Parse::Mailq(3pm) User Contributed Perl Documentation Postfix::Parse::Mailq(3pm)NAME
Postfix::Parse::Mailq - parse the output of the postfix mailq command
VERSION
version 1.001
SYNOPSIS
use Postfix::Parse::Mailq;
my $mailq_output = `mailq`;
my $entries = Postfix::Parse::Mailq->read_string($mailq_output);
my $bytes = 0;
for my $entry (@$entries) {
next unless grep { /@aol.com$/ } @{ $entry->{remaining_rcpts} };
$bytes += $entry->{size};
}
print "$bytes bytes remain to send to AOL destinations
";
WARNING
This code is really rough and the interface will change. Entries will be objects. There will be some more methods. Still, the basics are
likely to keep working, or keep pretty close to what you see here now.
METHODS
read_file
read_handle
read_string
my $entries = Postfix::Parse::Mailq->read_string($string, \%arg);
This methods read the output of postfix's mailq from a file (by name), a filehandle, or a string, respectively. They return an arrayref of
hashrefs, each hashref representing one entry in the queue as reported by mailq.
Valid arguments are:
spool - a hashref of { queue_id -> spool_name } pairs
if given, this will be used to attempt to indicate in which
spool messages currently are; it is not entirely reliable (race!)
parse_block
my $entry = Mailq->parse_block(@lines);
Given all the lines in a single entry's block of lines in mailq output, this returns data about the entry.
AUTHOR
Ricardo SIGNES <rjbs@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2008 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under the same terms as perl itself.
perl v5.10.1 2008-10-23 Postfix::Parse::Mailq(3pm)
Check Out this Related Man Page
Time::Duration::Parse(3pm) User Contributed Perl Documentation Time::Duration::Parse(3pm)NAME
Time::Duration::Parse - Parse string that represents time duration
SYNOPSIS
use Time::Duration::Parse;
my $seconds = parse_duration("2 minutes and 3 seconds"); # 123
DESCRIPTION
Time::Duration::Parse is a module to parse human readable duration strings like 2 minutes and 3 seconds to seconds.
It does the opposite of duration_exact function in Time::Duration and is roundtrip safe. So, the following is always true.
use Time::Duration::Parse;
use Time::Duration;
my $seconds = int rand 100000;
is( parse_duration(duration_exact($seconds)), $seconds );
FUNCTIONS
parse_duration
$seconds = parse_duration($string);
Parses duration string and returns seconds. When it encounters an error in a given string, it dies an exception saying "Unknown
timespec: blah blah blah". This function is exported by default.
AUTHOR
Tatsuhiko Miyagawa <miyagawa@bulknews.net>
COPYRIGHT
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Some internal code is taken from Cache and Cache::Cache modules on CPAN.
SEE ALSO
Date::Manip, DateTime::Format::Duration, <http://use.perl.org/~miyagawa/journal/30310>
perl v5.10.0 2008-06-02 Time::Duration::Parse(3pm)
Dear guys !!
Problems do not finish ..
i have sun solaries 7 ,, ultra2 ,, mail server ..
am checking server mailq now and it is loaded ,, so many requests up to 300 request .
i checked netstat and did not find many or starnge smtp packets .
but when i execute mailq i get mailq as... (3 Replies)
hi,:)
onsider the followinf two lines
J="$(scriptbc -p 8 $I / \(12 \* 100 \) )"
N="$(( $L * 12 ))"
In the first line I put \ before * like \* and its working fine.
But in the second line if put \ before * i am getting parse error.
What might be the reason?Any idea pls.
cheers
RRK (1 Reply)
Hello,
I barely know the basics, but I am very determined to learn. I want to parse a few characters from each row, use that string to search another file and display the line number where I found the value in the file. I don't know if this can all be done on the command line, so I am creating a... (2 Replies)
Hi,
Can you please help me?
How to Parse a comma delimited and optionally quotes dimilited file?
sample.dat
----------
"I",+2007,"SANDA, 20, MARTIN PLACE","SANDA 20MARTIN"
"D",+2008,"RANDA, 22, MARTIN PLACE","RANDA 22MARTIN"
Thank you.
Ram (8 Replies)
I need a simple script to parse the output of the mailq command and find emails from overseas addresses and delete them (ie user@xxx.co.uk, user@xxx.yyy.jp).
I found something close:
mailq | tail +2 | awk 'BEGIN { RS = "" } / *.co.uk / {print $1} ' | tr -d '*!' | postsuper -d -
but I... (2 Replies)
First of all an appeal on all specialists to be understandfull with me, newbie. I have a RaQ 550 that I have to admin bymyself. I have executed mailq and found out that there are mails in the queu that I did not sent. Is someone exploiting my server? Here is an example of the report:
... (1 Reply)
Hi all,
Everyday I used to parse the Catalina.out log file on my Redhat system for errors for a particular date. Could anybody be able to help me to create a command which can grep the contents of Catalina.out starting from particular date.
Please do not suggest command which greps only the... (12 Replies)
Hi,
I have read a lot of manuals and man pages yet I am still confused so I thought I would ask this forum for some help.
I need to configure my postfix to accept email for certain domains.
And it should not be allowed to deliver emails from another emails!
So I did the following:
... (1 Reply)
Hi All,
I'm a unix starter.. Need your help please. I need to write a simple shell script to implement mail queue size check.
Pseudo code:
Run mailq command
If the queue size is greater than the predefined parameter (say 10), print message like : CRITICAL: Mail queue is XX . And exit 2... (1 Reply)
I have a script that I am writing to parse the output of information from a command.
Here is one of the lines of the output exported into the variable OUTPUT:
export OUTPUT=”name_of_system,0,5,9,55,ip_address,another_value,/PATH/OF/A/VALUE/I/NEED"
I can get the output I need... (5 Replies)
Hello,
I am working on postfix server on CentOS 5.8 which will be send mails to a specific domain only.
All the things are nearly finished but i am not getting how to setup the postfix to send mails to specific domains.
Please help me out.
Thanks,
Sunny (2 Replies)
We use Redhat server , we always use mailq to check any pending mail in mailq , when run the command mailq , it shows all existing pending mail would advise how to write a script to show the pending mails which are older than 24 hours , ( if possible , then send this pending mail info to... (9 Replies)
Ok I would like to do the following
file test contains the following lines. between the lines ABC there may be any amount of lines up to the next ABC entry.
I want to grep for the filename.txt entry and print the lines in between (and including that line) up to and including the last line... (3 Replies)