Answers.Body: <p>I would guess from the error "A0001 BAD Too many arguments provided" and <a href="https://github.com/dlech/gmailbuttons/issues/15" rel="nofollow noreferrer">this unrelated github issue</a> that <strong>you may have a space in your password</strong> (or some other character that needs better handling).</p>
  
  <p>That CiviCRM also triggers "A0001 BAD Too many arguments provided" error suggests CiviCRM doesn't handle spaces in passwords correctly for IMAP/POP3.</p>
  
  <p>Here's some <a href="https://civicrm.stackexchange.com/questions/15319/process-inbound-emails-failed-no-mail-protocol/15320#15320">advice on debugging the inbound mail process in CiviCRM</a>, which might be useful!</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-26T05:39:31.937Z
Answers.LastActivityDate: 2018-11-26T05:39:31.937Z
Answers.UserDisplayName: Chris Burgess
Answers.Body: <p>I also needed to turn &quot;Less secure apps&quot; ON. More on that here: <a href="https://support.google.com/accounts/answer/6010255?hl=en" rel="nofollow noreferrer">https://support.google.com/accounts/answer/6010255?hl=en</a></p>
  <p>Clicking &quot;Save &amp; Test&quot; on the Mail Accounts config page still resulted in &quot;An error occured while sending or receiving mail. Failed to connect to the server: :143. (See log for more details.)&quot; error, but triggering the &quot;Process Inbound Emails&quot; job actually worked flawlessly.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-09-13T04:35:19.883Z
Answers.LastActivityDate: 2022-09-13T04:35:19.883Z
Answers.UserDisplayName: MtnPavlas
Answers.Body: <p>The config looks correct.</p>
  
  <p>Key things to check:</p>
  
  <ul>
  <li>You can connect to the account using the credentials via the gmail web interface</li>
  <li>You don't have 2FA set up and that less secure apps are allowed for the account</li>
  <li>If the above fails try activating the unlock captcha <a href="https://accounts.google.com/b/0/DisplayUnlockCaptcha" rel="nofollow noreferrer">https://accounts.google.com/b/0/DisplayUnlockCaptcha</a> 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.</li>
  <li>Finally I'd make sure you can connect to gmail from that server by using something like swaks or similar to connect -> <a href="https://serverfault.com/questions/846026/can-i-send-a-mail-through-gmail-with-swaks">https://serverfault.com/questions/846026/can-i-send-a-mail-through-gmail-with-swaks</a> (Just to make sure you are dealing with a civicrm issue an not a server issue).</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-26T04:24:12.670Z
Answers.LastActivityDate: 2018-11-26T04:24:12.670Z
Answers.UserDisplayName: Luke Stewart
Body: <p>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: </p>
  
  <pre><code>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].org@imap.gmail.com
  
  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.
  </code></pre>
  
  <p>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?</p>
  
  <p><a href="https://i.sstatic.net/0kXDS.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/0kXDS.png" alt="enter image description here"></a></p>
  
  <p>This is for a domain hosted by Google.</p>
  
Tags: <email>
Title: Configuring Inbound Email Config
ThreadText: # Configuring Inbound Email Config
  
  (Asked by: username_0 on 2018-11-25)
  
  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].org@imap.gmail.com
  
  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](https://i.sstatic.net/0kXDS.png)](https://i.sstatic.net/0kXDS.png)
  
  This is for a domain hosted by Google.
  
  **Tags:** email
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2018-11-26. Score: 2
  
  I would guess from the error "A0001 BAD Too many arguments provided" and [this unrelated github issue](https://github.com/dlech/gmailbuttons/issues/15) 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](https://civicrm.stackexchange.com/questions/15319/process-inbound-emails-failed-no-mail-protocol/15320#15320), which might be useful!
  
  
  ---
  
  ### Answer by username_2 on 2022-09-13. Score: 1
  
  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.
  
  
  ---
  
  ### Answer by username_3 on 2018-11-26. Score: 1
  
  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).
  
  
  ---
  
  