Getmail and Get_Status (OpenInsight 32-Bit)
At 30 JUN 2009 02:42:56PM Dave Harmacek wrote:
OI 8.0.8
I'm using GetMail on a process server desktop to check a POP3 account frequently and decode any responses. Sometimes a message gets stuck on the desktop, "Unable to connect -1". Seems to happen if that POP3 server can't be reached. I thought the following use of Set_Status and Get_Status would keep GetMail from posting that message?
snippet of my code:
foo=Set_Status(0)
retval= GetMail(mailserver, username, password, delete_Flag, outputfileprefix)if Get_Status( ErrorText) then
abort=1 ;*put ErrorText into a log fileEnd
How can I keep that message from appearing?
Dave
At 02 JUL 2009 09:54AM Bob Orsini wrote:
Set_Status and Get_status are used to tell the program the prior function failed and why. It does not prevent the error messages within the function. In the case of getmail there is no way to prevent the error message at this time.
At 13 SEP 2012 09:05AM Dave Harmacek wrote:
Bumping this request since it is still a problem for batch processing.
We cannot have a message box appear when it is running in an unattended mode!
Dave Harmacek
Harmacek Database Systems
At 11 FEB 2013 08:43AM Dave Harmacek wrote:
Bumping this request again since it is still a problem for batch processing.
We cannot have a message box appear when it is running in an unattended mode!
Dave Harmacek
Harmacek Database Systems
At 11 FEB 2013 04:26PM Aaron Kaplan wrote:
Bumping this request again since it is still a problem for batch processing.
We cannot have a message box appear when it is running in an unattended mode!
Dave Harmacek
Harmacek Database Systems
I think you're going to have to do this the brute force way. There's a few different variations, depending on your needs, but they're basically all the same.
Write a custom MSG function that either checks for the literal message text of these messages or swaps out all the type fields to a suppress option.
Make sure it checks the return stack for CheckMail, so this only happens when you need it to.
Move $MSG to $MSG_RTI so you have a backup
Copy your $MSG_CUSTOM over $MSG
Brute hack, but it will have to do. I've done it once or twice before in similar circumstances.
There's a few things you could do with this. Add in a config record so it checks for certain program, so it can be generic as you need it. Altrenatively you could have it check a flag so a program could just call it.
But, you get the basic idea.
The more adventurous could try hacking the object code to change the message type to something else, but I wouldn't recommend that.
World leaders in all things RevSoft