quentinsf / IMAPdedup

IMAP message de-duplicator
https://quentinsf.com/software/imapdedup
GNU General Public License v2.0
321 stars 57 forks source link

Add option to use an admin user account for authentication #42

Closed B-LUC closed 2 years ago

B-LUC commented 6 years ago

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')

quentinsf commented 6 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

lovelord83 commented 2 years ago

This is never been merged yet? I'm really interested in, please go ahead!

B-LUC commented 2 years ago

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

quentinsf commented 2 years ago

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

B-LUC commented 2 years ago

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.

catap commented 2 years ago

@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.

quentinsf commented 2 years ago

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.