Mail configuration with server_environment for Google Gmail
This module allows to configure Gmail outgoing servers with server-env.
auto_awesome What this module does
AI-generated from the code · Odoo 18.0Lets administrators store the Google Gmail authorization code and refresh token for outgoing mail servers in server environment configuration files instead of typing them in Odoo.
This module extends the outgoing mail server configuration so that the Google Gmail credentials can be supplied from external server environment files rather than being entered manually in the Odoo interface.
- It adds two Gmail-specific settings to the list of values that Odoo reads from the server environment: the Google Gmail authorization code and the Google Gmail refresh token.
- These values belong to the
ir.mail_servermodel, which is the record behind each outgoing mail server. - Because the values come from the server environment, they are not stored or edited as normal fields in the Odoo database, which helps keep sensitive credentials out of the user interface and out of database backups.
- The module works together with the Google Gmail mail integration and the server environment tools, so the Gmail sending flow keeps working while the credentials are provided externally.
No new menus, screens, buttons, reports, scheduled actions or business rules are added by this module. It only changes where the Gmail authorization code and refresh token are read from when an outgoing mail server is used.
Depends on
Text generated by AI (DeepSeek) from reading the Odoo 18.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub
Availability by version
Reviewed: 2026-11-03Confirmation status: 4 confirmed, 5 with no information of 9 versions.
Sources · Odoo 18.0
Confirmed on 2026-11-03 in branch 18.0 of OCA/server-env.
terminal Installation and usage
OCA documentation · Odoo 18.0Configuration
Source · Odoo 18.0Example of config file :
[ir.config_parameter] google_gmail_client_id = YOUR_GMAIL_API_CLIENT_ID google_gmail_client_secret = YOUR_GMAIL_API_CLIENT_SECRET
[outgoing_mail.gmail_smtp_server] smtp_host = smtp.gmail.com smtp_port = 587 smtp_user = example@gmail.com smtp_encryption = starttls use_google_gmail_service = True google_gmail_authorization_code = YOUR_ACCOUNT_AUTH_CODE google_gmail_refresh_token = YOUR_REFRESH_TOKEN
These two are global parameters, in core they're configured in General Settings:
YOUR_GMAIL_API_CLIENT_ID: The client ID of your Google API project.YOUR_GMAIL_API_CLIENT_SECRET: The client secret of your Google API project.
These two are account-specific parameters:
YOUR_ACCOUNT_AUTH_CODE: In core, there's a button that opens an URL to generate it.YOUR_REFRESH_TOKEN: In core, it's generated automatically when the google_gmail_authorization_code is written. It's not shown on the form, but I recommend having Odoo generate it and extract it from there, before setting up the server-env.
No verified information in OCA: Installation, Usage.
Installation instructions, the distribution package, dependencies and configuration steps are not shown because they have not yet been verified in the module documentation for any version.
Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.