iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
To stop Sendmail accepting inbound SMTP on TCP port 25, remove or disable its MTA daemon socket, then regenerate the configuration, restart the service, and check both IPv4 and IPv6 listeners. On Oracle Linux 7, the documented switch is DAEMON=no in /etc/sysconfig/sendmail. On systems that generate sendmail.cf from an M4 source file, remove the MTA DAEMON_OPTIONS entry. If applications on the same server still need SMTP submission, keep an MSA socket on port 587 bound only to loopback addresses.
What disabling port 25 actually changes
Sendmail opens its inbound sockets in daemon mode. The DAEMON_OPTIONS settings determine each socket’s port, address and address family; daemon mode itself is commonly enabled with -bd. The standard SMTP daemon socket is TCP port 25. Removing that socket prevents Sendmail from accepting SMTP connections there, but it does not necessarily stop every Sendmail function.
Message submission from local programs, delivery of messages that are already queued and queue-runner activity are separate concerns. A server can therefore stop accepting remote SMTP while continuing to send locally, provided local applications use an available submission path or the normal Sendmail client interface.
A firewall rule is not the same as disabling the listener. A firewall can block remote packets while Sendmail still owns port 25. If the requirement is that no process should listen on that port, change Sendmail’s daemon configuration and verify the resulting sockets.
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Choose the configuration method before editing
Sendmail installations are not configured identically. First determine whether your distribution controls daemon startup with a sysconfig file or generates sendmail.cf from an M4 source file.
| Configuration model | Primary change | Best fit | Important qualification |
|---|---|---|---|
| Oracle Linux 7 sysconfig | Set DAEMON=no in /etc/sysconfig/sendmail |
Oracle Linux 7 installations using the packaged service configuration | This is distribution-specific; inspect the installed package documentation before applying it elsewhere. |
| M4-managed configuration | Remove the MTA DAEMON_OPTIONS declaration from the .mc source, then regenerate sendmail.cf |
Systems whose generated configuration is rebuilt from an M4 file | Editing only the generated .cf can be lost the next time the package regenerates it. |
| M4 with local submission | Remove the public MTA socket, suppress the default MSA if necessary, and add an MSA on port 587 bound to 127.0.0.1 and/or ::1 |
Web applications, monitoring agents or local SMTP clients that still submit mail | Bind explicitly to loopback; an unspecified address can expose the MSA beyond the host. |
| Stopping the service | Stop or disable the Sendmail service | Hosts that do not need Sendmail at all | This also stops Sendmail’s other work, including queue processing; it is broader than removing port 25. |
Before making the change
- Record the current listeners with
sudo ss -ltnp. Note whether port 25 appears on an IPv4 wildcard address, an IPv6 wildcard address, a specific interface, or more than one socket. - Back up the file you will edit. Preserve the original owner, mode and package location when restoring it.
- Determine whether local software submits over SMTP. If it does, identify whether it expects port 25, port 587, a Unix-domain interface or the local Sendmail command.
- Confirm how this installation regenerates and installs
sendmail.cf. Package-specific generation commands and file locations differ. - Plan a maintenance window if applications depend on SMTP. Removing the socket takes effect after the service reloads or restarts.
Option 1: Oracle Linux 7 and DAEMON=no
Oracle Linux 7 documents a switch in /etc/sysconfig/sendmail: set DAEMON=no to prevent the Sendmail daemon from listening for incoming mail on port 25.
- Back up the configuration file, for example:
sudo cp -p /etc/sysconfig/sendmail /etc/sysconfig/sendmail.backup - Open the file with an editor and set the variable exactly as follows:
DAEMON=noDo not add quotes unless the existing file’s syntax requires them, and do not remove unrelated queue or submission settings.
- Save the file, then restart Sendmail using the service mechanism provided by the installation. On a system managed by systemd, the service is commonly restarted with:
sudo systemctl restart sendmailIf that unit name is not present, use the package’s documented service command rather than guessing a replacement.
- Check the service result and inspect the listeners. A successful restart alone does not prove that every port-25 socket disappeared.
This switch is not a universal Sendmail setting. A different distribution may ignore /etc/sysconfig/sendmail, use another startup file or generate daemon options from M4. If port 25 remains after setting DAEMON=no, inspect the running command line and package documentation instead of repeatedly changing the same file.
Option 2: M4-managed Sendmail configuration
In an M4-managed installation, the .mc file is the source of truth. Sendmail’s configuration documentation shows the standard MTA declaration in this form:
DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl
That declaration creates the normal SMTP listener. Remove it from the M4 source when the host must have no inbound SMTP socket on port 25. The documentation specifically notes that omitting the first MTA declaration leaves no listener on the standard SMTP port.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
1. Locate and back up the source
Use the path supplied by your distribution, commonly under its Sendmail configuration directory. Back up the .mc file before editing it. Do not treat an already generated sendmail.cf as the long-term source if the package rebuilds it from M4.
2. Remove the public MTA declaration
Delete the MTA DAEMON_OPTIONS line or comment it in the .mc source. Review the entire file for additional DAEMON_OPTIONS declarations: Sendmail creates an incoming socket for each occurrence, so removing one line does not remove sockets created by other lines.
Also look for explicit port-25 declarations, wildcard addresses and entries that select IPv4 or IPv6. A line using an address or family different from the default can still create a second listener.
3. Decide what to do with the default MSA
Some M4 configurations generate a default Message Submission Agent (MSA) entry in addition to the MTA. If that automatically generated MSA is not wanted, add:
FEATURE(`no_default_msa')dnl
This feature prevents automatic generation of the default MSA entry. Use it when you want to define the submission sockets yourself or when the host should expose no Sendmail SMTP socket at all.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Keeping local submission without exposing SMTP publicly
If local applications still need SMTP, retain an MSA on port 587 but bind it only to loopback. Debian’s Sendmail guidance demonstrates this pattern with DAEMON_OPTIONS entries for 127.0.0.1 and/or ::1, together with an MSA on port 587.
The exact syntax must match the package’s M4 file and installed Sendmail version. A representative arrangement is:
FEATURE(`no_default_msa')dnl
DAEMON_OPTIONS(`Port=587,Addr=127.0.0.1, Name=MSA')dnl
DAEMON_OPTIONS(`Port=587,Addr=::1, Family=inet6, Name=MSA')dnl
Use only the address families you need. The IPv4 entry accepts connections from the local IPv4 loopback interface; the IPv6 entry accepts connections from the local IPv6 loopback interface. Neither should use a wildcard address if the purpose is to prevent network clients from reaching the MSA.
After this change, configure each local application to submit to the loopback address and port 587. Do not assume that an application configured for port 25 will automatically switch ports. If no application requires SMTP submission, omit these MSA entries and keep the configuration simpler.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Regenerate and install sendmail.cf
After editing the M4 source, generate a new sendmail.cf with the method documented by the installed package. Some packages provide a make target or wrapper; others expect an M4 command followed by installation into a package-specific directory. Use that package method so ownership, permissions and auxiliary files remain correct.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
- Run the package’s configuration-generation command against the edited
.mcfile. - Confirm that the resulting
sendmail.cfis installed at the path used by the running service. If the package writes to a temporary location first, complete its documented install step. - Check the generated configuration for remaining
DaemonPortOptionsentries that specify port 25. The generated file is useful for verification, but continue maintaining the M4 source. - Restart or reload Sendmail using the distribution’s documented service command. A reload may not recreate sockets on every installation; use a full restart when the package documentation requires it.
Do not overwrite a package-managed configuration with a hand-edited generated file unless the package explicitly supports that workflow. Otherwise, a later regeneration or upgrade can restore the MTA listener.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Verify that port 25 is no longer listening
Verification must cover both address families. Run:
sudo ss -ltnp
Inspect the output for local addresses ending in :25. A public IPv4 listener may appear as 0.0.0.0:25 or a server interface address. A public IPv6 listener may appear as [::]:25. Either means a process is still listening on port 25.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →You can narrow the display on systems whose ss supports socket filters:
sudo ss -ltnp '( sport = :25 )'
If that filter syntax is unavailable, use the full output and inspect every line containing the port number. Confirm that the process column no longer identifies Sendmail on port 25.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Expected results when all inbound SMTP is disabled
- No listening socket on TCP port 25 for IPv4.
- No listening socket on TCP port 25 for IPv6.
- No additional port-25 socket belonging to another Sendmail process or service instance.
Expected results when loopback submission is retained
- A listener on
127.0.0.1:587if IPv4 local submission was configured. - A listener on
[::1]:587if IPv6 local submission was configured. - No wildcard or public-interface listener on port 587 unless that exposure was deliberately chosen.
- No listener on port 25 in either address family.
Each DaemonPortOptions occurrence can create another incoming socket, and daemon mode defaults to socket 25. Therefore, verify the complete socket list rather than checking only one address.
Troubleshooting a listener that remains
The service restarted but port 25 is still present
Check whether the running service loaded the file you edited. Inspect the service status and process command line, then identify the path of the active sendmail.cf. A stale generated file, an incorrect source path or an unsuccessful restart can leave the old daemon running.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Only IPv6 still listens
Look specifically for [::]:25 or another IPv6 address. Remove the remaining IPv6 MTA declaration, regenerate the configuration and restart again. Checking only IPv4 can produce a false conclusion that port 25 is closed.
Another process owns port 25
The ss process column identifies the listener and its PID when permissions allow. If the owner is not Sendmail, changing Sendmail’s configuration cannot remove that socket. Investigate the service named by the PID and apply the appropriate configuration there.
Multiple Sendmail sockets remain
Search the M4 source for every DAEMON_OPTIONS line and inspect the generated DaemonPortOptions entries. One explicit declaration can continue to create port 25 even after the default MTA line has been removed.
Local applications stop submitting mail
Removing port 25 also removes any SMTP submission path that depended on it. Either configure the application for the loopback MSA on port 587, provide the required IPv4 or IPv6 loopback entry, or use the local Sendmail submission mechanism. Check the application log and the Sendmail queue after changing its endpoint.
Recommended Free Tools
Mail delivery queues stop advancing
Do not confuse inbound daemon mode with queue processing. If the entire service was stopped instead of only its MTA socket being removed, queue-runner activity may also have stopped. Restore the package’s normal service operation and disable only the unwanted listener.
Operational checks after the change
- Test from the same host that local applications can reach the intended loopback MSA, if one was retained.
- Test from a separate host that TCP port 25 is not accepted on the server’s public IPv4 address.
- Repeat the external check against the server’s public IPv6 address when IPv6 is enabled.
- Review Sendmail and application logs for connection-refused errors, authentication or TLS requirements, and queued messages.
- Record the source file and package-specific regeneration command so a future upgrade does not silently restore the MTA socket.
Which approach should you use?
Use Oracle Linux 7’s DAEMON=no when the host is using that documented sysconfig model and you want the package to manage the daemon decision. Use M4 source editing when the installation generates sendmail.cf from an .mc file; it is the durable approach because the source survives regeneration. Add explicit loopback MSA sockets only when local SMTP submission is a real requirement. If Sendmail has no role on the host, stopping the service is simpler but intentionally disables more than port 25.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

