Skip to content

service exits after sending 2fa notification email on startup #898

@bojanrajkovic

Description

@bojanrajkovic

Overview

When starting the program initially with a WebUI configured for password and MFA and an SMTP configuration is given, the service does not properly start up, instead exiting immediately after sending the notification.

I'm running icloudpd inside Kubernetes, in order to have continuous backups of my and my wife's iCloud photo libraries, and this makes it basically impossible to start icloudpd properly and have SMTP notifications.

Steps to Reproduce

  1. Run icloudpd like so: icloudpd --directory "/data/photos/iCloud (Bojan)" --username <omitted> --watch-with-interval 3600 --auto-delete --align-raw original --no-progress-bar --password-provider webui --mfa-provider webui --smtp-username <omitted> --smtp-password <omitted> --smtp-host email-smtp.us-east-1.amazonaws.com --notification-email <omitted> --notification-email-from <omitted> --cookie-directory /auth
    1. The /auth directory is a persistent volume mounted into the container for it to store the session data for pyicloud.
  2. Wait for the WebUI to load
  3. Hit the WebUI and provide your password

Expected Behavior

  1. The WebUI passes the password back to the backend
  2. The backend detects that 2FA is needed
  3. The backend does not send the SMTP notification because this is the initial run
  4. The WebUI switches to 2FA input mode

Actual Behavior

  1. The WebUI passes the password back to the backend
  2. The backend detects that 2FA is needed
  3. The backend sends the SMTP notification
  4. The backend immediately exits

Context

I think you can work around this by turning off SMTP for the initial run, and then turning it back on, but I haven't experimented with that yet.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions