#Mails don't show up for contacts or companies

1 messages · Page 1 of 1 (latest)

uneven inlet
#

I've one issue with email syncing to contacts in my podman installation of twenty in version v1.1.1 - which I installed from scratch, so no migration issue.

The system seems to run flawlessly:

  • health status is green for every service,
  • active sync shows "1"
  • metadata version is set correctly and
  • no errors in the container logs

I enabled IMAP and was able to add an imap mail account to one of the users. The mail account shows synced after a while and in the logs I get the correct number of mails. But:

  • Mails don't get assigned to their respective contacts (email-addresses match)
  • no contacts get created when sending a mail or receiving a mail (option in mail accounts is set to "sent and received")

What have I done to debug:

  • increased the log level to log all, incl. debug (no issues seen)
  • checked the database
  • flushed the cache
  • tested the webhook functionality to ensure the worker container runs without issues
  • redeployed from scratch

How to get the emails to show up for my contacts or companies?

Thanks in advance for your support.

Best, Stefan

#

Mails don't show up for contacts or companies

uneven inlet
#

Follow up of my question (as post was too long):

environment of the worker container:
/app/packages/twenty-server $ env
EMAIL_SMTP_PORT=465
NODE_VERSION=22.17.0
MESSAGING_PROVIDER_IMAP_ENABLED=True
YARN_VERSION=1.22.22
IS_IMAP_SMTP_CALDAV_ENABLED=True
REACT_APP_SERVER_BASE_URL=
[email protected]
SHLVL=1
HOME=/home/node
DISABLE_CRON_JOBS_REGISTRATION=true
PG_DATABASE_URL=postgres://myuser:password@postgres-pod:5432/db_twenty
IS_CONFIG_VARIABLES_IN_DB_ENABLED=true
container=podman
EMAIL_SMTP_password=secret-password
STORAGE_TYPE=local
EMAIL_SMTP_NO_TLS=False
TERM=xterm
APP_SECRET=very-secret-secret
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
[email protected]
DISABLE_DB_MIGRATIONS=true
EMAIL_FROM_NAME=mycompany
EMAIL_DRIVER=smtp
SERVER_URL=https://crm.mydomain.net
PWD=/app/packages/twenty-server
EMAIL_SMTP_HOST=mail.mydomain.net
EMAIL_SMTP_USER=smtp-user
REDIS_URL=redis://redis-pod:6379
APP_VERSION=v1.1.1

queen kestrel
#

Hello, that's an interesting case 🤔
Could you check if mails are in database and also if there are messageParticipants? It can be done via API as well

#

Just to explain all message related things:

  • messageChannel is connected account which is available in Settings > Emails
  • messageThread contains all messages in thread
  • messageParticipant is a user(s) with whom thread has been created
  • message is just a message
  • messageChannelMessageAssociations maps messages from account's thread to Twenty's messageThreads
uneven inlet
#

Hi Bob, thanks for the detailed information. I checked for messages and messageParticipants, both are empty.

My assumption here was, that my mails are not added because there are no participants they could be assigned to.

In the meanwhile I also already opened an issue in the projects Github (#13397). Neo told me to wait for the next tagged release of Twenty as there will be a lot of changes for the IMAP module.

clever yew
#

Hey @uneven inlet indeed a lot of fixes also regarding the impa connection about to be released in 1.2.0 during the day

uneven inlet
#

That sounds promising 🙂 Thanks for sharing this information

clever yew
#

My pleasure, will let you know here ! ( if I remember to 😛 )

uneven inlet
#

@clever yew , @queen kestrel , now it's getting weird:
I updated to Twenty v1.2.1 now and afterwards recreated the mail connections. Still no mails or contacts showed up.

The I stopped the containers, deleted the contents of the data directory and dropped the contents of the "db_twenty" postgres db.

When starting the twenty server container it did not automatically start creating the schemas and contents. So I logged in to the container and issued "yarn database:init:prod". Afterwards the schemas had been available as "core" and "workspace_[id]". To be on the save side I restarted the server container and after the initialization was finished I started the worker container.

I'm now able to log in and work with the CRM. Two issues:
1st issue: invitations are not sent anymore via mail ("Error: Mail command failed: 503 5.5.1 You must authenticate first"). This worked like a charm in v1.1.1) and the settings are the same as before the recreation of the database (the setup is done via ansible, so completely reproducable).

2nd issue (same as with v1.1.1): I also was able to create the IMAP, SMTP and Caldav connection. Again the logs confirm that the fetching of the mails works and show the correct number of messages. But again no messages are being added to the respective database tables.

Any idea?

Thanks in advance for your support,

Best, Stefan

clever yew
#

Hey Stefan,
Could you please have a look to this when you have some free time @remote copper?

untold patrol
#

I am here because we hare facing the same issue. Is there something we can do?

remote copper
#

Thanks for the report. @pallid light will look into this!

uneven inlet
#

That sound good, thanks a lot.

remote copper
#

Neo merged a fixed which will be in the next release (or is on main but not tagged yet)

uneven inlet
#

Perfect, thanks. I will wait for the next release then - which will come soon hopefully 🙂 (probably as hotfix? 😉 )

remote copper
#

unfortunately no sorry, we have other breaking changes on main so we'll wait end of next week for the next big release

uneven inlet
#

@remote copper , @pallid light

fyi:

Not yet officially released, but I already tried with a fresh install of version 1.3.2. (I needed to start off with setting up 1.2.0 first - as there is currently a bug in the latest version (#13676 with PR already created for fixing this) that registration of new users doesn't work. Afterwards I directly migrated to 1.3.2).

Current behaviour:

  • Contacts from caldav calendar events are being created, appointments are available in the calendar view
  • Still no mails available in respective database tables.
  • Error when trying to open health status for worker (Queue-Informationen sind nicht verfügbar, weil der Worker ausgefallen ist) means: queue information not available as worker is not running/accessible.
remote copper
#

Thanks @uneven inlet! Did you start the worker separately? Do you have logs for the worker?

#

(yarn worker:prod)

#

Well my question is dumb, if you say that calendar events are created that means you did

#

I'm looking at WorkerHealthIndicator to understand what could lead to this message and it seems we took into account the failure rate (% of job failed)

#

So in that case the logs would be very helpful, it means you probably have failed jobs that throw errors

uneven inlet
#

I didn't find anything about "WorkerHealthIndicator" in the logs, even with debug_mode=true.

I restarted the container, please find attached the respective logs. Hopefully it's halfways helpful.

uneven inlet
rancid otter
uneven inlet
#

That leaves me with one open point - that's the not created messages/mails :/

rancid otter
#

did you run the cron jobs?

uneven inlet
#

As I'm using the docker images, the cron jobs should be triggered automatically within the container, right? And the checking for mails is also logged every 5 minutes.

rancid otter
#

Cron job registration is disabled, skipping... -- your logs show the auto registeration is not enabled

uneven inlet
#

If I recall it correctly, I set it up according to the documentation - where the DISABLE_CRON_JOBS_REGISTRATION=false is for the twenty-server container and DISABLE_CRON_JOBS_REGISTRATION=true for the worker. Did I get that wrong?

rancid otter
#

ah thats workers logs, which means thats the correct behavior 🙂 sorry mb

uneven inlet
remote copper
#

@pallid light could you please check?

pallid light
#

@uneven inlet Your worker logs indicate it only found 2 messages, could you confirm that?

#

Are you self hosting the email server or using a cloud hosted solution like hetzner email?

uneven inlet
#

@pallid light , good point, there are indeed more than two mails in my INBOX and also in the "Sent Items" folder. And there is also no other folder containing only two messages.

I'm hosting my own mailserver (Stalwart, version v0.13.1).

What I find interesting about your logs is, that the INSERT sql statement is part of the logs. Is this missing for me, as the INSERT isn't triggered or is there a trick to get the SQL statements logged? As per my understanding, I turned on all possible log levels already?

uneven inlet
#

I checked the imap server capabilities:

* OK [CAPABILITY IMAP4rev2 IMAP4rev1 ENABLE SASL-IR LITERAL+ ID UTF8=ACCEPT JMAPACCESS AUTH=PLAIN AUTH=OAUTHBEARER AUTH=XOAUTH2] Stalwart IMAP4rev2 at your service.

Just in case you need it 😉

pallid light
#

@uneven inlet

uneven inlet
#

@pallid light , no, I'm not. What prerequisits do you need? I can create an account for you for debugging, if you want/need it. I can also configure settings as per your needs.

pallid light
uneven inlet
#

Kindly tell me how I can reach you directly. In the meanwhile I start creating an account.

pallid light
uneven inlet
#

@pallid light , thanks a lot for your intensive support.

I just installed the latest released version 1.4.0 from scratch, now the initial sync works, finally I find new contacts and companies added for sent and received mails - and also the mails (from inbox and also sent items) are visible for the contacts

However, during further testing I sent a mail to a new contact, but this one doesn't get created. In the workers logs I find:

[Nest] 29 - 08/21/2025, 5:02:00 PM WARN [ImapGetMessagesService] Message [email protected] could not be parsed - likely not found in current folders.

When adding a second account I saw, only one out of twenty of the mails got parsed and added to the messages db table. All others also ended up with a log record like the one seen above.

Any ideas?

winter spruce
#

Interesting, the IMAP feature is quite new and we might have missed some edge cases. Mailbox standard is poorly normalized and all vendors are implementing standards as they want :p could you please open an issue on Github and we will work on that