Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


thomas
2022-08-18T07:02:33Z
After countless hours I managed to get this to work. I post it here if anybody else is struggling.

First a few things that didn't work for me

1) Using office365 connections. They cannot be used with smtp at least, as they don't show up in the connection list when sending emails. I guess that is intentional

2) Using the dedicated SMTP or IMAP connection types with Microsoft azure oath. The connection contacts the google api, even though server is set to smtp.office365.com. I asked on the forum why this is the case, but haven't received an answer yet.

Using EWS connection is the only connection type that works for me.

Set up an app, application type web:

image.png

I am not sure about the necessity of the Id token checkbox, but it works.

Under api permissions, this is the missing piece:

image.png

All the permissions above are probably unnecessary. The one in yellow is what solved the puzzle. Click on add a permission, and go here:

image.png

Hope this helps somebody. I will remove the unneeded permission later today to find out what is strictly needed

Thomas
Sponsor
Forum information
thomas
2022-08-18T10:54:34Z
I have checked now, and as far as I can see, full_access_as_app, is the only permission needed. More info here:

https://www.michev.info/...-api-permissions-missing 

Michael Fjellström
2022-08-18T11:56:26Z
Originally Posted by: thomas 

After countless hours I managed to get this to work. I post it here if anybody else is struggling.

First a few things that didn't work for me

1) Using office365 connections. They cannot be used with smtp at least, as they don't show up in the connection list when sending emails. I guess that is intentional

2) Using the dedicated SMTP or IMAP connection types with Microsoft azure oath. The connection contacts the google api, even though server is set to smtp.office365.com. I asked on the forum why this is the case, but haven't received an answer yet.

Using EWS connection is the only connection type that works for me.

Set up an app, application type web:

image.png

I am not sure about the necessity of the Id token checkbox, but it works.

Under api permissions, this is the missing piece:

image.png

All the permissions above are probably unnecessary. The one in yellow is what solved the puzzle. Click on add a permission, and go here:

image.png

Hope this helps somebody. I will remove the unneeded permission later today to find out what is strictly needed

Thomas



We have just made some adjustments related to this in our latest beta, but you mean it works for you now in 9.9.8 both to send emails and read them? Both IMAP and smtp functionalities that is via the EWS connector?

Also, the reason why the IMAP connector only connects to google is because at the moment it only supports google, something we are adjusting/fixing for the upcoming version.
thomas
2022-08-18T12:15:28Z
Yes that is correct. EWS seems to work for both sending and reading. Also, I remember from som threads that people were struggling to set the correct permissions in azure. This was the missing bit in may case anyway. The permissions needed for EWS are not related to Microsoft Graph. Glad to hear that you are working on microsoft api for futire releases! EWS will be deprecated in the future (no date set yet) so this is a temporary solution, but it should be good for at least a year I think. We are on version 9.9.5


thomas
Michael Fjellström
2022-08-18T12:54:32Z
Originally Posted by: thomas 

Yes that is correct. EWS seems to work for both sending and reading. Also, I remember from som threads that people were struggling to set the correct permissions in azure. This was the missing bit in may case anyway. The permissions needed for EWS are not related to Microsoft Graph. Glad to hear that you are working on microsoft api for futire releases! EWS will be deprecated in the future (no date set yet) so this is a temporary solution, but it should be good for at least a year I think. We are on version 9.9.5


thomas



We've given this particular permission to multiple customers via support (full access) but it did not matter as far as SMTP goes, IMAP worked yes, but microsoft had changed a property name or similar that we had hardcoded so we have had to make changes in the beta build which is why I find it odd you got it working, but being on 9.9.5 might explain it somewhat. You think you would be able to download a trial in a new VM/machine and test your connection on 9.9.8?
Michael Fjellström
2022-08-18T12:58:17Z
Originally Posted by: thomas 

Yes that is correct. EWS seems to work for both sending and reading. Also, I remember from som threads that people were struggling to set the correct permissions in azure. This was the missing bit in may case anyway. The permissions needed for EWS are not related to Microsoft Graph. Glad to hear that you are working on microsoft api for futire releases! EWS will be deprecated in the future (no date set yet) so this is a temporary solution, but it should be good for at least a year I think. We are on version 9.9.5


thomas



Also, could you please share your visualcron connection settings, including encryption settings etc?
thomas
2022-08-18T12:58:54Z
Aha. Well that means we cannot upgrade from 9.9.5 i guess, until the dedicated SMTP connections work with the Macrosoft api. I can try to test the newest beta in our test environment in the weekend maybe. Too many things happeing at worl right now 🙂
Michael Fjellström
2022-08-18T13:16:34Z
Originally Posted by: thomas 

Aha. Well that means we cannot upgrade from 9.9.5 i guess, until the dedicated SMTP connections work with the Macrosoft api. I can try to test the newest beta in our test environment in the weekend maybe. Too many things happeing at worl right now :)



I understand, thank you for the information!
thomas
2022-08-18T19:27:39Z
I just tested with 9.9.9 beta version. smtp works, but imap fails unfortunately. The opposite of what you expected, but still, we will have to roll back for now.
thomas
2022-08-18T20:31:34Z
Michael Fjellström
2022-08-19T11:34:29Z
Originally Posted by: thomas 

settings for smtp

image.png

image.png

image.png

no proxy



Thanks a lot thomas, this is exactly what was updated in the latest beta build, so yours can be used as a workaround for those who don't want to update to a beta build. Basically you should just need to use one ews connection for imap and smtp

Exchange EWS has URI being a server name

so when it's used to send email it was a server address replacement done in the code, and we've adjusted the server address.

So the workaround is to use two separate ews connectors for now, one for imap, one for smtp.
thomas
2022-08-19T11:56:01Z
Thanks Michael

Just to make sure I understand: In 9.9.9 beta, we would need only one EWS connection for both imap and smtp? Would server adress be outlook.office365.com, and port 993 for both then?

I can test again in 9.9.9. Maybe I missed something when I tested yesterday
thomas
2022-08-20T21:32:04Z
I tried in 9.9.9 again. When I click on button to select foler, I get this message:

image.png
Michael Fjellström
2022-08-22T14:16:17Z
Originally Posted by: thomas 

I tried in 9.9.9 again. When I click on button to select foler, I get this message:

image.png



Thank you, we are aware and releasing a fixed build shortly.
Michael Fjellström
2022-09-16T14:42:34Z
Hi,

Exchange EWS Oauth has been fixed now in our latest beta build which you can download here:  https://www.visualcron.c...aspx?g=Posts&t=10689 

Here is the full, updated documentation for setting it up. Please follow the instructions there: https://www.visualcron.c...HTML/connection-ews.html 
hjohnson
2022-10-27T01:03:44Z
Originally Posted by: thomas 

I tried in 9.9.9 again. When I click on button to select foler, I get this message:

image.png



Hi thomas

I am wondering if you are successfully using 9.9.10 with a single Exchange EWS connection and OAuth to fire a mail trigger and forward the email? If you would also be willing to post your EWS connection settings for checking mail (email trigger) and for forwarding mail. Thank you
nbpUsr
2022-10-28T10:43:10Z
Hi

Back from holiday now.

Unfortunately it is no longer possible to upload images to this forum (for me alt least). Are you able to upload your settings? If so we can have a look.
By the way, when you click on the test button for you connection, do you get a success message?

Thomas
nbpUsr
2022-10-28T11:58:25Z
On thing we found just now: In 9.9.5 the mailbox path in the trigger was INBOX/Something. We had to manually change it to Inbox/Something. Maybe the new VC version is case sensitive, who knows. Anyway, the triggers work for us, but are unstable. They switch after a coutple of hours. We have created a separate job that turns them on, as soon as they are turned of. It is a temporary hack we hope

Croth Unknown
2022-10-28T15:44:27Z
Originally Posted by: nbpUsr 

Hi

Back from holiday now.

Unfortunately, it is no longer possible to upload images to this forum (for me alt least). Are you able to upload your settings? If so we can have a look.
By the way, when you click on the test button for you connection, do you get a success message?

Thomas



Hi Thomas

Thank you for the reply. I am a coworker with hjohnson and I am assisting in working with cron and EWS. Using this EWS connection we are able to successfully send a test message using the test button. sometimes the mail trigger works in testing, and we can see in the monitored mailbox that a message which triggered the mail trigger does appear as being "read" by cron, but the message is never forwarded by cron. The mail trigger is also VERY unreliable. We are attempting to use this same EWS connection to trigger the cron job and to forward

I am also not able to upload images to the forum. I will attempt to explain the configuration we are using below. Thank you again for taking a look at this!


<Exchange EWS Connection>
<Exchange EWS Connection><Common Settings>
<Exchange EWS Connection><Common Settings><Protocol type> = "Exchange EWS"

<Exchange EWS Connection>
<Exchange EWS Connection><Connection Settings><Main Settings>
<Exchange EWS Connection><Connection Settings><Main Settings><Server><Address> = "https://outlook.office365.com/EWS/Exchange.asmx"
<Exchange EWS Connection><Connection Settings><Main Settings><Server><Port> = "443"

<Exchange EWS Connection><Connection Settings><Main Settings><Credentials><Authentication type> = "OAuth"
<Exchange EWS Connection><Connection Settings><Main Settings><Credentials><Application Id> = "Id of Azure application"
<Exchange EWS Connection><Connection Settings><Main Settings><Credentials><Client secret> = "client secret created for Azure application
<Exchange EWS Connection><Connection Settings><Main Settings><Credentials><Email> = "fully qualified email address of mailbox"

<Exchange EWS Connection><Connection Settings><Main Settings><App settings><Redirect Url> = "http://localhost:9999"
<Exchange EWS Connection><Connection Settings><Main Settings><App settings><Tenant Id> = "Id of our Azure tenant"
<Exchange EWS Connection><Connection Settings><Main Settings><App settings><Tenant Name> = "Name of our Azure tenant"
<Exchange EWS Connection><Connection Settings><Main Settings><App settings><Tenant Primary Domain> = "Primary domain name of our tenant"

Encryption is TLS
No Proxy
nbpUsr
2022-10-28T16:21:17Z
Hi

We haven't tried forwarding unfortunaltely. We only use to download attachements. I can do a quick test next week.

We have a few differences in the config. We use port 993 and the adress is outlook.office365.com, and not https://outlook.office365.com/EWS/Exchange.asmx  as you have. Apart from that it is the same. You could try this and see if it makes any difference

Thomas
nbpUsr
2022-10-31T08:21:41Z
Hi

I just tried forwarding an email, and it didn't work. The trigger fires and the email is marked as read, but no email is forwarded. Looks like a bug

Thomas
Michael Fjellström
2022-11-08T10:36:47Z
Originally Posted by: nbpUsr 

Hi

I just tried forwarding an email, and it didn't work. The trigger fires and the email is marked as read, but no email is forwarded. Looks like a bug

Thomas



Hi,

I've reported this to the developers. I will let you know when we have an update on this.
Croth Unknown
2022-11-10T20:55:33Z
Originally Posted by: nbpUsr 

Hi

We haven't tried forwarding unfortunaltely. We only use to download attachements. I can do a quick test next week.

We have a few differences in the config. We use port 993 and the adress is outlook.office365.com, and not https://outlook.office365.com/EWS/Exchange.asmx  as you have. Apart from that it is the same. You could try this and see if it makes any difference

Thomas



Thank you for the reply!

I believe port 993 is for IMAP which I believe can only be used for "Reading" mail and not "Sending" mail. To "Send" mail I believe you need to use SMTP and STARTTLS which is port 587. Here is from Microsoft about halfway down the page. https://learn.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/pop3-and-imap4/pop3-and-imap4 

Protocol Server Name Port
POP3 Outlook.office365.com 995
IMAP4 Outlook.office365.com 993
SMTP Outlook.office365.com 587
thomas
2022-11-11T07:55:41Z
Hi

Thanks, you are right. Email is an outdated and confusing technology 🙂 We have switched to server https://outlook.office365.com/EWS/Exchange.asmx  and port 443 now, but the results are basically the same. We can send emails and use triggers, but triggers are unstable for us. Seems like it is working for most people now though, which is good.
Michael Fjellström
2022-11-11T10:19:29Z
Originally Posted by: thomas 

Hi

Thanks, you are right. Email is an outdated and confusing technology 🙂 We have switched to server https://outlook.office365.com/EWS/Exchange.asmx  and port 443 now, but the results are basically the same. We can send emails and use triggers, but triggers are unstable for us. Seems like it is working for most people now though, which is good.



Thomas,

In what way are the triggers unstable? Do you notice a clear pattern on how long they stay active/when they get de-activated?
Scroll to Top