# Email gets generated but ticket doesn't (sometimes)

**URL:** https://community.zammad.org/t/email-gets-generated-but-ticket-doesnt-sometimes/10753
**Category:** Technical assistance
**Created:** [January 16, 2023, 10:37am UTC](https://community.zammad.org/t/email-gets-generated-but-ticket-doesnt-sometimes/10753 "2023-01-16T10:37:25Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![letmesetupthis](https://community.zammad.org/letter_avatar_proxy/v4/letter/l/ecc23a/32.png) [@letmesetupthis](https://community.zammad.org/u/letmesetupthis)
#### Post date: [January 16, 2023, 10:37am UTC](https://community.zammad.org/t/email-gets-generated-but-ticket-doesnt-sometimes/10753/1 "2023-01-16T10:37:25Z")

</div>

### Infos:

- Used Zammad version: .3.0-1670595017.1c7d44aa.focal
- Used Zammad installation type: package
- Operating system: Ubuntu 20.04
- Browser + version: chrome 109.0.5414.75

### Expected behavior:

Customer sends an E-Mail to our support-email → he gets an automated answer email and a new ticket is opened.

### Actual behavior:

Only the answer email is sent out.

### Steps to reproduce the behavior:

send an email to our support-mail.  
sometimes it works and both is done. sometimes only the automated response is sent.

---

<div class="post-metadata">

### Author: ![MrGeneration](https://community.zammad.org/user_avatar/community.zammad.org/mrgeneration/32/9260_2.png) [@MrGeneration](https://community.zammad.org/u/MrGeneration)
#### Post date: [January 23, 2023, 3:14pm UTC](https://community.zammad.org/t/email-gets-generated-but-ticket-doesnt-sometimes/10753/2 "2023-01-23T15:14:17Z")

</div>

Please note that Zammad 5.3.0 is prune to security issues, you may want to upgrade the installation asap.

* * *

Your issue is a classical missing permission topic.  
If Zammad sends out the trigger based email, the ticket definitely has been created before hand.

Ensure the user in question has the needed group permissions to view the ticket in question.  
See: [Group Access Levels — Zammad documentation](https://admin-docs.zammad.org/en/latest/manage/groups/access-levels.html)

---

<div class="post-metadata">

### Author: ![letmesetupthis](https://community.zammad.org/letter_avatar_proxy/v4/letter/l/ecc23a/32.png) [@letmesetupthis](https://community.zammad.org/u/letmesetupthis)
#### Post date: [February 10, 2023, 1:01pm UTC](https://community.zammad.org/t/email-gets-generated-but-ticket-doesnt-sometimes/10753/3 "2023-02-10T13:01:20Z")

</div>

I updated to “5.3.1-1674475260.6b8ca02d.focal” we have the same issue, since we got a new ticket form the same customer, which then generate dan email in zammad, but there was no ticket created. It works.  
for other customers.

---

<div class="post-metadata">

### Author: ![MrGeneration](https://community.zammad.org/user_avatar/community.zammad.org/mrgeneration/32/9260_2.png) [@MrGeneration](https://community.zammad.org/u/MrGeneration)
#### Post date: [February 23, 2023, 9:43pm UTC](https://community.zammad.org/t/email-gets-generated-but-ticket-doesnt-sometimes/10753/4 "2023-02-23T21:43:22Z")

</div>

Possibly you use the same mailbox on two systems -OR- you have unprocessible mail. Check your monitoring endpoint to double check.

However, your initial message stated that you do receive a notification mail, this indicates a permission issue.

---

<div class="post-metadata">

### Author: ![letmesetupthis](https://community.zammad.org/letter_avatar_proxy/v4/letter/l/ecc23a/32.png) [@letmesetupthis](https://community.zammad.org/u/letmesetupthis)
#### Post date: [March 10, 2023, 10:04am UTC](https://community.zammad.org/t/email-gets-generated-but-ticket-doesnt-sometimes/10753/5 "2023-03-10T10:04:43Z")

</div>

I still have this problem and I don’t use the same email address on another system. what can I run on zammad to check where it fails?

---

<div class="post-metadata">

### Author: ![MrGeneration](https://community.zammad.org/user_avatar/community.zammad.org/mrgeneration/32/9260_2.png) [@MrGeneration](https://community.zammad.org/u/MrGeneration)
#### Post date: [March 29, 2023, 1:06pm UTC](https://community.zammad.org/t/email-gets-generated-but-ticket-doesnt-sometimes/10753/6 "2023-03-29T13:06:20Z")

</div>

Use your production.log of the day the issue occured and lookup the message id.  
If it hits your instance then you will be able to find it within the log and will also be able to see what happened to it.

As I said, the classics are:

- no permissions in the affected group
- another instance is pulling the mail (e.g. test instances)
- (doesn’t match your case but for completeness) Zammad is unable to process the mail and puts it to `tmp/unprocessible_mail/`

Zammad will _never_ generate a answer mail or agent notification unless the ticket has been created successfully. Never ever.

---

<div class="post-metadata">

### Author: ![letmesetupthis](https://community.zammad.org/letter_avatar_proxy/v4/letter/l/ecc23a/32.png) [@letmesetupthis](https://community.zammad.org/u/letmesetupthis)
#### Post date: [April 25, 2023, 2:30pm UTC](https://community.zammad.org/t/email-gets-generated-but-ticket-doesnt-sometimes/10753/7 "2023-04-25T14:30:51Z")

</div>

It looks like there is an issue with a user which is in agents but his email-address is not working.

```auto
I, [2023-04-25T09:40:33.337088#3050887-106446000] INFO -- : Process email with msgid '<f050af4a31934153b202cff88365287b@somecompany.somedomain>'
I, [2023-04-25T09:40:33.368250#3050887-106446000] INFO -- : set_attributes_by_x_headers header x-zammad-article-preferences found. Assign preferences={"send-auto-response"=>true, "is-auto-response"=>false}
I, [2023-04-25T09:40:33.511392#3050887-106446000] INFO -- : ended Channel.fetch took: 0.450103184 seconds.
I, [2023-04-25T09:40:34.379823#3050855-9557400] INFO -- : Started GET "/api/v1/tickets/239?full=true&_=1681986001288" for 157.143.2.173 at 2023-04-25 09:40:34 +0200
I, [2023-04-25T09:40:34.385290#3050855-9557400] INFO -- : Processing by TicketsController#show as JSON
I, [2023-04-25T09:40:34.385356#3050855-9557400] INFO -- : Parameters: {"full"=>"true", "_"=>"1681986001288", "id"=>"239"}
I, [2023-04-25T09:40:34.433252#3050855-9557400] INFO -- : Completed 200 OK in 48ms (Views: 1.7ms | ActiveRecord: 17.7ms | Allocations: 14518)
I, [2023-04-25T09:40:36.744674#3050887-112260] INFO -- : ProcessScheduledJobs running...
I, [2023-04-25T09:40:36.746758#3050887-112260] INFO -- : Running job thread for 'Check channels.' (Channel.fetch) status is: sleep
I, [2023-04-25T09:40:36.746831#3050887-112260] INFO -- : Running job thread for 'Process ticket escalations.' (Ticket.process_escalation) status is: sleep
I, [2023-04-25T09:40:36.746971#3050887-112260] INFO -- : Running job thread for 'Check 'Channel' streams.' (Channel.stream) status is: sleep
I, [2023-04-25T09:40:36.747076#3050887-112260] INFO -- : Running job thread for 'Generate 'Session' data.' (Sessions.jobs) status is: sleep
I, [2023-04-25T09:40:36.747776#3050887-112260] INFO -- : Running job thread for 'Execute planned jobs.' (Job.run) status is: sleep
I, [2023-04-25T09:40:37.095194#3050887-112440] INFO -- : 2023-04-25T09:40:37+0200: [Worker(host:zammad pid:3050887)] Job TransactionJob [be71116a-9d98-4a28-9452-36c27fbfd4ce] from DelayedJob(default) with arguments: [{"object"=>"Ticket", "object_id"=>239, "user_id"=>121, "created_at">
E, [2023-04-25T09:40:38.424763#3050887-112440] ERROR -- : Can't use Channel::Driver::Smtp: #<Net::SMTPFatalError: Net::SMTPFatalError>
E, [2023-04-25T09:40:38.424838#3050887-112440] ERROR -- : 550 5.1.1 <sdsdsd.jikji@ourcompany.ourdomain>: Recipient address rejected: User unknown in virtual mailbox table
 (Net::SMTPFatalError)
app/models/channel/driver/smtp.rb:93:in `send'
app/models/channel.rb:257:in `deliver'
lib/notification_factory/mailer.rb:170:in `send'
lib/notification_factory/mailer.rb:223:in `notification'
app/models/transaction/notification.rb:216:in `block in perform'
app/models/transaction/notification.rb:105:in `each'
app/models/transaction/notification.rb:105:in `perform'
lib/transaction_dispatcher.rb:61:in `execute_single_backend'
app/jobs/transaction_job.rb:25:in `block in perform'
app/jobs/transaction_job.rb:21:in `perform'
lib/background_services/service/process_delayed_jobs.rb:25:in `block (2 levels) in launch'
lib/background_services/service/process_delayed_jobs.rb:23:in `block in launch'
lib/background_services/service/process_delayed_jobs.rb:20:in `loop'
lib/background_services/service/process_delayed_jobs.rb:20:in `launch'
lib/background_services/service.rb:27:in `block in run'
lib/application_handle_info.rb:19:in `use'
lib/background_services/service.rb:33:in `block in run_in_service_context'
lib/background_services/service.rb:32:in `run_in_service_context'
lib/background_services/service.rb:26:in `run'
lib/background_services.rb:67:in `block in start_as_thread'
E, [2023-04-25T09:40:38.436283#3050887-112440] ERROR -- : Can't use Channel::Driver::Smtp: #<Net::SMTPFatalError: Net::SMTPFatalError> (RuntimeError)
app/models/channel.rb:270:in `rescue in deliver'
app/models/channel.rb:245:in `deliver'
lib/notification_factory/mailer.rb:170:in `send'
lib/notification_factory/mailer.rb:223:in `notification'
app/models/transaction/notification.rb:216:in `block in perform'
app/models/transaction/notification.rb:105:in `each'
app/models/transaction/notification.rb:105:in `perform'
lib/transaction_dispatcher.rb:61:in `execute_single_backend'
app/jobs/transaction_job.rb:25:in `block in perform'
app/jobs/transaction_job.rb:21:in `perform'
lib/background_services/service/process_delayed_jobs.rb:25:in `block (2 levels) in launch'
lib/background_services/service/process_delayed_jobs.rb:23:in `block in launch'
lib/background_services/service/process_delayed_jobs.rb:20:in `loop'
lib/background_services/service/process_delayed_jobs.rb:20:in `launch'
lib/background_services/service.rb:27:in `block in run'
lib/application_handle_info.rb:19:in `use'
lib/background_services/service.rb:33:in `block in run_in_service_context'
lib/background_services/service.rb:32:in `run_in_service_context'
lib/background_services/service.rb:26:in `run'
lib/background_services.rb:67:in `block in start_as_thread'
I, [2023-04-25T09:40:38.438225#3050887-112440] INFO -- : 2023-04-25T09:40:38+0200: [Worker(host:zammad pid:3050887)] Job TransactionJob [be71116a-9d98-4a28-9452-36c27fbfd4ce] from DelayedJob(default) with arguments: [{"object"=>"Ticket", "object_id"=>239, "user_id"=>121, "created_at">
I

```

---

<div class="post-metadata">

### Author: ![dvanzuijlekom](https://community.zammad.org/user_avatar/community.zammad.org/dvanzuijlekom/32/4510_2.png) [@dvanzuijlekom](https://community.zammad.org/u/dvanzuijlekom)
#### Post date: [April 26, 2023, 9:25am UTC](https://community.zammad.org/t/email-gets-generated-but-ticket-doesnt-sometimes/10753/8 "2023-04-26T09:25:42Z")

</div>

You are affected by [this issue](https://community.zammad.org/t/smtp-550-callout-verification-failed-on-single-address-aborts-rest-of-notifications/10961/6). The ticket is probably generated fine, but you’re just not getting any notifications of it. Search for the ticket manually.

Also: change the email address of the affected agent or disable them temporarily to allow notifications to be sent again. See my post for further details on this issue and how to work around it.

---

<div class="post-metadata">

### Author: ![letmesetupthis](https://community.zammad.org/letter_avatar_proxy/v4/letter/l/ecc23a/32.png) [@letmesetupthis](https://community.zammad.org/u/letmesetupthis)
#### Post date: [April 26, 2023, 9:39am UTC](https://community.zammad.org/t/email-gets-generated-but-ticket-doesnt-sometimes/10753/9 "2023-04-26T09:39:01Z")

</div>

The Ticket is not getting generated sometimes, and the email which is sent out, informing the ticket was created, shows a wrong link.

---

<div class="post-metadata">

### Author: ![dvanzuijlekom](https://community.zammad.org/user_avatar/community.zammad.org/dvanzuijlekom/32/4510_2.png) [@dvanzuijlekom](https://community.zammad.org/u/dvanzuijlekom)
#### Post date: [April 26, 2023, 11:02am UTC](https://community.zammad.org/t/email-gets-generated-but-ticket-doesnt-sometimes/10753/10 "2023-04-26T11:02:01Z")

</div>

As MrGeneration stated earlier in [his post](https://community.zammad.org/t/email-gets-generated-but-ticket-doesnt-sometimes/10753/6): it is likely a group permission error that you’re not seeing the ticket. The SMTP error you posted is of a notification failure to an agent about a _created_ ticket. The ticket should really be in your instance somewhere.

---

<div class="post-metadata">

### Author: ![MrGeneration](https://community.zammad.org/user_avatar/community.zammad.org/mrgeneration/32/9260_2.png) [@MrGeneration](https://community.zammad.org/u/MrGeneration)
#### Post date: [April 26, 2023, 11:02am UTC](https://community.zammad.org/t/email-gets-generated-but-ticket-doesnt-sometimes/10753/11 "2023-04-26T11:02:46Z")

</div>

The log output you provided does not reflect that.  
Either you’re mixing terminologies or you’re not finding the ticket that exists.

That’s nothing we can help you with. We can help with fitting terminologies when all things are known to us. Right now this is not the case.

---

<div class="post-metadata">

### Author: ![letmesetupthis](https://community.zammad.org/letter_avatar_proxy/v4/letter/l/ecc23a/32.png) [@letmesetupthis](https://community.zammad.org/u/letmesetupthis)
#### Post date: [April 26, 2023, 11:49am UTC](https://community.zammad.org/t/email-gets-generated-but-ticket-doesnt-sometimes/10753/12 "2023-04-26T11:49:06Z")

</div>

it has nothing to do with “it is likely a group permission error that you’re not seeing the ticket”.

The customer gets an email with a link to the “created” ticket… BUT it will just give him a link to another ticket which is not even his ticket so he ha sno access to it.  
my user has access to everything so the link works for me, but shows me this old ticket of another customer…

---

<div class="post-metadata">

### Author: ![MrGeneration](https://community.zammad.org/user_avatar/community.zammad.org/mrgeneration/32/9260_2.png) [@MrGeneration](https://community.zammad.org/u/MrGeneration)
#### Post date: [April 26, 2023, 12:01pm UTC](https://community.zammad.org/t/email-gets-generated-but-ticket-doesnt-sometimes/10753/13 "2023-04-26T12:01:08Z")

</div>

> [@letmesetupthis](#):
>
> The customer gets an email with a link to the “created” ticket… BUT it will just give him a link to another ticket which is not even his ticket so he ha sno access to it.

So that’s the issue. Fix your trigger based mail then.

---

<div class="post-metadata">

### Author: ![twonnecke](https://community.zammad.org/letter_avatar_proxy/v4/letter/t/a8b319/32.png) [@twonnecke](https://community.zammad.org/u/twonnecke)
#### Post date: [April 27, 2023, 1:00pm UTC](https://community.zammad.org/t/email-gets-generated-but-ticket-doesnt-sometimes/10753/14 "2023-04-27T13:00:41Z")

</div>

No, it isn’t. I can support letmesetupthis, as we are having this issue too with some of our tickets.

We have a support mail address setup and the mails are not kept in the mailbox. The user writes an email to the address and gets the automatic response “Thanks for your ticket bla bla”. The Ticket-ID is set to the next free ID and a link is created to this ID (as with every new ticket). But the ticket is **not created**. The next ticket that is successfully created with receive the new free ID, which has been linked in the last automatic reply of the not successful ticket creation.  
So the customers link shows the ID from their created ticket, but it’s actually the ticket after this one, as it was not created.

We use MS Exchange 2016 and the support address is a shared mailbox with an user account behind that.  
It’s not an issue with the Zammad version, as we are still on 4.x.

---

<div class="post-metadata">

### Author: ![MrGeneration](https://community.zammad.org/user_avatar/community.zammad.org/mrgeneration/32/9260_2.png) [@MrGeneration](https://community.zammad.org/u/MrGeneration)
#### Post date: [April 27, 2023, 1:04pm UTC](https://community.zammad.org/t/email-gets-generated-but-ticket-doesnt-sometimes/10753/15 "2023-04-27T13:04:18Z")

</div>

> [@twonnecke](#):
>
> It’s not an issue with the Zammad version, as we are still on 4.x.

You’re prune to security issues, upgrade asap.

If it would be an issue with Zammad 4.x and 5.x people would have noticed like MUCH EARLIER.  
Run `zammad run rails r "pp Ticket.find(<ID from mail>)"`

I bet you do get a response. That is if you use the ID not the number (or the other way around).  
Wouldn’t be the first time people confuse ticket ID and number and use it incorrectly in triggers.

And what you both have in common that the mail is based on a trigger.

---

<div class="post-metadata">

### Author: ![twonnecke](https://community.zammad.org/letter_avatar_proxy/v4/letter/t/a8b319/32.png) [@twonnecke](https://community.zammad.org/u/twonnecke)
#### Post date: [April 27, 2023, 1:32pm UTC](https://community.zammad.org/t/email-gets-generated-but-ticket-doesnt-sometimes/10753/16 "2023-04-27T13:32:39Z")

</div>

> [@MrGeneration](#):
>
> You’re prune to security issues, upgrade asap.

Will do. We already had a successful upgrade on a test system and will update productive asap.

Trigger looks like following:  
Dein Ticket **(#{config.ticket\_hook}#{ticket.number})** ist bei uns eingegangen.

Mail looks like following:  
Dein Ticket **(Ticket#177908)** ist bei uns eingegangen.

The ticket title from mail is: **Einrichtung Verzeichniszugriff**

When searching in zammad for ticket numer 177908, we do find a ticket, but from another colleague with title **IT Erstausstattung**.

When running `zammad run rails r "pp Ticket.find(7908)"`, a ticket is found with id 7908 and number 177908 and title IT Erstausstattung.

When running command Ticket.find\_by(title: “IT Erstausstattung”) in rails console, this ticket with id 7908 is found.

When running command Ticket.find\_by(title: “Einrichtung Verzeichniszugriff”) in rails console, output is `=> nil`.

---

<div class="post-metadata">

### Author: ![MrGeneration](https://community.zammad.org/user_avatar/community.zammad.org/mrgeneration/32/9260_2.png) [@MrGeneration](https://community.zammad.org/u/MrGeneration)
#### Post date: [April 27, 2023, 1:37pm UTC](https://community.zammad.org/t/email-gets-generated-but-ticket-doesnt-sometimes/10753/17 "2023-04-27T13:37:46Z")

</div>

> [@twonnecke](#):
>
> When running `zammad run rails r "pp Ticket.find(7908)"`, a ticket is found with id 7908 and number 177908 and title IT Erstausstattung.

Ticket number and ID **are not** necessarily the exact same and can drift.

> [@twonnecke](#):
>
> When running `zammad run rails r "pp Ticket.find(7908)"`, a ticket is found with id 7908 and number 177908 and title IT Erstausstattung.
> 
> When running command Ticket.find\_by(title: “IT Erstausstattung”) in rails console, this ticket with id 7908 is found.
> 
> When running command Ticket.find\_by(title: “Einrichtung Verzeichniszugriff”) in rails console, output is `=> nil`.

Alright. Send me a PM with the production.log where this occured and the rough time so I don’t have to search the whole log, please. I can provide a drop link if you don’t want to send it via PM directly.

One time offer, no fee.

---

<div class="post-metadata">

### Author: ![MrGeneration](https://community.zammad.org/user_avatar/community.zammad.org/mrgeneration/32/9260_2.png) [@MrGeneration](https://community.zammad.org/u/MrGeneration)
#### Post date: [April 27, 2023, 8:20pm UTC](https://community.zammad.org/t/email-gets-generated-but-ticket-doesnt-sometimes/10753/18 "2023-04-27T20:20:11Z")

</div>

After reviewing the log files we noticed the (cloned) test instance being the culprit (so the wrong instance fetched the mail and generated a ticket number that obviously can’t exist on the production one.

---

<div class="post-metadata">

### Author: ![system](https://community.zammad.org/uploads/default/original/1X/5c5afaea2d23f811dbec33cd4edb02fa29d3262f.png) [@system](https://community.zammad.org/u/system)
#### Post date: [August 25, 2023, 8:20pm UTC](https://community.zammad.org/t/email-gets-generated-but-ticket-doesnt-sometimes/10753/19 "2023-08-25T20:20:56Z")

</div>

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.
