How to set up Google App Passwords

From Kolmisoft Wiki
Revision as of 09:39, 10 June 2022 by Gilbertas (talk | contribs)
Jump to navigationJump to search

Description

Starting from May 30, 2022, Google no longer supports the Less secure app access option. This means that the only way to use Google email servers in MOR/M4 is by using Google App Passwords.


Google App Password configuration


Goole App Passwords generation is a two-part process. Firstly, we need to enable two-factor authentication. Once this is enabled we will be able to generate Google App Password for MOR/M4.

Enabling 2-Step Verification


Two-Step verification is documented by Google on this page.

Here is a step-by-step example with screenshots for a 2-Step Verification with SMS:

1. Go to your Google Account. This should be the account you will use for MOR/M4. If you currently using a different account, please log in to the correct one which is used in MOR/M4.

2. Click on Security.


Gmail1.png

3. Click on 2-Step Verification.


Gmail2.png

4. 2-Step Verification window will open. Click on GET STARTED.


Gmail3.png

5. If Google will ask you to authenticate again, enter the correct password for your account.


Gmail4.png

6. Enter your Phone which will receive SMS during a 2-Step Verification and click NEXT.


Gmail5.png

7. Enter the code that you received from Google and click NEXT.


Gmail6.png

8. Turn on 2-Step Verification.


Gmail7.png



Generating Google App Password

Google App Passwords is documented by Google on this page.
Here is a step-by-step example with screenshots that demonstrates how to generate Google App Password for MOR/M4:

1. Go to your Google Account. This should be the account you will use for MOR/M4. If you currently using a different account, please log in to the correct one which is used in MOR/M4.

2. Click on Security.


Gmail1.png

3. Select App passwords. If Google will ask you to authenticate again, enter the correct password for your account.


Gmail8.png

4. In App passwords window:

  • In Select app choose Mail
  • In Select device choose Other (Custom name)


Gmail9.png

5. Google will ask to enter the device name. We suggest entering either MOR or M4 (depending on which switch you use). Press Generate.


Gmail10.png

6. The app password (16-character code) will be displayed in the Yellow bar. This is the code you will use in MOR/M4. Please note that code is displayed with space every 4 characters, but once you copy, it will be copied correctly as 16-character code without spaces. After copying the password, click DONE.

Gmail11.png



Configuration in MOR/M4



Configuration for Switch SMTP server

If you are using the Gmail SMTP server to send emails from your switch, enter generated App Password:



Configuration for POP server used in Automatic Tariff Import

This is relevant only if you are using Automatic Tariff Import.

The same instructions apply both for MOR and M4. On your switch (use GUI server if the switch is a multiserver system), log in over SSH and:

  • Open file /root/.fetchmailrc with text editor, for example mcedit
mcedit /root/.fetchmailrc
  • Replace current password with generated App Password. If using mcedit, press F2 to save changes and F10 to exit the editor.


Gmail fetchmail.png

This is it, from now switch will use generated App Password to login to Gmail POP server and download email.