ir.mail_server: fields, relations and API
The ir.mail_server model ("Mail Server") is a persistent model declared by the Base module, then extended by 4 other modules. It exposes 34 fields, 20 of them declared directly on the model; 7 fields from other models point to it. Below you will find every field with its technical name, type, label and relations, followed by an Odoo 19 JSON-2 API call.
Model identity
- Technical name
ir.mail_server- Label
- Mail Server
- Type
- Persistent (models.Model)
- SQL table
ir_mail_server- Origin module
- Base (
base) - Extended by
- mail, google_gmail, mass_mailing, microsoft_outlook
- Default order (_order)
sequence, id- Inherits from (mixins)
- google.gmail.mixinmicrosoft.outlook.mixin
Model fields
20 own fields, 8 inherited from mixins and 6 automatic ORM fields. Click a name to get a direct link to that field.
34 of 34 fields shown
| Technical name | Label | Type | Details |
|---|---|---|---|
| active | Active | boolean | |
| active_mailing_ids | Active mailing using this mail server | one2many | read-only inverse: added by Email Marketing ( |
| from_filter | FROM Filtering Comma-separated list of addresses or domains for which this server can be used. e.g.: "[email protected]" or "odoo.com" | char | |
| mail_template_ids | Mail template using this mail server | one2many | read-only inverse: added by Discuss ( |
| max_email_size | Max Email Size | float | |
| name | Name | char | required |
| owner_limit_count | Owner Limit Count | integer | added by Discuss ( |
| owner_limit_time | Owner Limit Time | datetime | added by Discuss ( |
| owner_user_id | Owner | many2one | added by Discuss ( |
| sequence | Priority When no specific mail server is requested for a mail, the highest priority one is used. Default priority is 10 (smaller number = higher priority) | integer | |
| smtp_authentication | Authenticate with | selection | required Values: |
| smtp_authentication_info | Authentication Info | text | computed |
| smtp_debug | Debugging If enabled, the full output of SMTP sessions will be written to the server log at DEBUG level (this is very verbose and may include confidential info!) | boolean | |
| smtp_encryption | Connection Encryption Choose the connection encryption scheme: - None: SMTP sessions are done in cleartext. - TLS (STARTTLS): TLS encryption is requested at start of SMTP session (Recommended) - SSL/TLS: SMTP sessions are encrypted with SSL/TLS through a dedicated port (default: 465) Choose an additionnal variant for SSL or TLS: - encryption and validation: encrypt the data and authentify the server using its SSL certificate (Recommended) - encryption only: encrypt the data but skip server authentication | selection | required Values: |
| smtp_host | SMTP Server Hostname or IP of SMTP server | char | |
| smtp_pass | Password Optional password for SMTP authentication | char | |
| smtp_port | SMTP Port SMTP Port. Usually 465 for SSL, and 25 or 587 for other cases. | integer | |
| smtp_ssl_certificate | SSL Certificate SSL certificate used for authentication | binary | |
| smtp_ssl_private_key | SSL Private Key SSL private key used for authentication | binary | |
| smtp_user | Username Optional username for SMTP authentication | char | |
| google_gmail_access_token | Access Token | char | inherited from google.gmail.mixin |
| google_gmail_access_token_expiration | Access Token Expiration Timestamp | integer | inherited from google.gmail.mixin |
| google_gmail_refresh_token | Refresh Token | char | inherited from google.gmail.mixin |
| google_gmail_uri | URI The URL to generate the authorization code from Google | char | computed inherited from google.gmail.mixin |
| microsoft_outlook_access_token | Outlook Access Token | char | inherited from microsoft.outlook.mixin |
| microsoft_outlook_access_token_expiration | Outlook Access Token Expiration Timestamp | integer | inherited from microsoft.outlook.mixin |
| microsoft_outlook_refresh_token | Outlook Refresh Token | char | inherited from microsoft.outlook.mixin |
| microsoft_outlook_uri | Authentication URI The URL to generate the authorization code from Outlook | char | computed inherited from microsoft.outlook.mixin |
| create_date | Created on | datetime | read-onlyautomatic |
| create_uid | Created by | many2one | read-onlyautomatic |
| display_name | Display Name | char | read-onlycomputedautomatic |
| id | ID | integer | read-onlyautomatic |
| write_date | Last Updated on | datetime | read-onlyautomatic |
| write_uid | Last Updated by | many2one | read-onlyautomatic |
Relations
Models linked from this model
- mail.template: mail_template_ids
- mailing.mailing: active_mailing_ids
- res.users: owner_user_id
Fields of other models pointing here
- mail.compose.message: mail_server_id
- mail.message: mail_server_id
- mail.template: mail_server_id
- mailing.mailing: mail_server_id
- res.config.settings: mass_mailing_mail_server_id
- res.users: outgoing_mail_server_id
- survey.invite: mail_server_id
Reading this model through the API
Odoo 19 JSON-2 API call reading the first five records with real fields of the model. Replace the instance, database and API key with your own.
curl -X POST "https://your-instance.odoo.com/json/2/ir.mail_server/search_read" \
-H "Authorization: bearer $ODOO_API_KEY" \
-H "X-Odoo-Database: your-db" \
-H "Content-Type: application/json" \
-d '{"domain":[],"fields":["name","smtp_authentication","smtp_encryption","owner_user_id","active"],"limit":5}'import requests
BASE_URL = "https://your-instance.odoo.com/json/2"
headers = {"Authorization": f"bearer {API_KEY}", "X-Odoo-Database": "your-db"}
res = requests.post(
f"{BASE_URL}/ir.mail_server/search_read",
headers=headers,
json={"domain": [], "fields": ["name","smtp_authentication","smtp_encryption","owner_user_id","active"], "limit": 5},
)
res.raise_for_status()
print(res.json())- External API access requires Odoo's Custom plan.
- XML-RPC and JSON-RPC will be removed in Odoo 22 (fall 2028): use JSON-2.
- The access rights and record rules of the key's user apply.
Cite this tool
Writing a tutorial, internal documentation or a forum answer? Copy this link to send your readers to the up-to-date reference.
<a href="https://aidoo.ai/en/outils/explorateur-modeles-odoo/ir-mail_server">ir.mail_server (Odoo 19.0)</a>Sources
Data verified on September 23, 2026 · Odoo 19.0 Community
Have an Odoo project, or want to put your ERP to work with AI? Let's talk
Implementation, custom module development, connecting Claude or ChatGPT to your data: tell us about your context and we will reply within 24 business hours.