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

Gmail - keeps downloading same new message every 5-10 mins #32

Closed
Rathna-K opened this issue Feb 3, 2013 · 1 comment
Closed

Gmail - keeps downloading same new message every 5-10 mins #32

Rathna-K opened this issue Feb 3, 2013 · 1 comment

Comments

@Rathna-K
Copy link

Rathna-K commented Feb 3, 2013

Below is the vb.net code I am using. the OnNew Message fires for the same message over an over again (randomly 5 -15 mins gap). Is there something wrong in my code?
VB .NET:

Form Load:
If mClient.Supports("IDLE") Then
AddHandler mClient.NewMessage, AddressOf mcOnNewMessage
End If

Public Sub mcOnNewMessage(ByVal sender As Object, ByVal e As IdleMessageEventArgs)

       OnNewMessage(sender, e)
End Sub

Private Delegate Sub dOnNewMessage(ByVal sender As Object, ByVal e As IdleMessageEventArgs)

Public Sub OnNewMessage(ByVal sender As Object, ByVal e As IdleMessageEventArgs)

    If Me.InvokeRequired Then

        Me.Invoke(New dOnNewMessage(AddressOf OnNewMessage), sender, e)

        Exit Sub

    End If

    Try

        Dim m As MailMessage = sender.GetMessage(e.MessageUID)

        Log("New Mail From : " & m.From.Address.ToString & "Subject: " & m.Subject.ToString)

    Catch ex As Exception

        Log(ex.Message)

    End Try

End Sub
@smiley22
Copy link
Owner

smiley22 commented Feb 3, 2013

Some servers seem to send an additional EXISTS notification after each EXPUNGE notification. Not sure why they would do that, but I guess this is the problem.

I have pushed a new version that addresses this issue. Please try and see if it solves your problem.

cheers,
smiley22

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