I used to have CiviCRM Inbound Email processing perfectly, but now it no longer works. Whenever the process is run, I get the following error:

Full message: 
Finished execution of Process Inbound Emails with result: Failure, Error message: A fatal error was triggered: Could not connect to MailStore for [prefix]@[domain][email protected]

Error message: 

An error occured while sending or receiving mail. The IMAP server did not accept the username and/or password: A0001 BAD Too many arguments provided 136-v6mb280518080wmm.

Please help me fix the config (or if the config is correct I'll set about debugging). The password is functioning perfectly (I emptied it before taking a screenshot of the config). How can I fix this?

enter image description here

This is for a domain hosted by Google.

3 Answers 3


I would guess from the error "A0001 BAD Too many arguments provided" and this unrelated github issue that you may have a space in your password (or some other character that needs better handling).

That CiviCRM also triggers "A0001 BAD Too many arguments provided" error suggests CiviCRM doesn't handle spaces in passwords correctly for IMAP/POP3.

Here's some advice on debugging the inbound mail process in CiviCRM, which might be useful!


The config looks correct.

Key things to check:

  • You can connect to the account using the credentials via the gmail web interface
  • You don't have 2FA set up and that less secure apps are allowed for the account
  • If the above fails try activating the unlock captcha https://accounts.google.com/b/0/DisplayUnlockCaptcha then test logging in by triggering the scheduled job. You should notice the unlock captcha page change after the log in attempt has finished - you might need to trigger the job again after it's run to connect.
  • Finally I'd make sure you can connect to gmail from that server by using something like swaks or similar to connect -> https://serverfault.com/questions/846026/can-i-send-a-mail-through-gmail-with-swaks (Just to make sure you are dealing with a civicrm issue an not a server issue).

I also needed to turn "Less secure apps" ON. More on that here: https://support.google.com/accounts/answer/6010255?hl=en

Clicking "Save & Test" on the Mail Accounts config page still resulted in "An error occured while sending or receiving mail. Failed to connect to the server: :143. (See log for more details.)" error, but triggering the "Process Inbound Emails" job actually worked flawlessly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.