Hello,

Here's what I'm trying to do, and some of the possible solutions I have found. (warning, this may be a long message)

I want to be able to see and extract info from messages going from and to a certain Exchange mailbox. (meaning I don't want to "intercept" messages, just get some info from them and then let them pass) I have delegate access to the mailbox in question. The ultimate goal is to put the info from incoming and outgoing messages into a database, but I can handle that part.

Here are the points I'm struggling with:
  1. I can get to mails using Win32::OLE, but I think it would be easier to use Win32::MAPI. Unfortunately, that module's author seems to have "dropped off the Earth" (not responding to mails, web site gives a 404). Does anyone know where I can get the module? It isn't on CPAN, and I can't find any mirror sites.
  2. I can make my eventual program scan the inbox and sent items folders every X seconds, but that isn't a very clean way of doing what I want to do. Is there a way to "attach" a subroutine to the folders so that it is called when something comes in or something is sent? (This may be solved when I get Win32::MAPI, if that's one of the functions it offers)
  3. I have read in the archives that running a program as a service (even running it as the necessary user) does not load the parts of the registry needed to be able to access an Exchange mailbox. I'll probably try to work around that using Win32::AdminMisc's LogonAsUser() or CreateProcessAsUser(), but if there are some caveats to know about before trying that, I'd like to know about them. (once again, perhaps using Win32::MAPI will eliminate the need to be a certain user to access the mailbox, but I won't know until I get the module)

Once I've gotten those things worked out, I can do the rest. I've just never worked with Exchange before, let alone tried to access it from Perl, and info on this doesn't seem abundant.

Thanks in advance,

Jean-Sebastien Guay


In reply to Getting mail from Exchange by Skylark

Title:
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, details, 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, summary, 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.