Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webhook for sent-mail is not being received until any further activity on mail account (when the composed mail goes to draft box) #86

Closed
ts-chhavi opened this issue Oct 4, 2021 · 8 comments

Comments

@ts-chhavi
Copy link

Describe the bug
When we compose a mail from mail server, it becomes draft (auto-save), then on send, we receive the messageNew webhook for mail labelled as Draft and then for messageDeleted (that the drafted mail is deleted as we have sent it). But we do not receive the messageNew webhook for that mail on sent (with labelled Sent).

When some other activity occur on the mail account, then we receive the webhook for that old sent mail.

To Reproduce
Steps to reproduce the behaviour:

  1. Compose a mail
  2. Wait till it gets autosaved and become a draft mail
  3. Send the mail
  4. Check if messageNew event is received for sent mail or not.

Expected behaviour
On every mail sent (either drafted or non-draft), we should receive a webhook for it with updated label.

Screenshots
Pic 1 - (messageNew webhook with label DRAFT)
draft

Pic 2 - ( messageDeleted webhook for mail which we composed and sent)
delete

@ts-chhavi ts-chhavi changed the title Webhook for sent-mail is not being received until any further activity on mail account (when the composed mail goes to draft box)) Webhook for sent-mail is not being received until any further activity on mail account (when the composed mail goes to draft box) Oct 4, 2021
@andris9
Copy link
Collaborator

andris9 commented Oct 4, 2021

Which version of EmailEngine are you using?

@ts-chhavi
Copy link
Author

Which version of EmailEngine are you using?

v1.10.1

@andris9
Copy link
Collaborator

andris9 commented Oct 4, 2021

Please upgrade to the latest version (1.14.5) as this issue has been fixed already some time ago. Let me know if it's a different issue and it still does not work with the latest version of EmailEngine.

@andris9 andris9 closed this as completed Oct 4, 2021
@ts-chhavi
Copy link
Author

Please upgrade to the latest version (1.14.5) as this issue has been fixed already some time ago. Let me know if it's a different issue and it still does not work with the latest version of EmailEngine.

I checked with the latest version, still facing the issue where I am not receiving any webhook on sent for mail .

@andris9
Copy link
Collaborator

andris9 commented Oct 4, 2021

EmailEngine relies on the push notifications from the server for detecting new messages. For anything more specific I would need the IMAP transaction logs to see what the server actually sent to EmailEngine. Could you also try the same thing with a non-gmail/gsuite account because Gmail does some "magic" with "Sent" emails that other servers do not.

@andris9
Copy link
Collaborator

andris9 commented Oct 4, 2021

When I try the same scenario in Gmail, I do get the messageNew notification for the email stored in Sent mail folder (see labels: [ '\\Sent' ] value)

{
  account: 'example',
  date: '2021-10-04T16:33:28.470Z',
  path: '[Gmail]/All Mail',
  specialUse: '\\All',
  event: 'messageNew',
  data: {
    id: 'AAAAAQAANIw',
    uid: 13452,
    emailId: '1712707553113857157',
    threadId: '1712707539327868237',
    date: '2021-10-04T16:33:23.000Z',
    flags: [ '\\Seen' ],
    size: 577,
    subject: 'proov nr 2',
    from: { name: 'example.com Info', address: 'no-reply@example.com' },
    replyTo: { name: 'example.com Info', address: 'no-reply@example.com' },
    sender: { name: 'example.com Info', address: 'no-reply@example.com' },
    to: [ [Object] ],
    messageId: '<CAPwJw6uXM-zzEE2+aPXOtZ34xea61YQVJFFX0NSFmi7cS_a9OQ@mail.gmail.com>',
    labels: [ '\\Sent' ],
    text: { id: 'AAAAAQAANIyTkaExkaEykA', encodedSize: [Object] }
  }
}

Are you sure you are running the latest version? You can see the version number from the bottom of the UI


Screenshot 2021-10-04 at 19 35 27

@ts-chhavi
Copy link
Author

Yes, I am using the latest version now.
emailengne

Also, are you performing the same scenario? While composing, the mail gets auto-saved and then we receive messageNew webhook but with label draft.
For sent, I am still not getting the webhook.

@andris9
Copy link
Collaborator

andris9 commented Oct 4, 2021

Yes, I follow the the same scenario. You can see from the following that I get messageNew Draft webhook first, then messageDeleted for that draft and finally messageNew for the sent email. Without being able to reproduce I can't really do anything 🤷‍♂️

{
  account: 'example',
  date: '2021-10-04T16:45:40.638Z',
  path: '[Gmail]/All Mail',
  specialUse: '\\All',
  event: 'messageNew',
  data: {
    id: 'AAAAAQAANI0',
    uid: 13453,
    emailId: '1712708322492126598',
    threadId: '1712708322492126598',
    date: '2021-10-04T16:45:37.000Z',
    flags: [ '\\Seen' ],
    size: 577,
    subject: 'proov nr 4',
    from: { name: 'example.com Info', address: 'no-reply@example.com' },
    replyTo: { name: 'example.com Info', address: 'no-reply@example.com' },
    sender: { name: 'example.com Info', address: 'no-reply@example.com' },
    to: [ [Object] ],
    messageId: '<CAPwJw6uz+FbBGWFRtpdF=+8J8Jve4i7oh9XSxEDz7yGnyO_qpw@mail.gmail.com>',
    labels: [ '\\Draft' ],
    text: { id: 'AAAAAQAANI2TkaExkaEykA', encodedSize: [Object] }
  }
}
{
  account: 'example',
  date: '2021-10-04T16:45:50.688Z',
  path: '[Gmail]/All Mail',
  specialUse: '\\All',
  event: 'messageDeleted',
  data: { id: 'AAAAAQAANI0', uid: 13453 }
}
{
  account: 'example',
  date: '2021-10-04T16:45:51.770Z',
  path: '[Gmail]/All Mail',
  specialUse: '\\All',
  event: 'messageNew',
  data: {
    id: 'AAAAAQAANI4',
    uid: 13454,
    emailId: '1712708333008828225',
    threadId: '1712708322492126598',
    date: '2021-10-04T16:45:47.000Z',
    flags: [ '\\Seen' ],
    size: 577,
    subject: 'proov nr 4',
    from: { name: 'example.com Info', address: 'no-reply@example.com' },
    replyTo: { name: 'example.com Info', address: 'no-reply@example.com' },
    sender: { name: 'example.com Info', address: 'no-reply@example.com' },
    to: [ [Object] ],
    messageId: '<CAPwJw6v=A0LXxBFAbXDhqM-RvsOupAUeZdr--3TPTuzvLLH6yQ@mail.gmail.com>',
    labels: [ '\\Sent' ],
    text: { id: 'AAAAAQAANI6TkaExkaEykA', encodedSize: [Object] }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants