> when I run it, I do not get anything.
Hmm, how are you testing it. I put a single header and msg in /tmp/ml.txt
(Subject: training.error Trouble wiwb) and:
$ parse_email_simple.pl < /tmp/ml.txt
training.error Trouble wiwb (8 lines)
$ cat /tmp/ml.txt | parse_email_simple.pl
training.error Trouble wiwb (8 lines)

In addition, if I take out STDOUT
my $mail = Mail::Internet->new( [ <> ] );

I can do:
$ parse_email_simple.pl  /tmp/ml.txt

as Perl'll open the command line file name argument

Note, these'll treat all input as a single msg.

On Wed, Feb 15, 2017 at 12:38 AM, Eko Budiharto <eko.budiha...@gmail.com>
wrote:

> dear all,
> I have a question.
> If I would like to parse all incoming mails from my qmail, which perl
> module is easy to use?
> my qmail emails incoming is /var/qmail/mailnames/<domain names>/support.
> In this folder I already have preline in .qmail for piping emails to my
> perl script.
> And, my perl script what I already have is like this:
>
> #!/usr/bin/perl -w
>
> use Mail::Internet;
>
> my $mail = Mail::Internet->new( [ <STDIN> ] );
> my $headers = $mail->head->header_hashref;
> my @subject = @{${$headers}{'Subject'}}; # or otherwsie do it in list
> context it works
>
> print @subject;
>
>
> when I run it, I do not get anything.
>
> please help.
>
> regards,
> Eko
>



-- 

a

Andy Bach,
afb...@gmail.com
608 658-1890 cell
608 261-5738 wk

Reply via email to