Kaveh Hadjari
Kaveh Hadjari

Reputation: 237

Why does gmail connector trigger skips new incoming email

In one of my Logic Apps I'm using gmail connector trigger "when a new email arrives", but it doesn't seem to be working.

I'm sending email that it should detect when the trigger is run, but the trigger history simply shows the trigger is skipping and therefor not firing the rest of the workflow.

How can I debug this issue?

The following code is the trigger section of the logic app:

"triggers": {
        "When_a_new_email_arrives": {
            "description": "",
            "inputs": {
                "host": {
                    "connection": {
                        "name": "@parameters('$connections')['gmail']['connectionId']"
                    }
                },
                "method": "get",
                "path": "/Mail/OnNewEmail",
                "queries": {
                    "fetchOnlyWithAttachments": false,
                    "from": "[email protected]",
                    "importance": "All",
                    "includeAttachments": false,
                    "label": "INBOX",
                    "starred": "All",
                    "subject": "something"
                }
            },
            "recurrence": {
                "frequency": "Day",
                "interval": 1,
                "startTime": "2019-08-17T08:40:00Z"
            },
            "type": "ApiConnection"
        }
    }

It setup to runs ones every day, although for testing purposes I'm running the trigger manually.

Update 1

I've tried sending the mail from my own mail adress after configuring the from-parameter in the trigger and that works as intented. So I think the issue might be due to something about the senders original mail message. I did some digging, and pulled out the original raw mail from gmail. It contains some logging information from gmail servers. Appearently something called DMARC authentication have failed. I wonder if this has anything do the problem that is arising, maybe the gmail connector will not accept the senders identity.

Here's the part about DMARC in the raw mail message:

Authentication-Results: mx.google.com;
       spf=pass (google.com: domain of [email protected] designates 85.236.67.1 as permitted sender) [email protected];
       dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=source-company.com

Could this be the reason the connector does not detect these mails?

Upvotes: 0

Views: 602

Answers (1)

Hury Shen
Hury Shen

Reputation: 15734

for this issue I did some test but I haven't met this issue. In my logic app, I set the "How often do you want to check for items?" box as 10 minutes. I didn't run the trigger manually(I didn't click the "Run" button). Then I sent an email to my gmail, and after about 10 minutes, when the trigger went to check my gmail, the logic app run the actions under the trigger successfully. Apart from this, if I sent two emails to my gmail in these ten minutes, the trigger will not be triggered twice, it will be triggered just once. enter image description here

I saw you mentioned set once every day in your description. So for example, if you completed the configuration of the logic app at 1:00 pm, and your gmail received an email at 2:00 pm, it will not run the actions under the trigger at once. The trigger will check your gmail at 1:00 pm tomorrow, so the actions under the trigger will also run at 1:00 pm tomorrow. But when you test this logic app, if you run the logic app manually, when your gmail received an email, it will triggered at once.

I wonder if this explanation will be helpful to your issue ?

Upvotes: 1

Related Questions