December 25, 2023

Use GMail with Gitea



To integrate GMail with your Gitea system, follow these steps:

  1. Generate Google Application Password:
    Obtain a Google Application Password for secure authentication. You can generate one in your Google Account settings, especially if two-factor authentication is enabled.

  2. Edit Gitea Configuration:
    Use a text editor to modify the Gitea configuration file (/etc/gitea/app.ini). Add the following settings under the [mailer] section:

    [mailer]
    ENABLED = true
    SMTP_ADDR = smtp.gmail.com
    SMTP_PORT = 465
    FROM = <google gmail account email address>
    USER = <google gmail account email address>
    PASSWD = <google app password here>
    PROTOCOL = smtps


    Adjust the values according to your Gmail account and the generated application password.

  3. Restart Gitea:
    Restart the Gitea service to apply the new configuration:

    $ systemctl restart gitea

  4. Test Email Configuration:
    Access the Admin Settings screen in Gitea, and initiate a test email. This step ensures that the Gmail integration is functioning correctly.
By following these steps, you'll enable Gitea to use your Gmail account for sending email notifications and other communication. Ensure that the provided Gmail application password is secure and follows best practices for authentication.

No comments: