newbie question for parsing incoming mails
Eko Budiharto <[email protected]> Wed, 15 Feb 2017 07:12:08 +0000 (UTC)
| Newsgroups | gmane.comp.lang.perl.active-perl |
|---|---|
| Message-ID | <[email protected]> |
--===============1681273568==
Content-Type: multipart/alternative;
boundary="----=_Part_4665001_2061065645.1487142728580"
------=_Part_4665001_2061065645.1487142728580
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
dear all,
I have a question.=20
If I would like to parse all incoming mails from my qmail, which perl modul=
e 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:
=C2=A0
#!/usr/bin/perl -w
=C2=A0
use Mail::Internet;
my $mail =3D Mail::Internet->new( [ <STDIN> ] );
my $headers =3D $mail->head->header_hashref;
my @subject =3D @{${$headers}{'Subject'}}; # or otherwsie do it in list con=
text it works
print @subject;
when I run it, I do not get anything.
please help.
regards,
Eko
------=_Part_4665001_2061065645.1487142728580
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<html><head></head><body><div style=3D"color:#000; background-color:#fff; f=
ont-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, =
sans-serif;font-size:16px"><div id=3D"yui_3_16_0_ym19_1_1487142283185_9158"=
><div id=3D"yui_3_16_0_ym19_1_1487142283185_9159"><div id=3D"yui_3_16_0_ym1=
9_1_1487142283185_9160"><div id=3D"yui_3_16_0_ym19_1_1487142283185_9161">de=
ar all,<br id=3D"yui_3_16_0_ym19_1_1487142283185_9162"></div>I have a quest=
ion. <br id=3D"yui_3_16_0_ym19_1_1487142283185_9163"></div>If I would like =
to parse all incoming mails from my qmail, which perl module is easy to use=
?<br id=3D"yui_3_16_0_ym19_1_1487142283185_9164"></div>my
qmail emails incoming is /var/qmail/mailnames/<domain=20
names>/support. In this folder I already have preline in .qmail for=20
piping emails to my perl script.<br id=3D"yui_3_16_0_ym19_1_1487142283185_9=
165"></div>And, my perl script what I already have is like this:<br id=3D"y=
ui_3_16_0_ym19_1_1487142283185_9166"> <br id=3D"yui_3_16_0_ym19_1_1487=
142283185_9167">#!/usr/bin/perl -w<br id=3D"yui_3_16_0_ym19_1_1487142283185=
_9168"> <br id=3D"yui_3_16_0_ym19_1_1487142283185_9169">use Mail::Inte=
rnet;<br id=3D"yui_3_16_0_ym19_1_1487142283185_9170"><br id=3D"yui_3_16_0_y=
m19_1_1487142283185_9171">my $mail =3D Mail::Internet->new( [ <STDIN&=
gt; ] );<br id=3D"yui_3_16_0_ym19_1_1487142283185_9172">my $headers =3D $ma=
il->head->header_hashref;<br id=3D"yui_3_16_0_ym19_1_1487142283185_91=
73">my @subject =3D @{${$headers}{'Subject'}}; # or otherwsie do it in list=
context it works<br id=3D"yui_3_16_0_ym19_1_1487142283185_9174"><br id=3D"=
yui_3_16_0_ym19_1_1487142283185_9175">print @subject;<br id=3D"yui_3_16_0_y=
m19_1_1487142283185_9176"><div id=3D"yui_3_16_0_ym19_1_1487142283185_9177">=
<br id=3D"yui_3_16_0_ym19_1_1487142283185_9178"><br id=3D"yui_3_16_0_ym19_1=
_1487142283185_9179"></div><div id=3D"yui_3_16_0_ym19_1_1487142283185_9180"=
>when I run it, I do not get anything.<br id=3D"yui_3_16_0_ym19_1_148714228=
3185_9181"><br id=3D"yui_3_16_0_ym19_1_1487142283185_9182"></div><div id=3D=
"yui_3_16_0_ym19_1_1487142283185_9183">please help.<br id=3D"yui_3_16_0_ym1=
9_1_1487142283185_9184"><br id=3D"yui_3_16_0_ym19_1_1487142283185_9185"></d=
iv><div id=3D"yui_3_16_0_ym19_1_1487142283185_9186">regards,<br id=3D"yui_3=
_16_0_ym19_1_1487142283185_9187"></div>Eko</div></body></html>
------=_Part_4665001_2061065645.1487142728580--
--===============1681273568==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1681273568==--