firebaseemail-spam

Images hosted in firebase storage trigger gmail's spam filter


I have recently been trying to send user's invoices from our online shop that include images of the products bought. We are using firebase for our backend, and firebase storage for hosting the images.

For some reason, whenever I add a firebase storage hosted image to the email it goes straight to the spam folder. When I use a test image hosted at a different URL it seems there is no problem.

Is there a way to get around this problem while still using firebase storage for our image hosting? Or would it be best to simply store the images elsewhere?


Solution

  • You can't serve the images directly from Cloud Storage as the URL is often obfuscated with hashes or UUIDs and has been abused for spam in the past. As the spam filter can't determine if the resource is legitimate or not, it simply gets flagged as spam.

    You can serve the images from a deployed Firebase Hosting site (not recommended), from behind Firebase Hosting using Cloud Functions and rewrites that pipe data from Cloud Storage (suitable for low-frequency requests), or make use of a reputable resource hosting platform (like Cloud Storage).

    In all of the above situations, you should serve those images from a custom domain like https://cdn.example.com that matches your email address and ensure that it has a valid SSL certificate.