Acknowledgement email is not generated for email-created HD Tickets (Helpdesk v1.30.1 / Frappe v16)

Hi,

I am seeing an issue with the built-in Helpdesk acknowledgement email.

Environment

  • Frappe Framework v16
  • Frappe Helpdesk v1.30.1
  • Hosted on Frappe Cloud
  • Custom IMAP/SMTP Email Account
  • Incoming mailbox configured with:
    IMAP INBOX → Append To = HD Ticket

Expected behaviour
When a completely new incoming email creates a new HD Ticket,
the configured acknowledgement email should automatically be sent
to the ticket requester.

Actual behaviour
The HD Ticket is created successfully, but no acknowledgement email
is generated or sent.

What works correctly

  • Incoming emails are fetched correctly
  • New emails create HD Tickets correctly
  • Automatic assignment works
  • Assignment notification emails are sent
  • Agent replies are sent successfully
  • Customer replies return to the correct HD Ticket
  • CRM email threading using the same Email Account also works
  • SMTP and IMAP are therefore working correctly

Helpdesk settings

  • Acknowledgement is enabled
  • Acknowledgement content is configured
  • Skip Email Workflow = disabled
  • Tested with “Send Email Immediately” both disabled and enabled
  • Behaviour is identical

Diagnostics
For affected tickets:

  • via_customer_portal = 0
  • raised_by contains the correct sender email
  • email_account references the correct Email Account
  • send_acknowledgement_email = 1 in both database and cache
  • skip_email_workflow = 0 in both database and cache
  • No Email Unsubscribe entry exists for the sender

I also tested:

  • known/existing sender
  • completely unknown/new sender
  • static acknowledgement text without Jinja

Same result in all cases.

Manual test
Calling:

ticket.send_acknowledgement_email()

from System Console completes without an exception,
but still does not create an Email Queue entry and no email is sent.

Email Queue
When filtering the Email Queue for the affected HD Ticket,
I only see the internal assignment notification to the assigned agent.
There is no queue entry addressed to the ticket requester.

This seems to indicate that the acknowledgement email is not being
created at all, rather than failing at SMTP delivery.

Has anyone seen the same behaviour on Helpdesk v1.30.1 / Frappe v16?

I would prefer to use the native Helpdesk acknowledgement workflow
instead of creating a separate Notification as a workaround.

Thanks!

Solved – root cause found

I was able to identify the cause.

The issue was not related to SMTP, IMAP delivery, Helpdesk settings, or the acknowledgement template itself.

The important detail was the IMAP folder state:

IMAP Folder.uidvalidity = NULL

IMAP Folder.uidnext = NULL

The mail server itself returned valid values, and Frappe was also able to parse them correctly.

The problem was caused by several old test emails that were still present in the INBOX and had been sent from the same email address that was also configured as the incoming Email Account.

These test emails were not normal reply emails.

During the initial IMAP sync, Frappe identifies this kind of message as SentEmailInInboxError.

The sequence was effectively:

IMAP Folder.uidvalidity = NULL

→ Frappe starts an initial sync

→ frappe.flags.initial_sync = True

→ current UIDVALIDITY is written

→ self-sent test email triggers SentEmailInInboxError

→ transaction is rolled back

→ UIDVALIDITY remains NULL

On the next fetch, the same thing happens again.

This is important for Helpdesk because the native acknowledgement email is skipped while:

frappe.flags.initial_sync

is set.

That explains why:

  • HD Tickets were still created successfully
  • incoming and outgoing email worked
  • agent notifications worked
  • no acknowledgement Email Queue entry was created
  • no useful error appeared in the Error Log

Resolution

I archived the old self-sent test emails from the INBOX and then sent a new normal test email from another address.

After that, the IMAP folder state was persisted correctly and the native Helpdesk acknowledgement email started working again.

No custom Notification, Server Script, or Custom App was required.

If anyone runs into the same issue, I would recommend checking:

IMAP Folder.uidvalidity

If it remains NULL, also check whether the INBOX contains old test emails that were sent from the same address as the configured incoming Email Account.