<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Perl Scripting for mail handling in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/perl-scripting-for-mail-handling/m-p/5001864#M98268</link>
    <description>Hi guys, &lt;BR /&gt;&lt;BR /&gt;  I am relatively new to perl, am trying to write some stuff... can someone roughly explain each line do?:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;&lt;BR /&gt;use strict;&lt;BR /&gt;use Mail::POP3Client;&lt;BR /&gt;&lt;BR /&gt;#---------------------------------------------------------&lt;BR /&gt;#&lt;BR /&gt;#&lt;BR /&gt;sub clear_mail&lt;BR /&gt;{&lt;BR /&gt;        my $pop;&lt;BR /&gt;        my $n;&lt;BR /&gt;        my $i;&lt;BR /&gt;        my $test_text;&lt;BR /&gt;        my $user;&lt;BR /&gt;        my $passwd;&lt;BR /&gt;        my $server;&lt;BR /&gt;&lt;BR /&gt;        $server = $_[0];&lt;BR /&gt;        $user   = $_[1];&lt;BR /&gt;        $passwd = $_[2];&lt;BR /&gt;        $pop    = new Mail::POP3Client(&lt;BR /&gt;                USER      =&amp;gt; $user,&lt;BR /&gt;                PASSWORD  =&amp;gt; $passwd,&lt;BR /&gt;                HOST      =&amp;gt; $server,&lt;BR /&gt;                AUTH_MODE =&amp;gt; "PASS",&lt;BR /&gt;                DEBUG     =&amp;gt; 0&lt;BR /&gt;        );&lt;BR /&gt;        $i = 1;&lt;BR /&gt;        $n = $pop-&amp;gt;Count();&lt;BR /&gt;        print STDERR "Clearing $n old messages on server...\n";&lt;BR /&gt;&lt;BR /&gt;        for ( $i = 1 ; $i &amp;lt;= $n ; $i++ )&lt;BR /&gt;        {&lt;BR /&gt;                print STDERR "------ Message $i\n";&lt;BR /&gt;                print STDERR $pop-&amp;gt;Body($i);&lt;BR /&gt;                print STDERR "\n-----------------------\n";&lt;BR /&gt;                $pop-&amp;gt;Delete($i);&lt;BR /&gt;        }&lt;BR /&gt;        print STDERR "Old messages cleared.\n";&lt;BR /&gt;        return ($n);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;#---------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;clear_mail( $ARGV[0], $ARGV[1], $ARGV[2] );&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I know it is to remove the mail from the argurement defined account, but dunno the code in specific.. how can i insert lines to append all the mails to a log.. say "/tmp/log.txt".&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
    <pubDate>Thu, 07 Sep 2006 21:26:43 GMT</pubDate>
    <dc:creator>Henry Chua</dc:creator>
    <dc:date>2006-09-07T21:26:43Z</dc:date>
    <item>
      <title>Perl Scripting for mail handling</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-scripting-for-mail-handling/m-p/5001864#M98268</link>
      <description>Hi guys, &lt;BR /&gt;&lt;BR /&gt;  I am relatively new to perl, am trying to write some stuff... can someone roughly explain each line do?:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;&lt;BR /&gt;use strict;&lt;BR /&gt;use Mail::POP3Client;&lt;BR /&gt;&lt;BR /&gt;#---------------------------------------------------------&lt;BR /&gt;#&lt;BR /&gt;#&lt;BR /&gt;sub clear_mail&lt;BR /&gt;{&lt;BR /&gt;        my $pop;&lt;BR /&gt;        my $n;&lt;BR /&gt;        my $i;&lt;BR /&gt;        my $test_text;&lt;BR /&gt;        my $user;&lt;BR /&gt;        my $passwd;&lt;BR /&gt;        my $server;&lt;BR /&gt;&lt;BR /&gt;        $server = $_[0];&lt;BR /&gt;        $user   = $_[1];&lt;BR /&gt;        $passwd = $_[2];&lt;BR /&gt;        $pop    = new Mail::POP3Client(&lt;BR /&gt;                USER      =&amp;gt; $user,&lt;BR /&gt;                PASSWORD  =&amp;gt; $passwd,&lt;BR /&gt;                HOST      =&amp;gt; $server,&lt;BR /&gt;                AUTH_MODE =&amp;gt; "PASS",&lt;BR /&gt;                DEBUG     =&amp;gt; 0&lt;BR /&gt;        );&lt;BR /&gt;        $i = 1;&lt;BR /&gt;        $n = $pop-&amp;gt;Count();&lt;BR /&gt;        print STDERR "Clearing $n old messages on server...\n";&lt;BR /&gt;&lt;BR /&gt;        for ( $i = 1 ; $i &amp;lt;= $n ; $i++ )&lt;BR /&gt;        {&lt;BR /&gt;                print STDERR "------ Message $i\n";&lt;BR /&gt;                print STDERR $pop-&amp;gt;Body($i);&lt;BR /&gt;                print STDERR "\n-----------------------\n";&lt;BR /&gt;                $pop-&amp;gt;Delete($i);&lt;BR /&gt;        }&lt;BR /&gt;        print STDERR "Old messages cleared.\n";&lt;BR /&gt;        return ($n);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;#---------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;clear_mail( $ARGV[0], $ARGV[1], $ARGV[2] );&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I know it is to remove the mail from the argurement defined account, but dunno the code in specific.. how can i insert lines to append all the mails to a log.. say "/tmp/log.txt".&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Thu, 07 Sep 2006 21:26:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-scripting-for-mail-handling/m-p/5001864#M98268</guid>
      <dc:creator>Henry Chua</dc:creator>
      <dc:date>2006-09-07T21:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: Perl Scripting for mail handling</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-scripting-for-mail-handling/m-p/5001865#M98269</link>
      <description>Can you tell me what&lt;BR /&gt;&lt;BR /&gt;# man Mail::POP3Client&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;# perldoc Mail::POP3Client&lt;BR /&gt;&lt;BR /&gt;is not explaining enough? Explaining each line is a bit dumb imho.&lt;BR /&gt;&lt;BR /&gt;# man perltoc&lt;BR /&gt;&lt;BR /&gt;will give you the content list of what on-line documentation is available&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Fri, 08 Sep 2006 00:49:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-scripting-for-mail-handling/m-p/5001865#M98269</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2006-09-08T00:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: Perl Scripting for mail handling</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-scripting-for-mail-handling/m-p/5001866#M98270</link>
      <description>Hi Merijn,&lt;BR /&gt;&lt;BR /&gt; Thanks figure it out.. &lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Henry</description>
      <pubDate>Fri, 08 Sep 2006 01:37:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-scripting-for-mail-handling/m-p/5001866#M98270</guid>
      <dc:creator>Henry Chua</dc:creator>
      <dc:date>2006-09-08T01:37:28Z</dc:date>
    </item>
  </channel>
</rss>

