Postie commands kInit and kGetMail

Started by rkoster, January 18, 2016, 12:26:26 PM

Previous topic - Next topic

rkoster

Hello-

Iââ,¬â,,¢m trying to use the Postie extender so I can pull  specific emails from  our exchange server. When I try to use the Postie commands kInit and kGetMail I get the below error. I am able to use successfully the commented out commands kdest & ksendfile to send emails and attachments . I think there is some permission type issue once I switch to kGetMail. I am using the latest version if the .dll  wwpst44i.dll. This version has the 6th parameter for security. I also tried using SSL  and  TLS and specifying Ports but no luck so the example below shows no security parameter.

Our exchange server is 2010 with SMTP,IMAP4 running

Has anyone had this issue and how to get around it

Thanks
   RGK


host=" svr-exchangeServer.domain.com"
fromaddr="username@xxxx.com"
userid="NT\username"
password="XXXXXXXX"
port=""
msgnumber="" ; get all msgs
outputfile="gentran_email.dat"
pat="*RGK*" ; get msgs with "Smilie" in subject field
mailbox="" ; this option only available with IMAP4
flags="" ; SMTP is the default flag
security="SSL"
kInit(host,fromaddr,userid,password,port)
DirChange(root_from)
mymail=kGetMail(msgnumber,outputfile,pat,mailbox,flags)
;;;;;;;;;;kdest("username@xxxx.com","","")
;;;;;;;;;;ksendfile("RGK TEST","c:\AAAAA\EDITRADTST.txt", "","")
message("Mail Messages", mymail)


Mail Message ErrorïÆ'¨
Could not connect to:  ââ,¬Å"svr-exchangeServerââ,¬Â:port, error = -10060

td

Generally, you need to use the 'e' flag with 'tls' and the correct port number to use kSendFile.  You may or may not also need to use different credentials for performing a SMTP send as apposed to a POP3 receive.  It all depends on how your server is configured.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

rkoster

Hi TD

Thanks for Quick reply!!  What I'm trying to do, and having the "Could not connect Error  - 10060" with, is the kGetMail. I am able to do the kSendFile successfully.  It looks like once i try to read a user's mailbox is where i get hung up. I assume this is possible  from the Postie.chm documentation. but cant get it to work against our 2010 exchange server with SMTP,IMAP4 running

Thanks TD
   Ron

td

My apologies for not reading your original post carefully.  The Postie extender does work quite well with IMAP4.  You need to got back to the extender help and reread the kGetMail function's documentation.  The function defaults to POP3 and you need to add '4' to the flag parameter to have it use the IMAP4 protocol.  That flag is not present in your posted example.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

rkoster

Hi TD

That did the trick! I may have a followup question on this later but for now im good!!!!

I can't thank you enough for your help with this!!!!!!!!!!

Thanks TD
    Ron

rkoster

Hi TD

So I wondered if I could get your help with a follow-up question on the KGetMail issue. With the direction you gave me I now have that working . My new issue is with the ââ,¬Å"dââ,¬Â option to ââ,¬Å"Mark for Deletionââ,¬Â the email I had previously read in. I put in the following line but I get nothing to happen. I would like to read in the email im searching for then delete it so I donââ,¬â,,¢t run into it again.

         DELmymail=kGetMail("25",outputfile,pat,"username",'d4')
          message("Mail Messages", DELmymail)
I used 25 from the message number I got back on the first kGetMail call.  I left ââ,¬Å"outputfileââ,¬Â and ââ,¬Âpatââ,¬Â the same as the first call. I was a bit unsure what to use for mailbox so I used the username of the mailbox I was searching) 

Maybe i need to run kInit before each Kgetmail i run or is one Kinit good for both

I know the documentation says to 1st run this run kGetMail with the d option then to run to run kManagelmaps4. For my example I just ran kGetMail for deletion but had an empty return. I was hoping I could see what that file looked like after I marked it.   I am not familiar with the Mark for del operation so do you know if after I do this the email should go to the deleted folder or is there a mark I can see against on that email. Iââ,¬â,,¢m being a little cautious on this trying not to make a mess of that mailbox. 


Thanks TD and let me know if I can clarify anything that Iââ,¬â,,¢ve written
  Ron


td

Can't tell you more than is already in the help file.  Use the 'purge' command in the command parameter to  kManageImap4 to delete your email.  The folder name you use is entirely dependent on how you have configured your system but like the help file states, the default folder is 'INBOX'
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade