Odoo 19.0 Community · Persistent

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 nameLabelTypeDetails
activeActiveboolean
active_mailing_idsActive mailing using this mail serverone2many
read-only

inverse: mail_server_id

added by Email Marketing (mass_mailing)

from_filterFROM 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_idsMail template using this mail serverone2many
read-only

inverse: mail_server_id

added by Discuss (mail)

max_email_sizeMax Email Sizefloat
nameNamechar
required
owner_limit_countOwner Limit Countinteger

added by Discuss (mail)

owner_limit_timeOwner Limit Timedatetime

added by Discuss (mail)

owner_user_idOwnermany2one

added by Discuss (mail)

sequencePriority

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_authenticationAuthenticate withselection
required

Values: login (Username), certificate (SSL Certificate), cli (Command Line Interface)

smtp_authentication_infoAuthentication Infotext
computed
smtp_debugDebugging

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_encryptionConnection 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: none (None), starttls_strict (TLS (STARTTLS), encryption and validation), starttls (TLS (STARTTLS), encryption only), ssl_strict (SSL/TLS, encryption and validation), ssl (SSL/TLS, encryption only)

smtp_hostSMTP Server

Hostname or IP of SMTP server

char
smtp_passPassword

Optional password for SMTP authentication

char
smtp_portSMTP Port

SMTP Port. Usually 465 for SSL, and 25 or 587 for other cases.

integer
smtp_ssl_certificateSSL Certificate

SSL certificate used for authentication

binary
smtp_ssl_private_keySSL Private Key

SSL private key used for authentication

binary
smtp_userUsername

Optional username for SMTP authentication

char
google_gmail_access_tokenAccess Tokenchar

inherited from google.gmail.mixin

google_gmail_access_token_expirationAccess Token Expiration Timestampinteger

inherited from google.gmail.mixin

google_gmail_refresh_tokenRefresh Tokenchar

inherited from google.gmail.mixin

google_gmail_uriURI

The URL to generate the authorization code from Google

char
computed

inherited from google.gmail.mixin

microsoft_outlook_access_tokenOutlook Access Tokenchar

inherited from microsoft.outlook.mixin

microsoft_outlook_access_token_expirationOutlook Access Token Expiration Timestampinteger

inherited from microsoft.outlook.mixin

microsoft_outlook_refresh_tokenOutlook Refresh Tokenchar

inherited from microsoft.outlook.mixin

microsoft_outlook_uriAuthentication URI

The URL to generate the authorization code from Outlook

char
computed

inherited from microsoft.outlook.mixin

create_dateCreated ondatetime
read-onlyautomatic
create_uidCreated bymany2one
read-onlyautomatic
display_nameDisplay Namechar
read-onlycomputedautomatic
idIDinteger
read-onlyautomatic
write_dateLast Updated ondatetime
read-onlyautomatic
write_uidLast Updated bymany2one
read-onlyautomatic

Relations

Models linked from this model

Fields of other models pointing here

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
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}'
Python (requests)
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.