Send email issue - 450 Could not validate the attached file. Filename and attached file does not match #3431

Closed
opened 2026-02-20 02:10:12 -05:00 by deekerman · 1 comment
Owner

Originally created by @drewpo28 on GitHub (Jul 18, 2024).

The bug

My mail provider return an error during sending email when new pictures added to the album (Subject: New media has been added to an album {album name}). Please see the error below:

Reporting-MTA: dns; xxx.xxx.xxx
X-Postcow-Queue-ID: 9D17960447
X-Postcow-Sender: rfc822; xxx@xxx.xxx
Arrival-Date: Wed, 17 Jul 2024 12:24:38 +0300 (EEST)

Final-Recipient: rfc822; xxx@xxx.xxx
Original-Recipient: rfc822;xxx@xxx.xxx
Action: delayed
Status: 4.0.0
Remote-MTA: dns; smtp.mailersend.net
Diagnostic-Code: smtp; 450 Could not validate the attached file. Filename and
attached file does not match. #MS42202 Could not validate the attached
file. Filename and attached file does not match. #MS42202
Will-Retry-Until: Mon, 22 Jul 2024 12:24:38 +0300 (EEST)

Return-Path: xxx@xxx.xxx
Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 9D17960447
for xxx@xxx.xxx; Wed, 17 Jul 2024 12:24:38 +0300 (EEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xxx.xxx; s=dkim;
t=1721208282; h=from:subject:date:message-id:to:mime-version:content-type;
bh=bP8BkXp3dBrJRGsb5oB8MBBJJ6dssR18uTcBcmz2dio=;
b=YLdsHlx1WH8qpLyUuAwRoY3ccbDguUZButuadFAKanmcBbHkoov3KwVLEMBXl9ObKPVhpO
IptFcX8QP2W9fW4KLoEi/HMcoEj3/OPeuRkDIOLMB+HgegmDGQPutnVpz+88wuuO4P5xp7
DanxGtZVmgHgxVYgJOoc9HaMb3IQhdh4Sj4J23iEQGCPyYQSHIdLLWBL+zcpR/I1rk8tyT
7gyK4RosuMiodqwvRRNWXk/ddKP6FrSME5atFgC+7tBp0b1JF0kxt6fJM3KU7hLI+pnU3B
u+mxZK/YF2yfYHPVkFVD/MFvS5c1aYP2+nRxrdaLsGxKUpy1Pi3oNW/0oWLh2g==
From: Immich Photo Server xxx@xxx.xxx
To: xxx@xxx.xxx
Subject: New media has been added to an album - MyDox
Message-ID: a757e56a-2ffe-5440-9705-da3a86c0823a@xxx.xxx
Date: Wed, 17 Jul 2024 09:24:38 +0000
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="--_NmP-6e3df6611d22cf73-Part_1"
X-Last-TLS-Session-Version: TLSv1.3

The OS that Immich Server is running on

Linux Immich 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux

Version of Immich Server

v1.108.0

Version of Immich Mobile App

v1.108.0

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

#
# WARNING: Make sure to use the docker-compose.yml of the current release:
#
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
#
# The compose file on main may not be compatible with the latest release.
#

name: immich

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
#    command: ['start.sh', 'immich']
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    ports:
      - 2283:3001
    depends_on:
      - redis
      - database
    restart: always

#  immich-microservices:
#    container_name: immich_microservices
#    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
#    # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/hardware-transcoding
#    #   file: hwaccel.transcoding.yml
#    #   service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
#    command: ['start.sh', 'microservices']
#    volumes:
#      - ${UPLOAD_LOCATION}:/usr/src/app/upload
#      - /etc/localtime:/etc/localtime:ro
#    env_file:
#      - .env
#    depends_on:
#      - redis
#      - database
#    restart: always

  immich-machine-learning:
    container_name: immich_machine_learning
    # For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag.
    # Example tag: ${IMMICH_VERSION:-release}-cuda
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
    #   file: hwaccel.ml.yml
    #   service: cpu # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable
    volumes:
      - model-cache:/cache
    env_file:
      - .env
    restart: always

  redis:
    container_name: immich_redis
    image: registry.hub.docker.com/library/redis:6.2-alpine@sha256:84882e87b54734154586e5f8abd4dce69fe7311315e2fc6d67c29614c8de2672
    restart: always

  database:
    container_name: immich_postgres
    image: registry.hub.docker.com/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
    volumes:
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
    restart: always

volumes:
  model-cache:

Your .env content

# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

# The location where your uploaded files are stored
UPLOAD_LOCATION=/mnt/immich
EXTERNAL_PATH=/mnt/immich/external
DB_DATA_LOCATION=/mnt/immich/postgres

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release

# Connection secret for postgres. You should change it to a random password
DB_PASSWORD=postgres

# The values below this line do not need to be changed
###################################################################################
DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

REDIS_HOSTNAME=immich_redis

Reproduction steps

1. Setup smtp server
2. Enable email notifications - Album updated
3. Add new picture to album
...

Relevant log output

No response

Additional information

No response

Originally created by @drewpo28 on GitHub (Jul 18, 2024). ### The bug My mail provider return an error during sending email when new pictures added to the album (Subject: New media has been added to an album {album name}). Please see the error below: > Reporting-MTA: dns; xxx.xxx.xxx > X-Postcow-Queue-ID: 9D17960447 > X-Postcow-Sender: rfc822; xxx@xxx.xxx > Arrival-Date: Wed, 17 Jul 2024 12:24:38 +0300 (EEST) > > Final-Recipient: rfc822; xxx@xxx.xxx > Original-Recipient: rfc822;xxx@xxx.xxx > Action: delayed > Status: 4.0.0 > Remote-MTA: dns; smtp.mailersend.net > Diagnostic-Code: smtp; 450 Could not validate the attached file. Filename and > attached file does not match. #MS42202 Could not validate the attached > file. Filename and attached file does not match. #MS42202 > Will-Retry-Until: Mon, 22 Jul 2024 12:24:38 +0300 (EEST) > Return-Path: <xxx@xxx.xxx> > Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 9D17960447 > for <xxx@xxx.xxx>; Wed, 17 Jul 2024 12:24:38 +0300 (EEST) > DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xxx.xxx; s=dkim; > t=1721208282; h=from:subject:date:message-id:to:mime-version:content-type; > bh=bP8BkXp3dBrJRGsb5oB8MBBJJ6dssR18uTcBcmz2dio=; > b=YLdsHlx1WH8qpLyUuAwRoY3ccbDguUZButuadFAKanmcBbHkoov3KwVLEMBXl9ObKPVhpO > IptFcX8QP2W9fW4KLoEi/HMcoEj3/OPeuRkDIOLMB+HgegmDGQPutnVpz+88wuuO4P5xp7 > DanxGtZVmgHgxVYgJOoc9HaMb3IQhdh4Sj4J23iEQGCPyYQSHIdLLWBL+zcpR/I1rk8tyT > 7gyK4RosuMiodqwvRRNWXk/ddKP6FrSME5atFgC+7tBp0b1JF0kxt6fJM3KU7hLI+pnU3B > u+mxZK/YF2yfYHPVkFVD/MFvS5c1aYP2+nRxrdaLsGxKUpy1Pi3oNW/0oWLh2g== > From: Immich Photo Server <xxx@xxx.xxx> > To: xxx@xxx.xxx > Subject: New media has been added to an album - MyDox > Message-ID: <a757e56a-2ffe-5440-9705-da3a86c0823a@xxx.xxx> > Date: Wed, 17 Jul 2024 09:24:38 +0000 > MIME-Version: 1.0 > Content-Type: multipart/alternative; > boundary="--_NmP-6e3df6611d22cf73-Part_1" > X-Last-TLS-Session-Version: TLSv1.3 ### The OS that Immich Server is running on Linux Immich 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux ### Version of Immich Server v1.108.0 ### Version of Immich Mobile App v1.108.0 ### Platform with the issue - [X] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML # # WARNING: Make sure to use the docker-compose.yml of the current release: # # https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml # # The compose file on main may not be compatible with the latest release. # name: immich services: immich-server: container_name: immich_server image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} # command: ['start.sh', 'immich'] volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload - /etc/localtime:/etc/localtime:ro env_file: - .env ports: - 2283:3001 depends_on: - redis - database restart: always # immich-microservices: # container_name: immich_microservices # image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} # # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/hardware-transcoding # # file: hwaccel.transcoding.yml # # service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding # command: ['start.sh', 'microservices'] # volumes: # - ${UPLOAD_LOCATION}:/usr/src/app/upload # - /etc/localtime:/etc/localtime:ro # env_file: # - .env # depends_on: # - redis # - database # restart: always immich-machine-learning: container_name: immich_machine_learning # For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag. # Example tag: ${IMMICH_VERSION:-release}-cuda image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release} # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration # file: hwaccel.ml.yml # service: cpu # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable volumes: - model-cache:/cache env_file: - .env restart: always redis: container_name: immich_redis image: registry.hub.docker.com/library/redis:6.2-alpine@sha256:84882e87b54734154586e5f8abd4dce69fe7311315e2fc6d67c29614c8de2672 restart: always database: container_name: immich_postgres image: registry.hub.docker.com/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0 environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} volumes: - ${DB_DATA_LOCATION}:/var/lib/postgresql/data restart: always volumes: model-cache: ``` ### Your .env content ```Shell # You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables # The location where your uploaded files are stored UPLOAD_LOCATION=/mnt/immich EXTERNAL_PATH=/mnt/immich/external DB_DATA_LOCATION=/mnt/immich/postgres # The Immich version to use. You can pin this to a specific version like "v1.71.0" IMMICH_VERSION=release # Connection secret for postgres. You should change it to a random password DB_PASSWORD=postgres # The values below this line do not need to be changed ################################################################################### DB_HOSTNAME=immich_postgres DB_USERNAME=postgres DB_DATABASE_NAME=immich REDIS_HOSTNAME=immich_redis ``` ### Reproduction steps ```bash 1. Setup smtp server 2. Enable email notifications - Album updated 3. Add new picture to album ... ``` ### Relevant log output _No response_ ### Additional information _No response_
Author
Owner

@jrasm91 commented on GitHub (Jul 20, 2024):

Looks like you are right. It is hard coded but might not always be a jpeg

https://github.com/immich-app/immich/blob/main/server%2Fsrc%2Fservices%2Fnotification.service.ts#L277

@jrasm91 commented on GitHub (Jul 20, 2024): Looks like you are right. It is hard coded but might not always be a jpeg https://github.com/immich-app/immich/blob/main/server%2Fsrc%2Fservices%2Fnotification.service.ts#L277
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/immich#3431
No description provided.