Skip to main content
iVentureTeam

mail_server_configurator_selection

New in Odoo 19, the mail_server_configurator_selection widget turns a plain selection into the per-user outgoing mail server setup: pick Gmail or Outlook, run the OAuth flow, and test the connection, all from user Preferences.

Siddharth JambukiyaSiddharth JambukiyaOdoo Techno-Functional Consultant
August 25, 2026Updated August 25, 20265 min read
Technical namemail_server_configurator_selection
Field typesselection
Viewsform
Modulemail, installed with Discuss and any messaging app
Used in core2 occurrences in the mail module, both on the user Preferences form
VersionsOdoo 20.0, Odoo 19.0
No-code setupNo. This is a purpose-built control for res.users; there is no Studio path.
Alternativesselection, radio, dynamic_selection

What the Mail server selector does

Odoo 19 lets individual users send through their own Gmail or Outlook account instead of the company's shared SMTP server. The setting lives on the user's Preferences tab, and this widget is the control behind it. It extends the standard selection widget but replaces the interaction: choosing an option immediately saves the record, then calls action_setup_outgoing_mail_server on res.users, which returns the provider's setup action, typically the OAuth consent flow, and the widget runs it.

Once a provider other than default is selected and outgoing_mail_server_id is set, a second control appears: a Test Connection button that saves, calls action_test_outgoing_mail_server, and either runs the returned action or flips into a red Connection failed state with the server's error as a toast.

What this means for your team

Per-user sending matters for deliverability and for trust: replies come from the address the customer expects, and one salesperson's misconfigured mailbox does not affect the rest of the company. The widget's job is to make that setup a two-click flow a non-technical user can finish alone, which is why it saves eagerly and pipes errors back as notifications instead of failing silently.

The design decision worth knowing about is the readonly rule. The widget compares the record's id against the logged-in user's id and renders plain text when they differ. That means even an administrator cannot drive another user's mailbox setup from the backend, which is deliberate: the OAuth consent has to come from the mailbox owner's own session. Plan your rollout accordingly, with instructions to users rather than an admin doing it for them.

Supported options in Odoo 19

The widget adds no options of its own. Its descriptor spreads selectionField, so it formally inherits the selection widget's single declared option, listed below mostly for completeness.

OptionTypeWhat it does
placeholder_fieldfield nameInherited declaration from the base selection widget. Dead on the base widget and dead here: no extractProps ever reads it. Listed so you do not waste time trying it.(since Odoo 19.0)

The inherited declaration is dead code. The base selection widget declares placeholder_field in its options metadata but its extractProps never reads it, a quirk we verified on the base widget's own page. It is exactly as dead here. Treat this widget as option-less.

Working examples

The core pattern: user Preferences

<field name="outgoing_mail_server_id" invisible="1"/> <!-- Used by the mail_server_configurator_selection widget -->
<field name="outgoing_mail_server_type"
       nolabel="1"
       widget="mail_server_configurator_selection"
       invisible="not has_external_mail_server"/>

Both core usages ship this exact pair, including the source comment. The invisible companion field is not optional: the Test Connection button's visibility reads outgoing_mail_server_id from the record, and if the view does not load it the button never appears.

The dirty-state dodge and whole-form saves

The widget keeps a local state value layered over the field value, with a getter that prefers the local one. The source comment explains why: it lets the displayed choice change without marking the field dirty, since the record is saved programmatically anyway. On error, the catch block restores the previous value into that local state and shows error.data.message as a danger notification, so a failed OAuth flow leaves the form consistent instead of stuck on a provider that never got configured.

Both RPC paths call this.props.record.model.root.save() first. That is the whole form saving, not just this field, so any other invalid required field on Preferences will block the mail server setup with a validation error that seems unrelated to the dropdown. It is the same whole-record save pattern we have documented on boolean_toggle and priority.

Version compatibility

VersionStatusNotes
Odoo 20.0In developmentNot released. Only internal changes and icon swaps visible on the development branch; see below.
Odoo 19.0VerifiedVerified against the shipped source. First release with the widget and the per-user server flow.
Odoo 18.0Not availableWidget and underlying feature do not exist.
Odoo 17.0Not availableWidget does not exist.
Odoo 16.0Not availableWidget does not exist.

Upgrade note. The widget, the outgoing_mail_server_type field, and the per-user server flow are all new in Odoo 19. There is nothing to migrate from earlier versions; on 18 and below, outgoing mail is configured only on company-level SMTP records.

What is changing in Odoo 20

Odoo 20 is expected at Odoo Experience in Brussels, 24 to 26 September 2026. The development branch is unstable, so treat everything here as provisional; the page is re-verified after release.

The visible changes are internal: component state moves from useState to the new proxy API, and the template's FontAwesome icons swap to the oi set, data-icon="check" and data-icon="power" replacing fa-check and fa-plug. No option, behavior, or registration changes are visible. CSS that targets the old icon classes inside this control will stop matching.

Common problems and fixes

SymptomCause and fix
The dropdown renders as plain textYou are viewing another user's form. The widget is editable only when the record id equals your own user id. Have each user open their own Preferences to run the setup; admins cannot do it for them.
Test Connection button never appearsEither the selection is still default, or outgoing_mail_server_id is not loaded in the view, or no server is configured yet. Keep the invisible outgoing_mail_server_id field in the view, exactly as core does, and finish the provider setup first.
Choosing a provider throws an unrelated validation errorThe widget saves the whole Preferences form before calling the setup action, so any other invalid field blocks it. Fill the required Preferences fields, then pick the provider again.
Selection snaps back to its previous value after an errorDesigned behavior: the catch block reverts the local value and shows the server's message as a red toast. Read the toast; it carries the actual error from action_setup_outgoing_mail_server.
Red Connection failed label on the buttonaction_test_outgoing_mail_server raised; credentials expired or the OAuth grant was revoked. Rerun the provider setup to refresh the grant, then test again.

Mail server selector vs the alternatives

WidgetBest forKey difference
mail_server_configurator_selectionThe per-user Gmail and Outlook sending setup it was built forSaves the form and launches a server action on every change
selectionOrdinary selection fieldsJust stores the value; runs nothing on change
radioFew options that should all stay visibleFlat buttons, no dropdown, no side effects
dynamic_selectionSelections whose choices come from another fieldFilters the option list instead of acting on it

None of the alternatives run actions. If you need a selection that configures something on change, this widget's save-then-call pattern is the reference implementation to copy, not a configuration away from selection or radio.

Frequently asked questions

What does the mail_server_configurator_selection widget do?+
It powers the Outgoing Mail Server choice on the Odoo 19 user Preferences form. Selecting a provider saves the form and calls action_setup_outgoing_mail_server, which opens the provider's setup flow, and a Test Connection button verifies the finished configuration.
Why can I not change the mail server on another user's form?+
The widget hardcodes a readonly rule: it is editable only when the record you are viewing is your own user. The OAuth consent must come from the mailbox owner's session, so even administrators see read-only text on other users' forms.
Why does the widget need the invisible outgoing_mail_server_id field?+
The Test Connection button only renders when that field has a value, and widgets can only read fields the view loads. Core therefore ships outgoing_mail_server_id invisibly right above the widget, with a comment saying it exists for this widget.
Does the widget support any options?+
None of its own. It inherits the selection widget's placeholder_field declaration, which is dead code on the base widget and equally dead here, so in practice there is nothing to configure from XML.
What happens if the provider setup fails?+
The widget reverts the dropdown to its previous value and shows the server's error message as a red notification. The record itself was already saved, so no half-configured state is left behind on the field.
Is mail_server_configurator_selection available before Odoo 19?+
No. The widget and the per-user outgoing mail server feature both shipped in 19.0. Earlier versions configure outgoing mail only through company-level SMTP server records.
Does anything change in Odoo 20?+
The development branch shows internal state API changes and the icons moving to the new oi set, with no behavior or option changes. Nothing is final until the September 2026 release, and this page will be re-verified then.

Email deliverability problems rarely stop at the widget

DNS records, OAuth apps, per-user servers, and bounce handling all have to line up before mail flows reliably. We configure and troubleshoot Odoo email end to end, from server setup to custom sending logic, on Odoo 16 through 19.

Book a free consultation

How this page was produced

This page was verified by reading mail_server_configurator_selection.js and its template on the Odoo 19.0 branch, confirming the widget is absent from 16.0 through 18.0, diffing against the public development branch, and checking both core usages in res_users_views.xml. The screenshot was captured on a clean Odoo 19 database. Report corrections via our contact page.