How to set up SMTP/IMAP in Open Source Helpdesk – UVdesk?

SMTP/IMAP Configuration

For sending or transfer emails through your support email id and fetch emails over Helpdesk, you have to set mailer SMTP and IMAP.

Drafting our the complete step to configure SMTP and IMAP settings:

Step 1 – Open with editor

Open the created project with respective editor.

Open project with editor

Step 2 – swiftmailer.yaml configuration

Next, go to configure => packages => swiftmailer.yaml

Add to mailers entries to swiftmailer.yaml

    # url: '%env(MAILER_URL)%'
    # spool: { type: 'memory' }
            transport: gmail
            username: uvdesk_demo@gmail.com
            password: *****

Step 3 – uvdesk _mailbox.yaml configuration

Now, under packages, you will find uvdesk _mailbox.yaml file. Open uvdesk _mailbox.yaml then enabled mailboxes using following entries. refer below command.

    # Configure your mailboxes here
    emails: ~
        # Often Reply emails like from gmail contains extra and redundant previous mail data.
        # This data can be removed by adding delimiter i.e. specific line before each reply. 
        # delimiter: '<-- Please add content above this line -->'
        # enable_delimiter: true

    # Configure your mailboxes here
            name: 'demo'
            enabled: true
        #     # [SMTP] Outgoing mail server
        #     # Swiftmailer smtp mailer to use for sending emails through on behalf of this mailbox
                mailer_id: sample
        #     # [IMAP] Incoming mail server
        #     # IMAP configurations to use for fetching emails from mailbox
                host: '{imap.gmail.com:993/imap/ssl}INBOX'
                username: uvdesk_demo@gmail.com
                password: *****

SMTP Configuration

Define SMTP mailer id to set up SMTP on your server.

Note: mailer id should be the same which you have already created in swift mailer configuration file.

IMAP configuration

Please provide your username and password to configure your IMAP.

Here we’ll use the same email address and password for username and password , Add the hostname according to the mail server IMAP setting.

Refer here to check IMAP Port for Gmail.

Refer this blog to check mailbox configuration for Yahoo.

Step 4: uvdesk.yaml Configuration

In the last step, under packages you will be able to see uvdesk.yaml file. Open this file and add below entries which is required to be configure with mailbox:

  1. Put the helpdesk URL in site_url. for example in my case it is “localhost/uvdesk/UVdesk/public”
  2. Now, set up Support Email Id which is required to send the Ticket Replies to Customer’s Email ID hence follow the below-given code for Support Email Configuration
    app_locales: en|fr|it
    # Default Assets
    assets_default_agent_profile_image_path: 'bundles/uvdeskcore/images/uv-avatar-batman.png'
    assets_default_customer_profile_image_path: 'bundles/uvdeskcore/images/uv-avatar-ironman.png'
    assets_default_helpdesk_profile_image_path: 'bundles/uvdeskcore/images/uv-avatar-uvdesk.png'

    uvdesk_site_path.member_prefix: member
    uvdesk_site_path.knowledgebase_customer_prefix: customer

    site_url: 'localhost/uvdesk/UVdesk/public'
        id: Webkul\UVDesk\CoreBundle\FileSystem\UploadManagers\Localhost
        id: uvdesk_demo@gmail.com
        name: UVDesk Community
        mailer_id: sample
    # Default resources
            type: support
            status: open
            priority: low
            email: mail.html.twig

Common Issues:

If you are getting the error “Can not authenticate to IMAP server: [ALERT]

Make sure you’re not using 2 step verification.

First sign in into the Gmail account in a browser on the device then, need to ensure you have enabled IMAP status and Allow less secure apps should be ON and have already done the continue step to allow access to your Google account.

Step 5 – Refresh mailbox

At last, you need to run the following command –

Last command - php bin/console uvdesk:refresh-mailbox uvdesk_demo@gmail.com

Here we have done all the settings of SMTP/IMAP configuration, now you can able to send and receive emails over the ticket panel.

Hope this post will help for PHP/Symfony developers who want to build own customizable fully functional helpdesk. Please share your feedback and Comments.

If you have any query you can contact us at support@uvdesk.com Stay tuned for more updates with UVdesk opensource helpdesk …!!!

Category(s) UVdesk
. . .

Comments (11)

Add Your Comment

  • Rob Pearce

    Attempted to call function “imap_open” from namespace “Webkul\UVDesk\MailboxBundle\Console”.

    We found a solution:

     I cant explain how this fixes the problem but it did seem to.

    despite PHP reporting that imap extension is installed and me confirming it works by running a test script in the browser it wasnt working on the command line. So,basically reinstalled imap and dependancy php-curl (See below the steps for Linux but i would imagine the same principle should work for Windows. The odd thing is those extensions were installed – so maybe it was an update that was required. my guess is the browser may be running php 7.3 (IMAP works for the browser) but the command line is using php 7.4 which didnt have imap and curl extensions installed. I ended up with two versions of php quite by accident – i dont know how 7.4 got on my server

    sudo apt install php-imap
    463 sudo phpenmod imap
    464 sudo apt update
    465 sudo apt
    467 sudo apt upgrade -y
    468 sudo reboot
    469 sudo apt update
    470 sudo apt upgrade
    471 sudo apt autoremove
    472 sudo reboot
    477 sudo add-apt-repository ppa:ondrej/php
    478 sudo apt-get update
    479 sudo apt-get install php-curl

    • Himani Gupta
      Hello Rob Pearce,
      Glad to know that your issue has been resolved.
      Keep stay & deliver better customer support with UVdesk open source Helpdesk.
      Thanks & Regards
      UVdesk Team
  • SudoBash
    This shouldn’t be set for using Gmail…

    It is extremely unprofessional to use gmail for SMTP/IMAP delivery and besides that, most companies have their own SMTP/IMAP servers or providers…

    Also, this information doesn’t work and if you copy and paste your YAML configs, it errors that it is in an incorrect format!

    • Himani Gupta
      Hello SudoBash,
      Nice day to you!!
      Kindly download the latest version of community helpdesk from here -https://github.com/uvdesk/community-skeleton/
      You can configured email settings by using the GUI. In the latest update there is no need to set up a backend configuration for the mailbox.
      The only thing which you need to update i.e Site_Url in Uvdesk.Yaml instead of default URL.
      Thank You!!
      • SudoBash
        I got that working and enabled SMTP through my provider.
        I can send a test email with:
        ./console swiftmailer:email:send –from user@domain.com –to user@domain.com –subject Test –body Test –mailer mailer_#

        I receive the Test email in my inbox almost immediately, but when I create a user agent or click forgot password, I get NO email…

        • Himani Gupta
          Hello SudoBash,
          Sounds great!!
          To enable user forget email notification you need to set up email settings first by navigating through Settings-> Email Settings
          Kindly make a try and update us if still exists by emailing us at support@uvdesk.com
          Thank You!!
  • Marice
    Hi I got this error

    1. Processing uvdesk mailbox configuration.

    Mailbox for email maricejuguilon@gmail.com not found.

    • Himani Gupta
      Hello Marice,
      Nice day to you!!
      Most probably this email is not configured with UVdesk Mailbox. To get verified refer this comprehensive user guide to set up UVdesk with Gmail – https://www.uvdesk.com/en/blog/setup-mailbox-uvdesk-open-source-helpdesk/
      Thanks & Regards
      UVdesk Team
      • Marice
        Thank you, it actually help, but I have another issue in saving the form I got this error
        Warning: mkdir(): Permission denied
        • Himani Gupta
          Hello Marice
          Kindly provide the read & write permission for config folder – chmod 777 -R path of config folder of UVdesk project
          Thanks & Regards
          UVdesk Team
  • css.php