Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??


I'm atm trying to write up a perl script, that I need to monitor my new Office 365 mailbox and I am having some problems. I am currently using the module "Net::IMAP::Simple as I have previously used it to query data from another older IMAP Server. So to test the basics I simply try to connect, login and logout to and from the server.

But it seems like my script simply refuses to properly login to the Server, as anything I try produces the Error-String "Command received in invalid state". Browsing some other sites, I found out, that this Error usually is fixed by using "plain" authentication, an Option I can't seem to find within Net::IMAP::Simple, and all my other searches ended up leading me to modules for use on the IMAP-Server itself.

So what I need help with, is to find out if there is a way to login to the server using the Net::IMAP::Simple Module, or if it is simply not possible that way. If that's the case, I'd be delighted if someone could point me in the direction of a way to actually do it.

Finally, the End-Goal of this Operation is to search for the last unseen mail and read how old it is. Since I can't even login right now, I pushed that issue back a bit, and am focusing on getting the login to work first. If any of you have an idea of how to do this too, that would just be the cherry on top.

Please keep the Solutions "Newb-friendly" though. I am only rarely forced to write Perl-Scripts and usually they are quite short or at the least quite easy to come by, so I am not 100% involved in the whole module-management part.

Thank you for the help in advance

In reply to Accessing IMAP-Server via Perl by PerlingAround

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others chilling in the Monastery: (4)
    As of 2019-11-18 08:49 GMT
    Find Nodes?
      Voting Booth?
      Strict and warnings: which comes first?

      Results (88 votes). Check out past polls.