error: the following arguments are required:

60 Views Asked by At

I'm trying to run a github script in VS code to convert maildir emails to mbox. I have the script and the folder with the maildir in a folder on C: drive. When I run the script it comes back with

PS C:\hello> & C:/Users/stu/AppData/Local/Microsoft/WindowsApps/python3.11.exe c:/hello/maildir2mbox.py
usage: maildir2mbox.py [-h] [-r] maildir_path mbox_filename
maildir2mbox.py: error: the following arguments are required: maildir_path, mbox_filename

I think I have to define the target mailder and mbox folders but I'm at a loss to how to do it.

I've tried putting paths at a few places but in reality I'm clueless.

1

There are 1 best solutions below

5
SyndRain On

As you thought, you would need to provide the target Maildir and output file path. The Maildir folder should contains cur and/or new folders. For example:

& python c:/hello/maildir2mbox.py c:/hello/.one_maildir_folder my-mbox-output

Works with file structure:

c:/hello/.
│   maildir2mbox.py
│
├───.one_maildir_folder
│   ├───cur
│   │       1464003587.H805375P95754.test, S=20238_2, S
│   │
│   ├───new
│   └───tmp
└───.one_maildir_folder.sub
    ├───cur
    ├───new
    └───tmp

See python maildir2mbox.py --help

usage: maildir2mbox.py [-h] [-r] maildir_path mbox_filename

positional arguments:
  maildir_path   path to the existing maildir (containing new, cur, tmp) subdirectories
  mbox_filename  target filename in the mbox format. If the mailbox already exists, new messages are appended to it.

optional arguments:
  -h, --help     show this help message and exit
  -r, --recurse  Process all mail folders included in maildir_path. An equivalent structure is recreated in the mbox
                 format