rgladwell / imap-upload

Python script for uploading a local mbox file to IMAP4 server.
Other
130 stars 30 forks source link

Add support for alternative IMAP folder seperators #18

Closed rgladwell closed 3 years ago

rgladwell commented 3 years ago

Certain email providers use alternative folder separators (i.e. '.') to the default ('\').

This change allows users to change this default. A new CLI argument, --folder-seperator, has been added.

This change includes documentation.

This closes:

https://github.com/rgladwell/imap-upload/issues/16

rgladwell commented 3 years ago

@mrzool Could you test this new feature and let me know if it fixes #16 for you?

mrzool commented 3 years ago

Thanks a lot @rgladwell! Will test right away.

mrzool commented 3 years ago

Hey @rgladwell, after fixing some typos (seperator vs separator, hyphen vs underscore) and some repeated keyword argument errors I am getting this error:

option --folder_separator: invalid action: 'folder_separator'

Tried fiddling with that value and setting it to store, but I'm greeted by another error:

An unknown error has occurred [483]:  __init__() got an unexpected keyword argument 'folder_separator'

Would love to get more into it but I'm afraid I lack the Python skills. Also I would push my first fixes to this branch, but of course I don't have write permission.

rgladwell commented 3 years ago

Fixed the CLI argument errors. @mrzool could you please re-test and let me know how you get on.

mrzool commented 3 years ago

Still getting An unknown error has occurred [483]: __init__() got an unexpected keyword argument 'folder_separator'.

rgladwell commented 3 years ago

Could you provide more information? The command line arguments you're executing? The full output? (if there is any more)

rgladwell commented 3 years ago

@mrzool Think I might've fixed that error now. Please try again.

mrzool commented 3 years ago

Still getting that error. Full command and output:

$ ./imap_upload.py -r --folder-separator "."  kh-emailarchiv/ imaps://testing@example.com:password@mail.your-server.de:993
Connecting to mail.your-server.de:993.
An unknown error has occurred [483]:  __init__() got an unexpected keyword argument 'folder_separator'

Could the fact that you're using a hyphen in the flag and an underscore in the option be the problem?

rgladwell commented 3 years ago

@mrzool No, I think that's how the option parser converts the variables. Just pushed another fix, let me know how you get on.

mrzool commented 3 years ago

Different error now:

An unknown error has occurred [493]:  global name 'separator' is not defined
rgladwell commented 3 years ago

@mrzool pushed another fix

rgladwell commented 3 years ago

@mrzool Could you verify if this branch is now working for you?

mrzool commented 3 years ago

Sorry @rgladwell, I didn't get the chance to test it yesterday. Will do asap!

mrzool commented 3 years ago

Working beautifully now! Thanks a lot @rgladwell and sorry for the wait!

rgladwell commented 3 years ago

@mrzool Fantastic, merging