Email Read IMAP Node works sometimes

Hi Everyone,

I have set up the ‘Email Read IMAP’ node to ‘watch’ an office 365 folder for incoming emails. About 50% of the time when a new email comes in the node triggers correctly and the new email is marked as read which is fine. But the other 50% of the time the node does not trigger and the emails remain marked as unread.

To rectify this I then deactivate and then re-activate the workflow and the emails are marked as read and the node triggers correctly.

Could someone please suggest what might be going on please?

Thank you!

Paul

Sadly not. Do you have any more information when that happens?

Like is it only a problem when n8n restarts or does it also happen when it is already running. If the later, does that normally then start to happen after a certain amount of time and if so how long around? Does it stop working after it got triggered by an email and then stops working or could can it also be the very first one? …?

Literally anything could be helpful to figure out what could be going wrong there.

Hi Jan,

I am using a vultr virtual server and n8n is running 24/7 and I would say adding fail2ban helped keep the server from crashing and at the same time we added n8n as a service so if a restart did take place n8n would be working straight away. Before those changes the server was crashing about once a day and needed to be restarted. I find the imap email node works for about a day at a time so could it be a server restart is causing the imap node to not pick up on the new emails. Does this help you at all?

Kind regards

Paul

Hey @Paul_Clarke,
From your last post, it is sounding like your n8n server may be under attack. fail2ban is a very good start but it’s focus is SSH. Your other ports are probably still wide open with limited security on them.

A few ideas to help you along:

  1. Set up a VPN or SSH tunnelling to the server to provide encrypted, limited access to the actual n8n installation
  2. Set up a firewall to limit and restrict access to only internal connection (127.0.0.1/localhost)
    • If using webhooks, limit access to the webhook to only the services that require the service. This can be done from the firewall based on specific IP ranges
  3. Disable ping responses from your server

I realize that none of these things are specifically n8n related but it is important to ensure that you server is safe first before moving on to troubleshooting specific services. Otherwise, you are battling every single person on the internet who decides they want to run the latest exploit tool against a range of addresses.

Hope this helps.