ttionya / vaultwarden-backup

Backup vaultwarden (formerly known as bitwarden_rs) SQLite3/PostgreSQL/MySQL/MariaDB database by rclone. (Docker)
MIT License
956 stars 113 forks source link

Setting up emails for successful/failed backup isn't easy, and give me some warning after several tries #123

Closed MilesTEG1 closed 11 months ago

MilesTEG1 commented 11 months ago

Hello, I wanted to setup the email notifications, so set the SMTP env var. For now, I want to use gmail. I succeed to get an email after a backup, but I have some warnings in the log:

upload backup file to storage system [Backup_Syno:/rclone_backup]
delete 31 days ago backup files [Backup_Syno:/rclone_backup]
mail: Warning: variable superseded or obsoleted: smtp
mail: Warning: variable superseded or obsoleted: smtp-auth-user
mail: Warning: variable superseded or obsoleted: smtp-auth-password
mail: Obsoletion warning: please do not use *smtp*, instead assign a smtp:// URL to *mta*!
mail: Obsoletion warning: Use of old-style credentials, which will vanish in v15!
mail:   Please read the manual section "On URL syntax and credential lookup"
mail send was successfully

Here what I have achieved to have an email sent: (I use version: "2.4" for the docker-compose.yml file)

      - MAIL_SMTP_ENABLE=TRUE
      - MAIL_SMTP_VARIABLES=-S smtp-use-starttls -S smtp=smtp://${SMTP_HOST}:${SMTP_PORT_STARTTLS} -S smtp-auth=login -S smtp-auth-user=${SMTP_USERNAME} -S smtp-auth-password=${SMTP_PASSWORD} -S from=${SMTP_FROM}
      - MAIL_TO=${SMTP_FROM}
      - MAIL_WHEN_SUCCESS='TRUE'
      - MAIL_WHEN_FAILURE='TRUE'
      # Variables SMTP utilisées pour Vaultwarden
      # - SMTP_HOST=$SMTP_HOST
      # - SMTP_PORT=$SMTP_PORT
      # - SMTP_SECURITY=$SMTP_SECURITY
      # - SMTP_USERNAME=$SMTP_USERNAME
      # - SMTP_PASSWORD=$SMTP_PASSWORD
      # - SMTP_FROM=$SMTP_FROM
      # - SMTP_FROM_NAME=$SMTP_FROM_NAME

And here the env var setup in Portainer from a .env file: image

How can I get rid of the warnings?

Thanks in advance

ttionya commented 11 months ago

Starting from v1.19.0, we are using s-nail instead of heirloom-mailx. s-nail is warning users to switch to their new MTA credential verification method. For more detailed information, please refer to the #117 .

MilesTEG1 commented 11 months ago

@ttionya Hello, I know about the change form heirloom-mailx to s-nail, I read the #117 and according to the doc here, I set the env variables accordingly to what you wrote (as you can see on my first post above).

What I don't understand is this: do your instructions in the repository are accurate to the changes starting from v1.19.0 and the new MTA credential verification method used by s-nail?

And, how to get rid of the warnings? I don't understand the s-nail doc as it's not very readable nor well explained... Could you help me? (I know another user has the same interrogations and the same warning in the log.)

ttionya commented 11 months ago

In order to prevent users from needing to reconfigure their email due to switching the email sending tool, we aim to avoid disruptive changes as much as possible. Additionally, we won't upgrade to the MTA-only versions of s-nail v15 or v14.10. Therefore, in the documentation, I haven't suggested that users switch to MTA credentials. Users can choose to use either the old-style credentials or the new MTA credentials based on whether they are concerned about the warning messages.

I haven't tried MTA credential verification either. I will attempt this after my work hours.

MilesTEG1 commented 11 months ago

I haven't tried MTA credential verification either. I will attempt this after my work hours.

Thanks in advance 😄

ttionya commented 11 months ago

See https://github.com/ttionya/vaultwarden-backup/issues/117#issuecomment-1691443179

MilesTEG1 commented 11 months ago

thanks, I'll look into it.