I think that what you are looking for is the %{message.files} variable.
We tried that variable as well, but it's not valid for that context and doesn't work in the Assignment Alert, so I didn't even mention it.
Korisnik
That means you are having other deeper issues. Check your PHP and web server error logs for any related errors.
Cheers.
KevinTheJedi The full thread variable %{ticket.thread.complete} provides a download link for the files, but the link doesn't open the file. We tried opening it a few seconds after it arrives, but it still doesn't work. We are getting an error as shown in the picture:
We suspect that the problem is in this part of the code: https://github.com/osTicket/osTicket/blob/4689926b2d3d25754f0ddcf8d4e181a2817f6d56/include/class.file.php#L209-L271
Could you please look into this issue and provide assistance on how to resolve it?
If you want to debug manually here is the file:
You can add statements at various points to see where it’s failing.
KevinTheJedi After conducting additional testing, we discovered that attachments can be accessed via the Ticket Assignment Alert when variable %{ticket.thread.complete} is used and Fetch on auto-cron is active.
However, if Fetch on auto-cron is disabled and a cron job is used instead, accessing the attachment via the Ticket Assignment Alert on the mail client is not possible. cron job: /usr/bin/php8.2 /data/www/osticket/api/cron.php > /dev/null 2>&1
Links with Fetch on auto-cron In osTicket - https://xxyyzz/file.php?key=mdtucp7i3xg-s5g8b2xi_0muo6o4amti&expires=1708473600&signature=e4884f33a202e7533d8320c742309deb24dcf4d1&id=104691 In mail - https://xxyyzz/file.php?key=mdtucp7i3xg-s5g8b2xi_0muo6o4amti&expires=1708473600&signature=e4884f33a202e7533d8320c742309deb24dcf4d1
Links with cron job (Fetch on auto-cron is not enabled) In osTicket - https://xxyyzz/file.php?key=zzdlgzmzlumysare9tppacvppel_eucm&expires=1708473600&signature=683717ec9a0d9b53580491f89d8d701150d6bb34&id=104692 In mail - https://xxyyzz/file.php?key=zzdlgzmzlumysare9tppacvppel_eucm&expires=1708473600&signature=be5c6a804c4965420cbc215a80ee0fb488bd061f
If you compare the two they are not different. Also, auto-cron vs cron job would not cause issues like this.
KevinTheJedi When Fetch on auto-cron is enabled, the link (signature) in the email is the same as that in osTicket.
However, when we use a cron job, the link (signature) in the email does not work and differs from that in osTicket.
I don't know what you mean without showing an example.
KevinTheJedi I sent the examples in a post earlier. I will repeat them below.
Same links to attachment with Fetch on auto-cron In osTicket: https://xxyyzz/file.php?key=mdtucp7i3xg-s5g8b2xi_0muo6o4amti&expires=1708473600&signature=e4884f33a202e7533d8320c742309deb24dcf4d1&id=104691
In mail ((assignment alert - variable %{ticket.thread.complete}): https://xxyyzz/file.php?key=mdtucp7i3xg-s5g8b2xi_0muo6o4amti&expires=1708473600&signature=e4884f33a202e7533d8320c742309deb24dcf4d1
Different links to attachment with cron job "/usr/bin/php8.2 /data/www/osticket/api/cron.php > /dev/null 2>&1" (Fetch on auto-cron is not enabled) In osTicket: https://xxyyzz/file.php?key=zzdlgzmzlumysare9tppacvppel_eucm&expires=1708473600&signature=683717ec9a0d9b53580491f89d8d701150d6bb34&id=104692
In mail (assignment alert - variable %{ticket.thread.complete}) - this link doesn't work: https://xxyyzz/file.php?key=zzdlgzmzlumysare9tppacvppel_eucm&expires=1708473600&signature=be5c6a804c4965420cbc215a80ee0fb488bd061f This error occurs when we try to open it a few seconds after it arrives:
Idk what to tell you as the non-working link looks the same as the working one..
I would suggest adding debug statements to the code to see where it’s going wrong.
KevinTheJedi The link that doesn't work has a different signature, so it's not the same...
They will sometimes be different. It depends on multiple tihngs:
It's likely the expires time or something.