First you need to activate 2-Step verification for your Google account.

Then you need to create an app-specific password for the same Google account.

Starting with Mail Archiver 5.3 beta 2 you can select Gmail as authentication method. But this only prefills the servername. Now enter your app-specific password. The passwords are device specific as I just learned!

As you can see from the green check mark the login was successful.