Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

How to read local unix-style mail

by Cody Fendant (Pilgrim)
on May 15, 2014 at 00:19 UTC ( #1086093=perlquestion: print w/ replies, xml ) Need Help??
Cody Fendant has asked for the wisdom of the Perl Monks concerning the following question:

I'm on OSX and I can send mail directly to my user account using simply <username>@<ipaddress> as the address.

This is the kind of classic email you would read using pine or elm or something. "You have new mail from cron in /var/spool/mail/root" -style email.

How would I read mail that using Perl?

Comment on How to read local unix-style mail
Select or Download Code
Re: How to read local unix-style mail
by LanX (Canon) on May 15, 2014 at 00:40 UTC
    When do you want to read the mails?

    Do you want to poll several of them out of the inbox every interval or do you want to trigger a process instantly for each incoming mail? For the latter see procmail and family.

    For the rest see The Evolution of Perl Email Handling (I googled it for you :)

    Cheers Rolf

    ( addicted to the Perl Programming Language)

Re: How to read local unix-style mail
by ww (Bishop) on May 15, 2014 at 00:43 UTC

    If there's really some reason pine and relatives won't do, you might start by searching CPAN using "mail" as a keyword.


    Questions containing the words "doesn't work" (or their moral equivalent) will usually get a downvote from me unless accompanied by:
    1. code
    2. verbatim error and/or warning messages
    3. a coherent explanation of what "doesn't work actually means.

    check Ln42!

Re: How to read local unix-style mail
by hippo (Curate) on May 15, 2014 at 08:18 UTC

    It depends how fully-functional you want your "read" operation to be. Towards the top end of the scale is Mail::Box::Mbox - but if you think that's overkill then you'll have to be a bit more specific about how you want to "read" it and what other operations should be involved.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1086093]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2014-09-23 11:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (219 votes), past polls