Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request for password never mentions the password #558

Closed
carandraug opened this issue Jun 12, 2018 · 4 comments
Closed

request for password never mentions the password #558

carandraug opened this issue Jun 12, 2018 · 4 comments

Comments

@carandraug
Copy link
Contributor

When logging by typing password manually, the interface is:

Account sync ACCOUNT-NAME:
 *** Processing account ACCOUNT-NAME
 Establishing connection to REMOTE-HOST:REMOTE-PORT (REMOTE-NAME)
Enter password for account 'REMOTE-NAME':

but it never actually shows the username. If there is any issue on the username, the following is is displayed which again never shows the username

Account sync ACCOUNT-NAME:
 *** Processing account ACCOUNT-NAME
 Establishing connection to REMOTE-HOST:REMOTE-PORT (REMOTE-NAME)
Enter password for account 'REMOTE-NAME': 
 PLAIN authentication failed: AUTHENTICATE failed.
 LOGIN authentication failed: LOGIN failed.
 ERROR: All authentication types failed:
	PLAIN: AUTHENTICATE failed.
	LOGIN: LOGIN failed.
 *** Finished account 'ACCOUNT-NAME' in 0:03
ERROR: Exceptions occurred during the run!
ERROR: All authentication types failed:
	PLAIN: AUTHENTICATE failed.
	LOGIN: LOGIN failed.

Because the username is never shown on the output, if the issue is on the username debugging is a lot harder (see issue #557 for what caused the issue to me, I had to go and modify the sources to find out what was being used).

Related issue offlineimap.imapserver.IMAPserver.__plainhandler should probably check if authc is None. I tried to raise a OfflineImapError and while the exception message got printed, it continued on and asked for the password anyway.

@nicolas33
Copy link
Member

Run offlineimap with the -a CLI option to know which account is failing.

@carandraug
Copy link
Contributor Author

Run offlineimap with the -a CLI option to know which account is failing.

I know what account is failing. The issue is that the username used is never displayed. If there is an issue on the parsing of the config file (which was my problem) and the username is not show, it's not possible for a user to find the issue.

So I'm suggesting that instead of:

 Establishing connection to REMOTE-HOST:REMOTE-PORT (REMOTE-NAME)
Enter password for account 'REMOTE-NAME':

Something like this should be show:

 Establishing connection to REMOTE-HOST:REMOTE-PORT (REMOTE-NAME)
Enter password for account 'REMOTE-USERNAME':

I tried to do this, but the getpass method is not being passed the username. I'm also unsure if there's cases where there's not really an username?

@nicolas33
Copy link
Member

I tried to do this, but the getpass method is not being passed the username. I'm also unsure if there's cases where there's not really an username?

The getpass() signature shall be changed, yes. Notice that a wrong parsing of the configuration file might still lead to undefined behaviour, though.

carandraug added a commit to carandraug/offlineimap that referenced this issue Jun 13, 2018
…fflineIMAP#558)

When asking for a password interactively, the username is never
displayed which may hide problems (typos on the configuration, or
issues on offlineimap parsing of the config file).  The hostname,
port, and account name are already displayed when establishing the
connection.  When asking for password, the account name is displayed
again.  Change it to display the username.
@carandraug carandraug mentioned this issue Jun 13, 2018
3 tasks
nicolas33 pushed a commit that referenced this issue Jun 16, 2018
When asking for a password interactively, the username is never
displayed which may hide problems (typos on the configuration, or
issues on offlineimap parsing of the config file).  The hostname,
port, and account name are already displayed when establishing the
connection.  When asking for password, the account name is displayed
again.  Change it to display the username.

Github-ref: #558
Signed-off-by: David Miguel Susano Pinto <carandraug+dev@gmail.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
nicolas33 pushed a commit that referenced this issue Jun 16, 2018
If the username value is not provided on the configuration file, then
username if of NoneType and NULL.join will bomb since Nones can't be
joined with strings.  So check if username is empty and raise an
exception if so.

Github-ref: #558
Signed-off-by: David Miguel Susano Pinto <carandraug+dev@gmail.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
@nicolas33
Copy link
Member

The fix will be in the release after v7.2.1. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants