Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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

On Ubuntu, the most reliable command-line approach is to submit mail to Postfix, Ubuntu’s default supported mail-transfer agent, with the mail command. For a server that must use an external provider, either configure Postfix as an authenticated SMTP relay or connect directly with SendEmail or Mailutils. In every case, use authenticated SMTP and TLS for Internet delivery, protect credentials, and check the queue and logs: a command that exits successfully proves submission, not that the message reached the recipient’s inbox.

This guide shows the local Postfix path first, then authenticated relaying and direct SMTP clients, with commands, security precautions, testing methods, and recovery steps.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How command-line mail works on Ubuntu

A shell command is normally a Mail User Agent (MUA). It hands the message to a Mail Transfer Agent (MTA), which queues it, applies transport rules, and delivers it locally or to another SMTP server. A Mail Delivery Agent (MDA) may place locally delivered mail into a mailbox, and a POP3 or IMAP server lets users retrieve it. Ubuntu’s Server documentation describes this chain and states: “On Ubuntu, Postfix is the default supported MTA.”

That separation explains why two commands can look similar but behave differently. mail usually talks to a local MTA and benefits from its queue, retry policy, and centralized logs. SendEmail can open an SMTP connection itself, so the relay hostname, port, credentials, and TLS behavior are specified at invocation time. Mailutils can do either scripted SMTP submission or an interactive SMTP session.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • 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: 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.
  • Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.

Choose the right sending method

Method Best fit Queue and retries Authentication and TLS Operational visibility
Postfix with mail or Mailutils Cron jobs, monitoring, and system scripts on a host with a controlled MTA Postfix queues messages and retries according to its transport policy Configured centrally, including authenticated relay and TLS policy Postfix queue commands and service logs
SendEmail A small script or one-off command that must connect directly to a specified SMTP endpoint The client submits directly; any later retry behavior belongs to the SMTP service Command options specify the server, account, password, and other SMTP settings; use a protected secret mechanism and TLS supported by the relay Verbose client output plus the relay’s logs
Mailutils SMTP SMTP URL parameters or interactive protocol diagnostics Depends on whether it submits through Postfix or connects directly Supports SMTP URLs, authentication mechanisms, and interactive TLS commands Interactive protocol responses are useful for troubleshooting

For recurring server notifications, local Postfix is usually the easiest to operate because applications do not need to store SMTP credentials. For a quick test against a managed relay, SendEmail is more explicit. Use Mailutils when you need to inspect an SMTP conversation or express connection details as an SMTP mailbox URL.

Send a message through local Postfix

Install Postfix and Mailutils

Update the package index and install the MTA and command-line mail interface:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo apt update
sudo apt install postfix mailutils

The package configuration screen asks for a mail-system type. Select a design that matches the server’s role. A send-only host generally needs a relay or local-only arrangement rather than accepting mail from the Internet. Do not choose an Internet-facing configuration simply because the server needs to send alerts; accepting inbound mail creates additional exposure and administration.

Send the first test message

Once Postfix is installed and configured, pipe the body to mail and provide a subject with -s:

printf '%sn' 'Body text from the server' | mail -s 'Ubuntu mail test' recipient@example.com

The command submits the message to the local mail interface. Postfix then places it in its queue and attempts delivery using its current transport configuration. Replace the recipient with an address you control while testing. Avoid putting confidential data in a test message.

Check the service and queue

Confirm that Postfix is running and inspect queued messages immediately after a test:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
systemctl status postfix
postqueue -p

An empty queue can mean the message was handed off successfully, but it is not proof of inbox placement. A queued item normally includes an ID and a reason for the delay, such as a connection, authentication, DNS, or recipient-policy failure. Keep that ID when examining logs or opening a support case with the relay.

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • 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

After changing Postfix configuration, restart the service:

sudo systemctl restart postfix.service

Read the service journal and, where enabled by the system’s logging configuration, the mail log:

journalctl -u postfix
sudo tail -f /var/log/mail.log

The journal command works on systems using systemd. The traditional mail log may not exist if that logging facility is not enabled, so treat it as an additional location rather than the only source of evidence.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use Postfix as an authenticated external relay

When relaying is preferable

Direct delivery from a cloud or residential IP is often rejected because of reverse-DNS, reputation, sender-domain, or recipient-policy checks. A managed SMTP relay centralizes those requirements and usually provides authenticated submission on a dedicated port. Postfix remains the local queue and retry engine, while the relay performs onward delivery.

Set the relay endpoint and SMTP authentication

Configure Postfix’s relayhost to the SMTP endpoint supplied by your provider. Then configure SASL credentials, TLS policy, and certificate verification according to that provider’s current documentation. SMTP-AUTH identifies the client through SASL and TLS; after successful authentication, the server can authorize relaying.

Provider-specific hostnames, ports, authentication mechanisms, and sender-domain requirements change. Verify those values in the provider’s current documentation instead of copying an example intended for another service. A submission port commonly differs from an unauthenticated server-to-server port, and a provider may require a particular TLS mode or sender address.

Protect the credential store

  • Keep the SASL password file readable only by the account or service that needs it. Check ownership and permissions after creating or changing it.
  • Do not place a real password in a shared shell command, a ticket, a public script, or shell history.
  • Use a dedicated relay identity with the least privilege available, and rotate it if it has appeared in a process list, terminal recording, log, or source repository.
  • Use certificate verification and an encrypted SMTP session. Do not downgrade to plaintext merely because a diagnostic command is easier.

Restart and verify the relay

Restart Postfix after changing the relay configuration, send a test through mail, and inspect both the queue and logs. The log should show a successful authenticated handoff to the relay or a precise failure returned by it. If the message remains queued, fix the reported cause before sending repeated tests; otherwise you can create a backlog and trigger provider rate limits.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black | LED mouse pad with 14 lighting modes, covers keyboard & mouse, anti-slip rubber base, waterproof surface, USB powered
  • 【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.

Use the Postfix sendmail-compatible interface

Postfix provides a sendmail-compatible command for programs that write a complete message to standard input. The -f option controls the envelope sender:

printf 'From: sender@example.comnTo: recipient@example.comnSubject: Ubuntu sendmail testnnBody textn' | sendmail -f sender@example.com recipient@example.com

The compatibility interface accepts message input on standard input and reports diagnostics through standard error and the system’s mail logging path. When an address comes from an untrusted variable, terminate options with -- before the address so a value beginning with a hyphen cannot be interpreted as another option:

printf '%sn' 'Body text' | sendmail -f sender@example.com -- "$recipient"

Use a properly formatted message, including a blank line between headers and the body. The envelope sender set by -f is separate from the visible From: header and may be subject to the relay’s sender-domain policy.

Connect directly with SendEmail

Install and check the client

On Ubuntu, the SendEmail package provides a lightweight command-line SMTP client. Install it with APT if it is available in the enabled repositories, then check the installed manual page for the exact version and options. The Ubuntu Noble manual identifies SendEmail version 1.56-5.2.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo apt update
sudo apt install sendemail
man sendEmail

Submit a message to an authenticated relay

The documented form supplies the sender, recipient, subject, body, SMTP endpoint, username, and password:

sendEmail -f sender@example.com -t recipient@example.com 
  -u 'Ubuntu test' -m 'Body text' -s smtp.example.com:587 
  -xu 'smtp-user' -xp 'smtp-password'

The example demonstrates the option names; replace every value with the relay’s approved settings. Do not use a real password in a shared command history or in a script readable by other users. Prefer a protected secret mechanism supported by your operating environment and the relay. If the client’s default encryption behavior does not match the provider’s requirements, set the documented TLS-related extended options with -o and verify the result in verbose mode.

Useful SendEmail options

  • -a attaches a file. Confirm that the file is permitted to leave the server and that its size complies with relay limits.
  • -cc and -bcc add copied recipients. Remember that blind-copy addresses are still visible to the SMTP service and may be logged.
  • -o supplies extended settings, including options needed for a relay’s TLS or authentication behavior.
  • -v enables verbose diagnostics. Use it during testing, but review the output for exposed credentials before saving or sharing it.

SendEmail’s success status means the client completed its submission attempt. It does not establish that the recipient accepted the message permanently or that it appeared in the inbox.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【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.

Use Mailutils for SMTP URLs and interactive diagnostics

SMTP mailbox URLs

GNU Mailutils documents SMTP mailbox URLs in the form smtp://user:pass@host:port, with optional authentication mechanisms. Treat a URL containing a password as a secret: it can be exposed through shell history, process inspection, logs, or copied terminal output. Use an alternative protected credential mechanism where your deployment supports one.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The current GNU Mailutils manual is edition 3.21 and was updated 12 October 2025. Confirm the installed package’s manual page because command syntax and available authentication mechanisms depend on the version installed on the server.

Interactive SMTP session

The mailutils smtp client can connect to a server and expose protocol steps directly:

mailutils smtp
connect smtp.example.com 587
-tls
ehlo mail.example.com
auth
from sender@example.com
to recipient@example.com
send

Use the exact interactive syntax shown by mailutils smtp --help for the installed release. The important diagnostic sequence is to connect, negotiate TLS when required, issue EHLO, authenticate, specify the envelope sender and recipient, and submit the message. Never type a production password into a session that is being recorded or shared.

Test SMTP capabilities safely

Ubuntu’s Postfix guide demonstrates capability testing with telnet mail.example.com 25 followed by ehlo mail.example.com. This can show server capabilities such as 250-STARTTLS and 250-AUTH when enabled, but Telnet itself is plaintext. Use it only where exposing the session is acceptable and never send credentials through an unencrypted connection.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a submission port or a server that requires encryption, use a TLS-aware client that performs certificate verification and displays the negotiated capabilities. Check that the certificate name matches the hostname, that the server advertises the authentication method you intend to use, and that the connection fails rather than silently falling back to plaintext when TLS is mandatory.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Understand what a successful command proves

There are several separate milestones:

  1. Local submission: the command passed a syntactically acceptable message to Postfix or another local process.
  2. Queue acceptance: the MTA assigned an ID and retained the message for delivery.
  3. SMTP handoff: a destination or relay server accepted the message during an SMTP transaction.
  4. Final delivery: the recipient’s system stored the message in a mailbox rather than rejecting, quarantining, or filtering it.

A zero exit status generally covers only the first milestone, and sometimes the second. Confirm later stages through Postfix logs, relay responses, bounce messages, and the recipient’s mailbox or provider console. There is no universal Ubuntu command-line delivery-success percentage: results vary with DNS, authentication, IP reputation, sender policy, relay rules, and recipient policy.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【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.

Troubleshoot a message that did not arrive

1. Check the service and queue

systemctl status postfix
postqueue -p

If Postfix is stopped, restart it and inspect the journal for the startup error. If a message is queued, record its queue ID and the reason shown beside it. A growing queue indicates a systemic problem rather than a single recipient typo.

2. Read the relevant logs

journalctl -u postfix
sudo tail -f /var/log/mail.log

Run the log view while submitting one test message so you can correlate the timestamp, queue ID, remote host, SMTP response, and retry decision. Look for authentication failures, TLS negotiation errors, DNS lookup failures, connection timeouts, and recipient rejection codes.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

3. Validate DNS and host identity

  • Confirm that the server can resolve the relay hostname and that outbound DNS is permitted.
  • Check the server hostname and the reverse-DNS record for the sending IP where the relay or recipient policy requires them.
  • Verify that the sender domain’s SPF, DKIM, and DMARC policy is compatible with the relay and the visible envelope sender.
  • Make sure the TLS certificate is valid for the hostname you configured, not merely for an IP address.

4. Validate authentication and sender policy

Recheck the relay username, password, port, authentication mechanism, and required encryption mode. Some relays permit authentication only after TLS. Others allow a login but reject a sender address that is not authorized for the account or verified domain. Use the exact rejection text from the SMTP response rather than guessing.

5. Distinguish rejection, deferral, and filtering

A permanent SMTP rejection should be corrected before retrying. A temporary deferral may clear on a later Postfix retry, but repeated deferrals can indicate a blocked port, DNS problem, rate limit, or remote outage. If the relay accepted the message and Postfix removed it from the queue, investigate the relay’s delivery event and the recipient’s spam or quarantine folders; local queue status alone cannot show what happened afterward.

6. Rotate exposed credentials

If a password appeared in a command line, process listing, shell history, transcript, or log, rotate it immediately, update the protected credential store, and restart or reload the service as required. Remove copies from scripts and shared files, then send a new test with a non-sensitive body.

Operational practices for scripts and cron jobs

  • Use a stable local Postfix submission path for recurring jobs so scripts do not each carry SMTP credentials.
  • Set an explicit envelope sender that your relay permits, and use a consistent subject that identifies the host and job.
  • Keep message bodies free of passwords, access tokens, and unnecessary personal data.
  • Capture command errors and alert when the Postfix queue exceeds a reasonable operational threshold.
  • Test after package upgrades or relay-policy changes; a previously working command can fail when TLS, authentication, or sender requirements change.
  • Restrict who can read scripts, environment files, queue data, and log exports, because those locations can contain addresses and message content.

Practical decision guide

Choose local Postfix when

The server runs cron or monitoring jobs, you want queueing and retries, and an administrator can maintain one centrally protected relay configuration. Applications submit with mail or the Postfix-compatible interface without handling SMTP passwords.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose SendEmail when

You need a short, direct SMTP invocation for a controlled test or a small utility and the relay’s endpoint and authentication requirements are known. Use verbose mode only during diagnosis and protect the credential source.

Choose Mailutils SMTP when

You need SMTP URL parameters, selectable authentication mechanisms, or an interactive session that exposes each protocol step. It is particularly useful for isolating whether failure occurs during connection, TLS negotiation, authentication, envelope commands, or message transfer.

Whichever path you select, separate submission from delivery in your diagnosis: inspect the queue, read the logs, verify TLS and authentication, and use the remote server’s response to determine the next fix.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.