Some notes relateing to email config setup and conflicting documentation.
Like many people I had a bit of a rough ride with the email config in uvdesk.
I thought I would share some notes on the experiance.
My intial config went fine, however after I was happy with our setup I swapped to a prod config:
sudo -u www-data composer dump-env prod
Another thing that was different about our prod config, was that rather than useing a cert on the box from letsencrypt, im now servering the app through a cloudflare tunnel on a different domain. Cloudflare lets you upgrade requests as part of the tunnel applications public hostname, so, the local cert wasnt needed anymore.
So, I updated the apache config for the site to listen on port 80 and also changed the sitename directive to the new domain that my cloudflare host is redirecting the traffic from.
All was ok so far...
However when I tested the mailbox refreshing cron job I saw I was now getting an error:
php bin/console uvdesk:refresh-mailbox (mailbox address)
# Retrieving mailbox configuration details for (email@example.com): - Establishing connection with mailbox - Fetching all emails since 05 November 2023 - Found a total of 1 emails in mailbox since 05 November 2023 # Processing all found emails iteratively: API https://(old domain)/mailbox/listener - Processing email 1 of 1: An unexpected error occurred: Warning: Trying to access array offset on value of type null
This is obviously a consequence of what is inside this file:
the site_url: directive was set to the old public hostname of the app. I belive the internal api must be useing this to automatically insert email / do stuff with new incomming messages.
Since this was both a: now wrong (I had changed the domain of the web app)
and b: not externally discoverable in the same way anymore (cloud flare is handleing the forwarding) this was not working either.
I stumbled upon a few docs, like this one:
but, it makes a couple of mistakes / asumptions when it tells u to amend this to path to localhost/folder_name/public
a: I dont think this is the correct API path anymore, all u need is simply 'localhost' or any internal address the webserver can reach
b: it doesnt make any mention that this file will be completed for you in the intial installation - that told told me to use the public address.
I only realised this api path was incorrect, since my logs were full of the correct one from before I changed the domain: /mailbox/listener.
Perhaps a more canoical / standard config would result in a redirection from
localhost/folder_name/public -> localhost/mailbox/listener, but reguardless some extra work / documentation should make clear what the implication of setting /config/packages/uvdesk.yaml actually is.
Apart from this, we are enjoying UVdesk and hope the mail intergration / setup gets a bit better in the future!
Thank you for the feedback