Troubleshooting a last request failed: [AUTH] Username and password not accepted error with Gmail

Symptom

Admins of WHMCS instances which are email importing from Gmail, may start to receive notification emails from the system with the subject POP3 Connection Error.

The error details within the email are:

last request failed: [AUTH] Username and password not accepted

Cause

Gmail is shutting down IMAP access using basic password authentication and app passwords. The system cannot access your mailboxes to import emails using these authentication methods because Gmail is now rejecting the requests.

For more information see Google Help Center guide; Transition from less secure apps to OAuth.

Solution

Update the Mail Importing Configuration settings in the Support Department configuration to use Email Importing with OAuth2 and Google.

For step-by-step instructions, see Set Up Email Importing - Google