Closed julianfairfax closed 1 month ago
I looked at the code, and at least you can pass some parameters to the program.
So you could create a shortcut in Windows for this program and add the parameters to the path in the target.
It should look like this:
"proton-mail-export-cli.exe" --user=username@proton.me --password=****** --export-dir="C:\Export" --totp=123456 --mbox-password=****
You only need "totp" if you have the second factor (time-based one-time password) enabled, and "mbox-password" if you have the second password active in your account.
Hope this helps.
--export-dir
didn't work for me and --totp
doesn't make sense for my use case, but the username and password work! Thank you @FairyNatza!
Just came across this issue, here's a really dirty script to get it even with TOTP working:
#!/bin/bash
# base credentials
username=your-user
password=your-password
# calculate the TOTP from the secret
totp=$(/usr/bin/oathtool --base32 --totp "your-totp-secret" -d 6)
# if TOTP calculation successful, run the backup
if [ $? -eq 0 ]; then
./proton-mail-export-cli --operation backup --dir . --user $username --password $password --totp $totp
else
echo "TOTP calculation failed!"
exit 1
fi
You'll need oathtool
(https://packages.debian.org/bookworm/oathtool) for calculating the TOTP code.
Having to login each time you want to use the tool makes using it more difficult.