Bug #97
Noninteractive fetch fails on password error
| Status : | Feedback | Start : | 09/12/2008 | |
| Priority : | Normal | Due date : | ||
| Assigned to : | John Goerzen | % Done : | 0% |
|
| Category : | IMAP | |||
| Target version : | 6.0.0 | |||
| Resolution : | Invalid |
Description
Retrieving mails fails with the message "user not found". If I set the password after the error message in the interactive way, it works. Password in ~/.offlineimaprc is correct (multiple checks & replacement).
Note I use the same user and password with sylpheed, so settings seems good.
Status : always reproducible.
DEBUG[imap]: 42:58.64 imaplib version 2.58
DEBUG[imap]: 42:58.64 new IMAP4 connection, tag=LPND
DEBUG[imap]: 42:58.70 < * OK IMAP4 server ready
DEBUG[imap]: 42:58.70 matched r'\* (?P<type>[A-Z-]+)( (?P<data>.*))?' => ('OK', ' IMAP4 server ready', 'IMAP4 server ready')
DEBUG[imap]: 42:58.70 untagged_responses[OK] 0 += ["IMAP4 server ready"]
DEBUG[imap]: 42:58.70 > LPND0 CAPABILITY
DEBUG[imap]: 42:58.79 < * CAPABILITY IMAP4 IMAP4rev1 NAMESPACE UIDPLUS CHILDREN X-NETSCAPE
DEBUG[imap]: 42:58.79 matched r'\* (?P<type>[A-Z-]+)( (?P<data>.*))?' => ('CAPABILITY', ' IMAP4 IMAP4rev1 NAMESPACE UIDPLUS CHILDREN X-NETSCAPE', 'IMAP4 IMAP4rev1 NAMESPACE UIDPLUS CHILDREN X-NETSCAPE')
DEBUG[imap]: 42:58.79 untagged_responses[CAPABILITY] 0 += ["IMAP4 IMAP4rev1 NAMESPACE UIDPLUS CHILDREN X-NETSCAPE"]
DEBUG[imap]: 42:58.79 < LPND0 OK Completed
DEBUG[imap]: 42:58.79 matched r'(?P<tag>LPND\d+) (?P<type>[A-Z]+) (?P<data>.*)' => ('LPND0', 'OK', 'Completed')
DEBUG[imap]: 42:58.79 untagged_responses[CAPABILITY] => ['IMAP4 IMAP4rev1 NAMESPACE UIDPLUS CHILDREN X-NETSCAPE']
DEBUG[imap]: 42:58.79 CAPABILITIES: ('IMAP4', 'IMAP4REV1', 'NAMESPACE', 'UIDPLUS', 'CHILDREN', 'X-NETSCAPE')
DEBUG[imap]: Attempting plain authentication
DEBUG[imap]: 42:58.79 > LPND1 LOGIN ni.s "******
###Noninteractive.Basic, Noninteractive.Quiet"
DEBUG[imap]: 43:01.09 < LPND1 NO Login failed: user not found
DEBUG[imap]: 43:01.09 matched r'(?P<tag>LPND\d+) (?P<type>[A-Z]+) (?P<data>.*)' => ('LPND1', 'NO', 'Login failed: user not found')
DEBUG[imap]: 43:01.09 NO response: Login failed: user not found
Establishing connection to imap.laposte.net:143.
DEBUG[imap]: 43:01.33 imaplib version 2.58
DEBUG[imap]: 43:01.33 new IMAP4 connection, tag=FMCK
DEBUG[imap]: 43:01.39 < * OK IMAP4 server ready
DEBUG[imap]: 43:01.39 matched r'\* (?P<type>[A-Z-]+)( (?P<data>.*))?' => ('OK', ' IMAP4 server ready', 'IMAP4 server ready')
DEBUG[imap]: 43:01.39 untagged_responses[OK] 0 += ["IMAP4 server ready"]
DEBUG[imap]: 43:01.39 > FMCK0 CAPABILITY
DEBUG[imap]: 43:01.46 < * CAPABILITY IMAP4 IMAP4rev1 NAMESPACE UIDPLUS CHILDREN X-NETSCAPE
DEBUG[imap]: 43:01.46 matched r'\* (?P<type>[A-Z-]+)( (?P<data>.*))?' => ('CAPABILITY', ' IMAP4 IMAP4rev1 NAMESPACE UIDPLUS CHILDREN X-NETSCAPE', 'IMAP4 IMAP4rev1 NAMESPACE UIDPLUS CHILDREN X-NETSCAPE')
DEBUG[imap]: 43:01.46 untagged_responses[CAPABILITY] 0 += ["IMAP4 IMAP4rev1 NAMESPACE UIDPLUS CHILDREN X-NETSCAPE"]
DEBUG[imap]: 43:01.46 < FMCK0 OK Completed
DEBUG[imap]: 43:01.46 matched r'(?P<tag>FMCK\d+) (?P<type>[A-Z]+) (?P<data>.*)' => ('FMCK0', 'OK', 'Completed')
DEBUG[imap]: 43:01.46 untagged_responses[CAPABILITY] => ['IMAP4 IMAP4rev1 NAMESPACE UIDPLUS CHILDREN X-NETSCAPE']
DEBUG[imap]: 43:01.46 CAPABILITIES: ('IMAP4', 'IMAP4REV1', 'NAMESPACE', 'UIDPLUS', 'CHILDREN', 'X-NETSCAPE')
DEBUG[imap]: Attempting plain authentication
% cat ~/.offlineimaprc
/>
accounts = Test
metadata = ~/.offlineimap
maxsyncaccounts = 1
ui = TTY.TTYUI, Noninteractive.Basic
#Noninteractive.Basic, Noninteractive.Quiet
fontfamily = Helvetica
fontsize = 8
/>
localrepository = LocalExample
remoterepository = RemoteExample
/>
type = Maildir
localfolders = ~/Mail/ni.s_laposte.net
/>
type = IMAP
remotehost=imap.laposte.net
remoteuser=ni.s
remotepass=******
History
09/18/2008 09:32 AM - John Goerzen
- Resolution set to Invalid
- Status changed from New to Feedback
I'm not sure where the bug is here. OfflineIMAP authenticates fine for me and everyone else. Does your password contain a percent sign?
If not, it would be interesting to compare the LOGIN it sends that yields an error with the one it sends that works.
09/19/2008 03:42 PM - Nicolas Sebrecht
> I'm not sure where the bug is here. OfflineIMAP authenticates fine for me and everyone else.
But for sure it is.
> Does your password contain a percent sign?
No, only alpha-numeric characters (for both, see below).
> If not, it would be interesting to compare the LOGIN it sends that yields an error with the one it sends that works.
I'm not sure the problem is there. Account information are good.
I just added a new account ("accounts = Test, Epsi") and the authentication problem moves to the /last/ account (with and without the command argument "-1").
The symptom is the same : giving the password by the interactive way is ok (after the authentication problem) but not it doesn't authenticate by the non-interactive way.
I don't know if /last/ is the good term but the sync order is this one :
Account sync main:
Establishing connection to imap.laposte.net:143.
Account sync Epsi:
Establishing connection to imap.googlemail.com:993.
Anyway, just adding a new account made the Test account authentication success (account Test didn't changed). The new Epsi account has now an authentication problem though (password checked in .offlineimaprc).
Cheers.
09/19/2008 03:46 PM - Nicolas Sebrecht
Forgot the new error message :
Account sync Epsi:
RemoteEpsi: LOGIN command error: BAD ['Failed to parse your command 3if1344813fge.4']
09/19/2008 03:56 PM - Nicolas Sebrecht
I added a third different account.
The authentication for the first and the second accounts is now ok, but not for the last one :
Account sync progedys:
Remoteprogedys: Error in IMAP command received by server.
Remoteprogedys: Enter password:
Any idea ?
Cheers,
09/19/2008 04:42 PM - Nicolas Sebrecht
I solved the problem by removing all the commentary (placed after the accounts information).
Please tell me if you can (or not) correct this, I have an open bug at gentoo. Is the parser of the configuration file good ?
##################################################- General definitions ##################################################
###[general]
- This specifies where offlineimap is to store its metadata.
- This directory will be created if it does not already exist.
###metadata = ~/.offlineimap
- This variable specifies which accounts are defined. Separate them
- with commas. Account names should be alphanumeric only.
- You will need to specify one section per account below. You may
- not use "general" for an account name. #
###accounts = Test
- Offlineimap can synchronize more the one account at a time. If you
- want to enable this feature, set the below value to something
- greater than 1. To force it to synchronize only one account at a
- time, set it to 1. #
###maxsyncaccounts = 1
- You can specify one or more user interface modules for OfflineIMAP
- to use. OfflineIMAP will try the first in the list, and if it
- fails, the second, and so forth. #
- The pre-defined options are:
- Tk.Blinkenlights -- A graphical interface, shows LEDs and a single log
- Tk.VerboseUI -- A graphical interface, shows logs per thread
- Curses.Blinkenlights -- A text-based (terminal) interface similar to
- Tk.Blinkenlights
- TTY.TTYUI -- a text-based (terminal) interface
- Noninteractive.Basic -- Noninteractive interface suitable for cronning
- Noninteractive.Quiet -- Noninteractive interface, generates no output
- except for errors. #
- You can override this with a command-line option -u.
###ui = Tk.Blinkenlights, Tk.VerboseUI, Curses.Blinkenlights, TTY.TTYUI,
###Noninteractive.Basic, Noninteractive.Quiet
- If you try to synchronize messages to a read-only folder,
- OfflineIMAP will generate a warning. If you want to suppress these
- warnings, set ignore-readonly to yes. Read-only IMAP folders allow
- reading but not modification, so if you try to change messages in
- the local copy of such a folder, the IMAP server will prevent
- OfflineIMAP from propogating those changes to the IMAP server.
###ignore-readonly = no
- Advanced settings
- You can give a Python source filename here and all config file
- python snippets will be evaluated in the context of that file.
- This allows you to e.g. define helper functions in the Python
- source file and call them from this config file. You can find
- an example of this in the manual. #
- pythonfile = ~/.offlineimap.py #
- Mailbox name recorder ##################################################
#[mbnames]
- offlineimap can record your mailbox names in a format you specify.
- You can define the header, each mailbox item, the separator,
- and the footer. Here is an example for Mutt.
- If enabled is yes, all six setting must be specified, even if they
- are just the empty string "". #
- The header, peritem, sep, and footer are all Python expressions passed
- through eval, so you can (and must) use Python quoting.
#enabled = no
#filename = ~/Mutt/muttrc.mailboxes
#header = "mailboxes "
#peritem = "+%(accountname)s/%(foldername)s"
#sep = " "
#footer = "\n"
- You can also specify a folderfilter. It will apply to the
- translated folder name here, and it takes TWO arguments:
- accountname and foldername. In all other ways, it will
- behave identically to the folderfilter for accounts. Please see
- that section for more information and examples. #
- Note that this filter can be used only to further restrict mbnames
- to a subset of folders that pass the account's folderfilter.
- Blinkenlights configuration ##################################################
#[ui.Tk.Blinkenlights]
- Specifies the default number of lines in the log.
###loglines = 5
- Specifies how many lines are in the scrollback log buffer.
###bufferlines = 500
- If true, says that the log should be enabled by default.
- Otherwise, you have to click "Show Log" to enable the log.
###showlog = false
- Sets the font information.
###fontfamily = Helvetica
###fontsize = 8
- Accounts ##################################################
- This is an account definition clause. You'll have one of these
- for each account listed in general/accounts above.
- Basic settings
- These settings specify the two folders that you will be syncing.
- You'll need to have a "Repository ..." section for each one.
###localrepository = LocalExample
###remoterepository = RemoteExample
- Advanced settings
- You can have offlineimap continue running indefinately, automatically
- syncing your mail periodically. If you want that, specify how
- frequently to do that (in minutes) here. You can also specify
- fractional minutes (ie, 3.25).
- autorefresh = 5
###[Repository LocalExample]
- This is one of the two repositories that you'll work with given the
- above example. Each repository requires a "type" declaration. #
- The types supported are Maildir and IMAP. #
###type = Maildir
- Specify local repository. Your IMAP folders will be synchronized
- to maildirs created under this path. OfflineIMAP will create the
- maildirs for you as needed.
###localfolders = ~/Mail/ni.s_laposte.net
- You can specify the "path separator character" used for your Maildir
- folders. This is inserted in-between the components of the tree.
- It defaults to ".". If you want your Maildir folders to be nested,
- set it to "/".
###sep = .
###[Repository RemoteExample]
- And this is the remote repository. For now, we only support IMAP here.
###type = IMAP
- Specify the remote hostname.
###remotehost = imap.laposte.net
- Whether or not to use SSL.
###ssl = no
- Specify the port. If not specified, use a default port.
- remoteport = 993
- Specify the remote user name.
###remoteuser = ni.s
- There are three ways to specify the password for the remote IMAP
- server: #
- 1. No password at all specified in the config file. You will
- be prompted for the password when OfflineIMAP starts. #
- 2. The remote password stored in this file with the remotepass
- option. Example:
#
###remotepass = *** # - 3. The remote password stored as a single line in an external
- file, which is referenced by the remotefile option. Example: #
- remotepassfile = ~/Password.IMAP.Account1 #
- 4. With a preauth tunnel. With this method, you invoke an external
- program that is guaranteed NOT to ask for a password, but rather
- to read from stdin and write to stdout an IMAP procotol stream
- that begins life in the PREAUTH state. When you use a tunnel,
- you do NOT specify a user or password (if you do, they'll be
- ignored.) Instead, you specify a preauthtunnel, as this
- example illustrates for Courier IMAP on Debian: #
- preauthtunnel = ssh -q imaphost '/usr/bin/imapd ./Maildir' #
- Advanced settings
- Some IMAP servers need a "reference" which often refers to the
- "folder root". This is most commonly needed with UW IMAP, where
- you might need to specify the directory in which your mail is
- stored. Most users will not need this. #
- reference = Mail
- OfflineIMAP can use multiple connections to the server in order
- to perform multiple synchronization actions simultaneously.
- This may place a higher burden on the server. In most cases,
- setting this value to 2 or 3 will speed up the sync, but in some
- cases, it may slow things down. The safe answer is 1. You should
- probably never set it to a value more than 5.
###maxconnections = 1
- OfflineIMAP normally closes IMAP server connections between refreshes if
- the global option autorefresh is specified. If you wish it to keep the
- connection open, set this to true. If not specified, the default is
- false. Keeping the connection open means a faster sync start the
- next time and may use fewer server resources on connection, but uses
- more server memory. This setting has no effect if autorefresh is not set.
#holdconnectionopen = no
- If you want to have "keepalives" sent while waiting between syncs,
- specify the amount of time IN SECONDS between keepalives here. Note that
- sometimes more than this amount of time might pass, so don't make it
- tight. This setting has no effect if autorefresh and holdconnectionopen
- are not both set.
- keepalive = 60
- Normally, OfflineIMAP will expunge deleted messages from the server.
- You can disable that if you wish. This means that OfflineIMAP will
- mark them deleted on the server, but not actually delete them.
- You must use some other IMAP client to delete them if you use this
- setting; otherwise, the messgaes will just pile up there forever.
- Therefore, this setting is definately NOT recommended. #
- expunge = no
- You can specify a folder translator. This must be a eval-able
- Python expression that takes a foldername arg and returns the new
- value. I suggest a lambda. This example below will remove "INBOX." from
- the leading edge of folders (great for Courier IMAP users) #
- WARNING: you MUST construct this such that it NEVER returns
- the same value for two folders, UNLESS the second values are
- filtered out by folderfilter below. Failure to follow this rule
- will result in undefined behavior #
- nametrans = lambda foldername: re.sub('^INBOX\.', '', foldername)
- Using Courier remotely and want to duplicate its mailbox naming
- locally? Try this: #
- nametrans = lambda foldername: re.sub('^INBOX\.*', '.', foldername)
- You can specify which folders to sync. You can do it several ways.
- I'll provide some examples. The folderfilter operates on the
- UNTRANSLATED name, if you specify nametrans. It should return
- true if the folder is to be included; false otherwise. #
- Example 1: synchronizing only INBOX and Sent. #
- folderfilter = lambda foldername: foldername in ['INBOX', 'Sent'] #
- Example 2: synchronizing everything except Trash. #
- folderfilter = lambda foldername: foldername not in ['Trash'] #
- Example 3: Using a regular expression to exclude Trash and all folders
- containing the characters "Del". #
- folderfilter = lambda foldername: not re.search('(^Trash$|Del)', foldername) #
- If folderfilter is not specified, ALL remote folders will be
- synchronized. #
- You can span multiple lines by indenting the others. (Use backslashes
- at the end when required by Python syntax) For instance: #
- folderfilter = lambda foldername: foldername in
- ['INBOX', 'Sent Mail', 'Deleted Items',
- 'Received'] #
- FYI, you could also include every folder with: #
- folderfilter = lambda foldername: 1 #
- And exclude every folder with: #
- folderfilter = lambda foldername: 0
- You can specify folderincludes to include additional folders.
- It should return a Python list. This might be used to include a
- folder that was excluded by your folderfilter rule, to include a
- folder that your server does not specify with its LIST option, or
- to include a folder that is outside your basic reference. Some examples: #
- To include debian.user and debian.personal: #
- folderincludes = ['debian.user', 'debian.personal'] #
- To include your INBOX (UW IMAPd users will find this useful if they
- specify a reference): #
- folderincludes = ['INBOX'] #
- To specify a long list: #
- folderincludes = ['box1', 'box2', 'box3', 'box4',
- 'box5', 'box6']
#folderincludes = ['INBOX', 'INBOX.ABUL' ]
- You can specify foldersort to determine how folders are sorted.
- This affects order of synchronization and mbnames. The expression
- should return -1, 0, or 1, as the default Python cmp() does. The
- two arguments, x and y, are strings representing the names of the folders
- to be sorted. The sorting is applied AFTER nametrans, if any. #
- To reverse the sort: #
- foldersort = lambda x, y: -cmp(x, y)
09/19/2008 07:17 PM - John Goerzen
I don't quite follow; it looks like you have commented out everything. Can you please post the username and password section of your config file before and after making the fix that you did?
The parser is from Python and I would be quite surprised if it has a bug. Note that comments must go on lines by themselves; if you had a comment after the remoteuser = or remotepass = bit, on the same line, that could account for the problem.
10/15/2008 12:53 PM - Nicolas Sebrecht
> I don't quite follow; it looks like you have commented out everything.
Probably because I didn't post the entire .offlineimaprc in my original post. I use to remove commentaries.
> Can you please post the username and password section of your config file before and after making the fix that you did?
Sorry, I haven't the diff anymore.
> if you had a comment after the remoteuser = or remotepass = bit, on the same line, that could account for the problem.
It wasn't the case, for sure.
As I can't give more information on the fix (sorry, really), I think we can close this bug here. I would try to reproduce it and I'll give you the steps (if achieved).