Closed B-LUC closed 2 years ago
Hi there - that looks good to me, though I have no way of testing it :-)
Could you add some mention of it in the documentation, and I'll merge it in.
Thanks, Quentin
This is never been merged yet? I'm really interested in, please go ahead!
Unfortunately, it is not mine to merge - Quentin seems to have closed the issue without merging. I redid the change and attached the diff file to this message. imapdedup.authuser.zip
Sorry! I had no intention of closing this! Must have clicked the wrong button.
Do add some documentation and I'll look at merging it in soon. (It's a hectic week for me, so it might not happen immediately, but I'll try to get to it soon!)
Apologies, Q
I don't know what type of documentation you want other than what I already provided. Can you give me some examples? For reference see https://wiki.xmission.com/Zimbra_Migration:_IMAPSync#IMAP_Admin_Account_Logins.
@B-LUC I guess the right way is create a pull request which can be merged, and add a few lines how to use this feature inside readme.
You may use https://github.com/quentinsf/IMAPdedup/pull/60 as example.
Right - I'm very sorry, everyone, that this took so long to get merged! I'm often slow, but I'm not often that slow!
But it's there now. I don't have any way to test it, so please re-open this if there are any issues.
I had to find a way to connect to a Zimbra server without knowing the user's password. Fortunately Zimbra allows you to login as one user (typically an "admin" user) and then impersonate the user that you really want. It is done via the "AUTHENTICATE PLAIN" command (which must be enabled in Zimbra). Below is the "diff" to your original code - actually pretty straight forward. I added another option "-a|--authuser" and a simple code snippet to use "authenticate" instead of "login" if it is set. It works for me :)
--- imapdedup.py 2018-04-24 11:21:58.415659097 -0400 +++ imapdedup.bluc.py 2018-04-24 22:16:16.769606461 -0400 @@ -60,6 +60,7 @@ parser.add_option("-s", "--server",dest='server',help='IMAP server') parser.add_option("-p", "--port", dest='port', help='IMAP server port', type='int') parser.add_option("-x", "--ssl", dest='ssl', action="store_true", help='Use SSL')
parser.add_option("-a", "--authuser", dest='authuser', help='IMAP admin user (e.g. for Zimbra)') parser.add_option("-u", "--user", dest='user', help='IMAP user name') parser.add_option("-w", "--password", dest='password', help='IMAP password (Will prompt if not specified)') parser.add_option("-v", "--verbose", dest="verbose", action="store_true", help="Verbose mode") @@ -198,6 +199,10 @@
try: if not options.process: