Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesiTechGuides 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
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
To set up Sendmail on an Ubuntu VPS, install sendmail, sendmail-cf, mailutils and the m4 macro processor; verify the server hostname; configure /etc/mail/sendmail.mc; rebuild sendmail.cf; add relay authentication when your provider requires it; restrict which hosts may relay; restart Sendmail; and send a test message. A smart host on port 587 is usually the practical path when a VPS provider blocks outbound port 25.
What this setup does—and what is uncertain
This guide configures Sendmail as an outbound SMTP client on an Ubuntu VPS. It does not turn the VPS into a full mail-hosting platform with mailboxes, IMAP, spam filtering or webmail. Your application hands a message to the local Sendmail process, which then delivers directly or forwards it to a smart host (an external SMTP relay).
The available Ubuntu and Sendmail procedures for this topic come from third-party guides rather than current official Ubuntu or Sendmail documentation. Package names, service defaults and macro behavior can differ between Ubuntu releases, so check the package candidate and the relay provider’s current requirements before applying a production configuration. The commands below show the established workflow and identify the places where your release or provider may differ.
Prerequisites and decisions
- An Ubuntu VPS with
sudoaccess and a resolvable hostname. - An address at which you can receive the test message.
- Either a relay service (recommended for many VPS deployments) or a provider that explicitly permits direct SMTP delivery from your server.
- If the relay requires login, its hostname, port, username, password or token, and permitted authentication mechanisms.
Before editing anything, decide whether Sendmail should connect directly to recipient mail servers or use a smart host. Direct delivery normally uses SMTP port 25. VPS networks frequently restrict outbound port 25, in which case Sendmail will queue or fail messages until it is pointed at a relay that accepts authenticated submission, commonly on port 587. The relay’s hostname and credentials are provider-specific; do not copy credentials or mechanism values from an unrelated tutorial.
#1 Best Overall
- Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
- With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
- Wide Application:Upgraded attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
- Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
- Warranty & Support: Our Electric air duster comes with 5 years warranty and 24/7 customer service. During this period, if you have any questions,pls kindly feel free to contact us.
Install the Sendmail packages
- Refresh APT metadata:
sudo apt update - Install the MTA, configuration macros and command-line mail tools:
sudo apt install sendmail sendmail-cf mailutils m4Some guides list
m4separately because it is the processor used to turn the human-edited macro file into Sendmail’s generated configuration. If APT reports that a package name is unavailable on your Ubuntu release, inspect the package list withapt-cache policy sendmail sendmail-cf mailutils m4and use the package names supplied by that release rather than forcing an old repository. - During installation, a configuration dialog may appear. Complete it with the server’s real hostname and domain information, but plan to review the generated files manually before sending production mail.
Verify the hostname and /etc/hosts
Sendmail uses the local hostname when constructing queue and envelope information. A malformed hostname can produce warnings, rejected messages or confusing headers. Confirm the values first:
hostname
hostname -f
cat /etc/hostname
cat /etc/hosts
The localhost entries and the VPS hostname should be present in /etc/hosts before you run Sendmail’s setup. The exact address depends on your VPS network, so do not replace an existing mapping with a copied example. A typical file contains a localhost line and a separate line mapping the server’s own address to its fully qualified hostname and short name. If your provider documents a hostname format, use that format consistently in the system hostname, DNS and Sendmail configuration.
Know which Sendmail files you are changing
| Path | Purpose | How to handle it |
|---|---|---|
/etc/mail/sendmail.mc |
Macro configuration that you edit | Keep your intended settings here; this is the source file for regeneration. |
/etc/mail/sendmail.cf |
Generated Sendmail configuration | Do not make one-off edits here; regenerate it after changing the .mc file. |
/etc/mail/access |
Hosts and patterns allowed to relay | Enter only trusted sources, then build its database. |
/etc/mail/authinfo |
Relay authentication records | Protect the file and generate the hash map used by Sendmail. |
/etc/mail/*.db |
Compiled maps, including access and authinfo | Rebuild the relevant map whenever its source file changes. |
Back up the files before editing:
sudo cp -a /etc/mail/sendmail.mc /etc/mail/sendmail.mc.bak
sudo cp -a /etc/mail/access /etc/mail/access.bak 2>/dev/null || true
sudo cp -a /etc/mail/authinfo /etc/mail/authinfo.bak 2>/dev/null || true
Configure a smart host
Open the macro file:
sudo editor /etc/mail/sendmail.mc
Enable the smart-host setting and replace the example hostname with the SMTP relay supplied by your provider. The conventional m4 form is:
define(`SMART_HOST', `smtp.relay.example')dnl
One Oracle Linux example writes the macro name as SMART_host. That spelling is shown in older material and may not match the macro set shipped by your Ubuntu package. Use the macro already present in your file or the spelling documented for your installed Sendmail configuration; do not assume that a line copied from an older distribution will be accepted unchanged.
Rank #2
- Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
- Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
- Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
- Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
- Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
Some older Ubuntu 16.04/18.04 instructions put the relay in brackets, for example [smtp.gmail.com], to prevent an MX lookup and force a connection to the named SMTP host. The provider details in that tutorial are dated. Use bracketed syntax only when your relay provider or installed configuration explicitly requires it.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11If your relay accepts unauthenticated traffic on the selected port, the smart-host line may be sufficient. Most submission relays require authentication, so continue with the authinfo and port settings instead of assuming that a successful TCP connection means the message will be accepted.
Add SMTP authentication safely
Create the authentication source file with permissions that prevent ordinary users from reading the credential:
sudo install -o root -g root -m 600 /dev/null /etc/mail/authinfo
sudo editor /etc/mail/authinfo
A common authinfo record has this shape (replace every value with the relay’s required values):
AuthInfo:smtp.relay.example "U:relay-user" "P:replace-with-password" "M:PLAIN"
The username, password or token, and mechanism string are examples of fields, not universal values. Your provider may require LOGIN, PLAIN, another mechanism, or a token in place of a password. Keep the record’s host name aligned with the host used by the smart-host setting.
Rank #3
- 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
- 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
- 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
- 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
- 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
Enable the authinfo feature in sendmail.mc using the syntax supplied by your package. A commonly deployed form is:
FEATURE(`authinfo', `hash -o /etc/mail/authinfo.db')dnl
If your installed macro file already contains an authinfo feature, edit that line instead of adding a duplicate. Then generate the database:
sudo makemap hash /etc/mail/authinfo < /etc/mail/authinfo
The command creates or refreshes /etc/mail/authinfo.db. Re-run it whenever the source credentials change. Check ownership and permissions on both the source and database files, and avoid putting the password in shell history or a publicly readable backup.
Use port 587 when the relay requires submission
Port 587 is the submission port used by many authenticated relays. A documented Sendmail example sets both relay mailer argument macros to TCP port 587:
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →define(`RELAY_MAILER_ARGS', `TCP $h 587')dnl
define(`ESMTP_MAILER_ARGS', `TCP $h 587')dnl
The same configuration family enables TRUST_AUTH_MECH and confAUTH_OPTIONS. Add those directives only with the authentication mechanisms and options required by your relay. They are not interchangeable with the username and password, and an overly broad trust setting can allow unauthenticated clients to submit mail.
Rank #4
- 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
- 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
- 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
- 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
- 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.
If the provider requires STARTTLS, certificate validation or a particular authentication mechanism, follow its current connection requirements. A port change alone does not enable encryption or authentication.
Rebuild sendmail.cf after every macro change
Sendmail reads the generated .cf file, not the comments and macros you just edited. Rebuild it with either of these supported workflows:
sudo m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
or:
sudo make -C /etc/mail
Use one method consistently with the layout provided by your Ubuntu package. If the command reports an m4 syntax error, inspect the last line you changed for mismatched backticks, apostrophes or parentheses. Do not start Sendmail with a partially generated file; restore the backup, correct the macro and regenerate it cleanly.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Restrict relaying to trusted hosts
An SMTP server that relays for arbitrary Internet clients can be abused and quickly acquire a poor reputation. Edit the access map:
sudo editor /etc/mail/access
List only the local machine, explicitly trusted application hosts and any other source that must submit mail. The exact left-hand key depends on whether you identify a source by hostname, address or network; use the format already documented in your installed file. A typical policy uses the RELAY action for approved entries and leaves all other sources untrusted. Do not add an entire public network or a wildcard merely to make a test pass.
Best Value
- 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
- 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
- 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
- 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
- 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
Compile the map after saving:
sudo makemap hash /etc/mail/access < /etc/mail/access
If Sendmail’s macro file does not already enable the access feature, enable the feature required by your package before rebuilding sendmail.cf. Changing access without rebuilding its database leaves Sendmail using the old policy.
Free tools Windows power users keep installed
One-click scans. No signup required.
Restart the service and perform a real delivery test
- Regenerate
sendmail.cfafter all macro edits and rebuild both map databases. - Restart Sendmail:
sudo systemctl restart sendmail - Check the unit state and recent diagnostics:
sudo systemctl status sendmail sudo journalctl -u sendmail -e - Submit a message through the local Sendmail command, replacing the address with one you control:
echo "test message from $(hostname -f)" | sendmail -v recipient@example.netThe
-voption prints the SMTP conversation available to the local client. A successful handoff means Sendmail accepted the message; it is not proof that the recipient accepted it or placed it in the inbox. - Check the recipient’s inbox and spam folder. If it does not arrive, use the timestamp and queue identifier in the Sendmail log to distinguish local configuration errors from a remote rejection.
Troubleshoot by symptom
Connection times out or port 25 is refused
This commonly indicates an outbound port-25 policy on the VPS network or a firewall rule. Ask the provider whether direct SMTP is blocked, then configure the provider’s smart host and authenticated submission port (often 587). Do not repeatedly retry direct delivery while a network policy is rejecting it; messages will accumulate in the queue.
Authentication fails
Confirm that the hostname in authinfo exactly matches the relay host used by Sendmail, that the authinfo feature is enabled, and that /etc/mail/authinfo.db was rebuilt after the last edit. Check the provider’s required mechanism and whether the account expects a token rather than its normal web password. Rebuild sendmail.cf after changing any related macro.
Messages remain queued
Inspect the service log and queue diagnostics for the specific SMTP response. A queued message can result from a temporary remote failure, DNS or network connectivity, an unavailable relay, or a rejected authentication attempt. Correct the underlying error, then allow Sendmail’s normal retry behavior or process the queue using the queue command supported by your installed release.
Sendmail starts but ignores your setting
Verify that you edited /etc/mail/sendmail.mc, not only sendmail.cf; regenerate the .cf file; rebuild the relevant map; and restart the service. A syntactically valid old configuration can continue running even when a new macro edit was never compiled.
Recommended Free Tools
The test command succeeds but no mail arrives
Read the verbose output and the Sendmail log for the final remote response. Confirm the recipient address, inspect spam or quarantine folders, and check whether the relay accepted the message for later delivery. Local command success only establishes that Sendmail accepted the message from the shell.
An older tutorial gives different directives
Sendmail tutorials written for Ubuntu 16.04 or 18.04 may contain provider-specific hostnames, bracketed relay syntax or macro names that do not match a current package. Treat those values as historical examples. Keep the general sequence—edit .mc, generate .cf, compile maps, restart, test—but validate each directive against the relay and the Sendmail files installed on your VPS.
Operational checklist before production use
- Hostname and
/etc/hostsentries are internally consistent. - The smart-host hostname and submission port match the relay account.
- Credentials are stored in
/etc/mail/authinfowith restrictive permissions, and the hash map is current. - Only required hosts receive the
RELAYaction in/etc/mail/access. sendmail.cfwas regenerated fromsendmail.mcafter the final edit.- The Sendmail service restarts cleanly and its status shows no startup error.
- A test message reaches a monitored mailbox, and you have recorded the relevant log response.
- You know how to revoke or rotate the relay credential if the VPS is compromised.
Once these checks pass, keep the generated configuration and map files backed up alongside the source files, document the relay hostname and port, and monitor Sendmail’s logs and queue. Revisit the setup after an Ubuntu upgrade or a relay-provider policy change, because package defaults and accepted authentication methods are not guaranteed to remain identical.
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.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.

