in reply to Exchange Server and IMAP

Hi,

Simply, IMAP was never intended for what you are trying to do. You need to use the OLE hooks that Exchange provides (perl would access them through Win32::OLE) ... please note that you will likely need the Microsoft Office XP Developer on your development box.

There are plenty of vb script examples that you will be able to convert to perl with a little bit of work... BUT I think you should save yourself alot of work and just write your script in VB Script.

Note, that you can use Win32::Exchange but it doesn't appear to be well suited for the task you want

Jason L. Froebe

Team Sybase member

No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1

Replies are listed 'Best First'.
Re^2: Exchange Server and IMAP
by idsfa (Vicar) on Nov 18, 2004 at 17:31 UTC

    IMAP is perfectly capable of doing this task. Exchange may not be (I am not familiar enough with its implementation of the protocol to say). It is absolutely possible to grant a user read-only access to other people's mailboxes (see, for example, IMAP::Admin, Mail::IMAPTalk). The Mail::IMAPTalk module will allow downloading attachments, providing unique ids and changing folders (there's an example in the POD of looking at another user's mailbox):

    $imap = Mail::IMAPTalk->new( Server => 'foo.com', Port => 143, Username => 'joebloggs', Password => 'mypassword', Separator => '.', RootFolder => 'inbox', CaseInsensitive => 1) || die "Connection to foo.com failed. Reason: $@"; $imap->select('user.john'); # Selects 'user.john' my $Res = $imap->fetch('1:*', 'all');

    Updated: Here's the example for changing folder access:

    # Get full access for user 'joe' on his own folder $imap->setacl('user.joe','joe','lrswipcda') || die "IMAP error: $@"; # Remove write, insert, post, create, delete access for user 'andrew' $imap->setacl('user.joe','andrew','-wipcd') || die "IMAP error: $@"; # Add lookup, read, keep unseen information for user 'paul' $imap->setacl('user.joe','paul','+lrs') || die "IMAP error: $@";

    The intelligent reader will judge for himself. Without examining the facts fully and fairly, there is no way of knowing whether vox populi is really vox dei, or merely vox asinorum. -- Cyrus H. Gordon

      Hi

      IMAP for Exchange 5.5 and 2000 has to be enabled for it to work. As this produces extra overhead (performance, maintenance, security and administrative) for the Exchange server, it generally is undesirable. The only proper way (according Microsoft) to interface with the Exchange server from a script or application is to use CDO.

      I've written enough Exchange apps in VB6, VB.NET and vbscript to know that Perl is, unfortunately, ill suited for any real Exchange development. Atleast until someone writes a set of modules that is able to interface with Exchange with CDO on more than superficial terms.

      Jason L. Froebe

      Team Sybase member

      No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1

Re^2: Exchange Server and IMAP
by Anonymous Monk on Nov 18, 2004 at 16:55 UTC
    Thanks much, but that won't work. It need to be able to run it from a machine that doesn't have Exchange installed on it. I forgot to add that.

    I have pretty much surmised that IMAP won't do the trick alone, but I feel there are other modules that would assist in the task.

    I also really want to do it in Perl . . . I have no desire to do anything in VB.

      Hi

      It need to be able to run it from a machine that doesn't have Exchange installed on it.

      Then you will definitely need the MS Office Developer version installed on your client box. Interfacing with Exchange can be tricky from another machine.

      Since this appears to be your first attempt at Exchange code writing, I would suggest taking a good look at Microsoft's examples... write a test script in vbscript to make sure you do understand and to verify that it works... then do a port to perl. VBScript is just a scripting language.

      Start off with an introduction to Collaboration Data Objects then with Collaboration Data Objects for Exchange.

      hope this gives you a start

      Jason L. Froebe

      Team Sybase member

      No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1

        While I really appreciate your input, this is not what I am looking for. I am of the opinion this can be done entirely in Perl and as stated before, VB is not an option I am interested in.

        I have already successfully (and quite easily) opened an Exchange mailbox in Perl as demonstrated by the demo code. Now all I need is some guidence for the remainder of my questions using Perl. By the way, the Office Developer version is not something I have access to and it seems to me that this should be able to be done without it.

        Bottom line is I am looking to do this in Perl and I am convienced it can be done. I know Perl can access Exchange via IMAP. I believe perl can remove attachments from mail messages. I just need assistance putting the pieces together.

        Anyone else have any ideas regarding my original questions?