Some hints for docker newbies and imap

hi all,
I was about to stop using n8n as I was frustrated by docs not being detailed, errors not fully documented, …etc. it’s free so, nothing to complain about. it is what it is and it’s not easy to make it what it is, and it is open and costs nothing.

but I succeeded. so if you read this hopefully it will help you out if you search for answers in the forum, if you are looking for any basic help on the topics below.

my platform:
self hosted using docker compose v3
on arm ubuntu server latest

issues encountered and solutions:

user with which to run n8n: for some odd reason using format “uid:gid” works better than specifying the name

volumes (n8n not saving, n8n not reading files, and similar):

declaring binds like - /my/local/folder:/my/container/folder …did not work for me.
I however created external volumes with docker
docker volume create n8n_data --opt type=none --opt o=bind --opt device=/my/local/folder/n8n_data
and then declared them in compose like this

within the n8n service:
- n8n_data:/my/container/folder

at the end of the yml:

 volumes:
      -  n8n_data:
           external: true

IMAP email trigger not processing always emails / not starting as expected

if you test and the workflow does not get triggered sometime/most of the time/always:
remove* all mail forwards defined in the email and the related clients. does not matter if the cloud mail rules mark as read or not the mail. you can recreate those within n8n with send mail and other rules

  • make sure the label of your mailbox is the one the imap reader is fetching
  • explicitly set reconnect after
  • set up an error workflow that deactivates and then reactivates the imap mail processing workflow in case connection is cut and the workflow does not resume activities

other general tips (feel free to comment)
stop and start y

  • stop and start your n8n docker instance via cron to respring it ( and validate error recovery methods )

  • you can back up n8n workflows and credentials with a workflow within n8n, running cli commands as per documentation. just put the plain n8n command without the docker exec part in the execute shell command action. this solves the issues you could encounter if you have a backup script outside n8n, and receive an error message stating that the port is already in use.

hope this helps