Renamed --store to --output
This commit is contained in:
@@ -33,7 +33,7 @@ Testing/debugging with limited emails:
|
|||||||
|
|
||||||
Custom storage directory:
|
Custom storage directory:
|
||||||
```bash
|
```bash
|
||||||
./imapdown.py --server imap.example.com --email user@example.com --user user@example.com --password "password" --ssl --store /path/to/backup
|
./imapdown.py --server imap.example.com --email user@example.com --user user@example.com --password "password" --ssl --output /path/to/backup
|
||||||
```
|
```
|
||||||
|
|
||||||
## Architecture
|
## Architecture
|
||||||
@@ -80,7 +80,7 @@ The entire application is contained in `imapdown.py` (13KB). This is intentional
|
|||||||
## Output Structure
|
## Output Structure
|
||||||
|
|
||||||
```
|
```
|
||||||
{store_dir}/ # default: ./download
|
{output_dir}/ # default: ./download
|
||||||
└── {email_address}/ # sanitized email address
|
└── {email_address}/ # sanitized email address
|
||||||
├── .imapdown_state.json
|
├── .imapdown_state.json
|
||||||
├── INBOX/
|
├── INBOX/
|
||||||
|
|||||||
+3
-3
@@ -32,7 +32,7 @@ def parse_args():
|
|||||||
parser.add_argument("--port", type=int, help="Custom port (default: 993 for SSL, 143 otherwise)")
|
parser.add_argument("--port", type=int, help="Custom port (default: 993 for SSL, 143 otherwise)")
|
||||||
parser.add_argument("--limit", type=int, help="Limit number of emails to download (for debugging)")
|
parser.add_argument("--limit", type=int, help="Limit number of emails to download (for debugging)")
|
||||||
parser.add_argument("--full", action="store_true", help="Download all emails (default: only new emails since last run)")
|
parser.add_argument("--full", action="store_true", help="Download all emails (default: only new emails since last run)")
|
||||||
parser.add_argument("--store", type=str, help="Directory to store downloaded emails (default: ./download)")
|
parser.add_argument("--output", type=str, help="Directory to store downloaded emails (default: ./download)")
|
||||||
|
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
@@ -314,8 +314,8 @@ def main():
|
|||||||
args = parse_args()
|
args = parse_args()
|
||||||
|
|
||||||
email_folder = sanitize_filename(args.email, max_length=100)
|
email_folder = sanitize_filename(args.email, max_length=100)
|
||||||
if args.store:
|
if args.output:
|
||||||
base_dir = os.path.join(args.store, email_folder)
|
base_dir = os.path.join(args.output, email_folder)
|
||||||
else:
|
else:
|
||||||
base_dir = os.path.join(os.getcwd(), 'download', email_folder)
|
base_dir = os.path.join(os.getcwd(), 'download', email_folder)
|
||||||
os.makedirs(base_dir, exist_ok=True)
|
os.makedirs(base_dir, exist_ok=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user