Urgent.News

What's breaking now, across thousands of outlets.

Tech

Django 6.1's MAILERS setting opens as many SMTP connections as the EMAIL_BACKEND it replaces

Django 6.1 added a setting called MAILERS , meant to replace EMAIL_BACKEND and the ten or so EMAIL_* settings that go with it. I assumed a new config system built from scratch in 2026 would also tidy up how connections get made, so I measured it before deciding whether to migrate anything. Sending 50 emails cost exactly 50 SMTP connections under the old settings, and exactly 50 SMTP connections…

Django 6.1 introduced a new setting called MAILERS, designed to replace EMAIL_BACKEND and the ten EMAIL_* settings associated with it. The assumption was that this new configuration system would improve how SMTP connections are established. To verify this, a test was conducted with the following findings:

Finding 1: MAILERS does not reduce connections by itself

Sending 50 emails using legacy EMAIL_BACKEND and MAILERS resulted in exactly the same 50 SMTP connections each time. The only way to reduce the number of connections was to manually reuse a connection object, which was the same approach used before the introduction of MAILERS. MAILERS is not a connection pool but a configuration format, and it does not change the behavior of SMTP connections being created with every email sent.

Finding 2: MAILERS provides better error handling

When a misspelled option was passed to the SMTP backend using the old EMAIL_BACKEND method, it resulted in a warning and the connection was still created. However, when the same typo was introduced inside the MAILERS configuration, it caused a fatal error and no emails were sent. This demonstrates that MAILERS offers stronger error handling, as a misconfigured mailer will now fail at startup instead of silently sending emails with default settings that were not chosen.

Finding 3: using cannot be combined with replaced arguments

The using argument in send_mail() was designed to replace connection, fail_silently, auth_user, and auth_password arguments. Passing both using and one of the replaced arguments raises a TypeError, preventing any issues from occurring silently. However, this can be problematic if code builds the connection or authentication arguments conditionally upstream of the send_mail() call, potentially turning a working call into a crash if both using and the replaced arguments are set.

Finding 4: Improved error handling during deployment

Django 6.1 includes a deploy check, mail.E001, which fails manage.py check --deploy if the default mailer is a console, dummy, file-based, or in-memory backend. It also includes a warning, mail.W001, if MAILERS has no default entry. This provides better error handling during deployment, as configuration issues will be caught early and prevent emails from being sent.

However, this can also be a trap if existing EMAIL_HOST_* settings blocks are manually copied into the MAILERS OPTIONS, as any key that doesn't match the backend's constructor argument names will now cause the entire mailer to fail instead of being ignored.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Stop Pasting Production JWTs into Random Websites: The Security Guide to JSON Web Tokens

How many times this week have you opened a random online "JWT Debugger", pasted an Authorization: Bearer eyJhbGci... token from your production network tab, and hit enter?

  • Developers often paste production JWTs into random debuggers, exposing sensitive user data
  • JWTs are signed, not encrypted; use JWE for confidentiality
  • Three critical vulnerabilities: alg: none attack, asymmetric key confusion, and ignoring expiration

How to integrate a legal secretary with artificial intelligence into WordPress

Conversational artificial intelligence is opening up new possibilities for developing more interactive and useful websites.

  • Digital legal secretary integrates with WordPress for legal inquiries
  • Conversational AI interprets messages, generates responses within limits
  • Privacy compliance with GDPR and Spanish data protection regulations

MCP tool cost: 20 job Actors on Apify, 2.1K to 32.7K tokens each

Here is what an agent pays before it asks a job-search tool anything. I pinned 20 job-search Actors from the Apify Store, one at a time, on the hosted Apify MCP server and read what tools/list sends…

  • Twenty Apify MCP Actors used for job search cost analysis
  • Token counts range from 2,139 to 32,737 per tool definition
  • Author's input schema is 406 tokens, median is 3,829

Which Microcontroller to Choose for Matter and Thread (ESP32-C6, H2, and nRF52840)

Originally published on iot.gripe. Matter is the standard that aims for the same device to work with Apple Home, Google Home, Alexa and Home Assistant.

  • ESP32-C6 is best for Matter due to Wi-Fi and Thread compatibility and Espressif support
  • ESP32-H2 or nRF52840 alternatives for battery-powered devices using only Thread
  • Matter is an application layer standard, not a radio, traveling over Wi-Fi, Thread, and Internet

More from Wednesday 28 October →