Images not showing gmail

Your software
My Mautic version is: 5
My PHP version is: 8.1
My Database type and version is:

Your problem
My problem is:

When I send test email, images doesn’t show up in Gmail but show up in Hotmail and in contact@mysite.com

Does the email land in your inbox?
Maybe you have to enable downloading images, don’t you see a yellow bar in gmail ‘enable downloading images’ or similar?
Do you use SSL in your Mautic, is it https?

Yes, I tried to send an email to a gmail.com, outlook.com and tomysite.com.
They all receive the message but on gmail the images doesn’t show up.

It does show up on outlook and to any email of mystic as well.
And yes, https is enabled.

Please check you browser console (“Dev Tools”). This will show the error for the images not loading.

It shows 404 errors for each image:

mautic_gmail_image_not_found

The image URL is like:

https://ci3.googleusercontent.com/meips/ADKq_NaP5hSXZYF63m8oagAFcClkKHR5xYS-Ho0J4tXstffphX3LhMWV55vk58lOXEx20J79BilQE5XrUZN9TU14T-0wJO484a561tXEUjuEkT1ShWl0IPKuaZsOIXc0QSagi0VKkQ=s0-d-e1-ft#https://mautic.mysite.com/themes/paprika/assets/paprikas.jpg?vaeab0959

the last part of a image url is like https://mautic.mysite.com/themes/paprika/assets/paprikas.jpg?vaeab0959 which show the actual image when open in a new tab.

Another thing I notice is that the mautic logo is displayed but my avatar is not (I haven’t set one yet as I don’t know how to change it but I guess there should be a default one)

This seems to indicate, that Google is not able to load your image - while you can load it locally. Do you block Google on your server maybe? Not sure if thats relevant for secure loading of mail assets.

This resource is loading locally via your browser. So differently to the Google Proxy loading of your images. Is your local browser blocking certain resources? Do you use anti tracking plugins?

This could be related with a DNS misconfiguration where it loads fine on your network but remote can’t.

This does happen when using a dedicated DNS zone for a subdomain but not declaring it in the SLD zone.

Check your DNS propagation using a third party tool like https://dnschecker.org/

If your subdomain isn’t green all over the board, you have a DNS issue and check what I just said (missing nameservers for your subdomain zone).

Hello,
I fixed it after changing the Nginx Configuration file.
Now images display correctly in Gmail.
Also even the avatar in the dashboard is displayed correctly (didn’t mention it but was missing as well).

1 Like

What did you change in the Nginx configuration?

I think I’m having the same problem.

This is my new Nginx config.
Note, the last part are generated by Cerbot for HTTPS support.

server {
   server_name mautic.mysite.com;

   root /var/www/mautic/docroot;

   error_log /var/log/nginx/mautic.error;
   access_log /var/log/nginx/mautic.access;
   client_max_body_size 20M;

   index index.php index.html index.htm index.nginx-debian.html;

   location / {
     # try to serve file directly, fallback to app.php                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
     try_files $uri /index.php$is_args$args;
   }

   location ~ /(mtc.js|1.js|mtracking.gif|.*\.gif|mtc) {
       # default_type "application/javascript";                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
       try_files $uri /index.php$is_args$args;
   }

   # redirect some entire folders                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
     rewrite ^/(vendor|translations|build)/.* /index.php break;

   location ~ \.php$ {
     include snippets/fastcgi-php.conf;
     fastcgi_pass unix:/run/php/php8.1-fpm.sock;
     #Note: If you install Mautic on iRedMail server, you should use the TCP socket instead.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
     #fascgi_pass 127.0.0.1:9999                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
   }

   location ~* ^/index.php {
     # try_files $uri =404;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
     fastcgi_split_path_info ^(.+\.php)(/.+)$;
     # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

     fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
     #Note: If you install Mautic on iRedMail server, you should use the TCP socket instead.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
     #fascgi_pass 127.0.0.1:9999                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
     fastcgi_index index.php;
     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
     include fastcgi_params;

     fastcgi_buffer_size 128k;
     fastcgi_buffers 256 16k;
     fastcgi_busy_buffers_size 256k;
     fastcgi_temp_file_write_size 256k;
   }

    # Deny everything else in /app folder except Assets folder in bundles                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
    location ~ /app/bundles/.*/Assets/ {
        allow all;
        access_log off;
    }
    location ~ /app/ { deny all; }

    # Deny everything else in /addons or /plugins folder except Assets folder in bundles                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
    location ~ /(addons|plugins)/.*/Assets/ {
        allow all;
        access_log off;
    }
    # location ~ /(addons|plugins)/ { deny all; }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  

    # Deny all php files in themes folder                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
      location ~* ^/themes/(.*)\.php {
        deny all;
    }

    # Don't log favicon                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }

    # Don't log robots                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
    location = /robots.txt  {
        access_log off;
        log_not_found off;
    }

    # Deny yml, twig, markdown, init file access                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
    location ~* /(.*)\.(?:markdown|md|twig|yaml|yml|ht|htaccess|ini)$ {
        deny all;
        access_log off;
        log_not_found off;
    }

     # Allow access to certbot directory in order to obtain TLS certificate                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
     location ~ /.well-known/acme-challenge {
        allow all;
     }
    # Deny all attempts to access hidden files/folders such as .htaccess, .htpasswd, .DS_Store (Mac), etc...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
    location ~ /\. {
        deny all;
        access_log off;
        log_not_found off;
    }

    # Deny all grunt, composer files                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
    location ~* (Gruntfile|package|composer)\.(js|json)$ {
        deny all;
        access_log off;
        log_not_found off;
    }

    # Deny access to any files with a .php extension in the uploads directory                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
        location ~* /(?:uploads|files)/.*\.php$ {
                deny all;
    }

     # A long browser cache lifetime can speed up repeat visits to your page                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
  location ~* \.(jpg|jpeg|gif|png|webp|svg|woff|woff2|ttf|css|js|ico|xml)$ {
       access_log        off;
       log_not_found     off;
       expires           360d;
  }




## THIS PART IS GENERATED BY CERTBOT FOR HTTPS SUPPORT

    listen [::]:443 ssl ipv6only=on; # managed by Certbot                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
    listen 443 ssl; # managed by Certbot                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
    ssl_certificate /etc/letsencrypt/live/mautic.mysite.com/fullchain.pem; # managed by Certbot                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
    ssl_certificate_key /etc/letsencrypt/live/mautic.mysite.com/privkey.pem; # managed by Certbot                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

}server {
    if ($host = mautic.mysite.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         


   listen 80;
   listen [::]:80;
   server_name mautic.mysite.com;
    return 404; # managed by Certbot                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               





1 Like

Thank you! I can compare this to what I use.

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