October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

How to Set Up a Send-Only iRedMail Server on Ubuntu

Turn an Ubuntu iRedMail installation into a send-only relay: route outbound mail through an authenticated smarthost, preserve sender-dependent maps, restrict clients and verify that the server is not an open relay.
Length11 min Posted Quest giverVGSources Team

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.

A “send-only” iRedMail server is not a separate iRedMail installation mode. It is an iRedMail/Postfix configuration that accepts messages from approved local applications or networks, sends every outbound message to an authenticated smart host, and does not accept Internet mail for local delivery. The essential settings are a Postfix relayhost (or sender-dependent relay map), a SASL password map, and tight limits on which clients may submit mail.

This guide shows how to apply that pattern on an existing Ubuntu iRedMail server, how to choose between one global relay and per-sender routing, how to preserve iRedMail’s existing database-backed maps, and how to prove that outbound delivery works without turning the host into an open relay.

As an Amazon Associate I earn from qualifying purchases.

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.

What “send-only” means in iRedMail

iRedMail normally bundles Postfix with mailbox, filtering, authentication and administration components. It does not provide a documented switch named “send-only.” Instead, you configure the Postfix transport so the server behaves as a submission relay:

  • Local applications, loopback clients or explicitly approved LAN addresses can submit messages.
  • Postfix forwards those messages to an upstream authenticated relay, also called a smarthost.
  • The Ubuntu host is not an Internet destination for the domains it sends from.
  • Unauthorised outside hosts cannot use it to relay.

“No inbound delivery” has two parts. Network access to SMTP must be restricted, and your public DNS and mail architecture must ensure that incoming mail for the domain is handled elsewhere. Merely setting a relay host does not, by itself, remove every inbound or local-delivery path.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.

Plan the topology before changing Postfix

Global outbound relay

Use one relay for all senders when every application and domain can use the same upstream account and endpoint. This is the simplest and least error-prone arrangement. Postfix reads one relayhost value and one SASL credential map.

Sender-dependent relays

Use sender-dependent routing when different envelope senders or domains must use different upstream accounts or endpoints. Postfix can enable smtp_sender_dependent_authentication and consult sender_dependent_relayhost_maps. A sender map can select a relay for a domain or address, while the SASL password map supplies the matching credentials.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Decision Global relay Sender-dependent relay
Configuration relayhost = [smtp.example.com]:587 plus one credential map sender_dependent_relayhost_maps, sender authentication and matching credentials
Best fit One provider account for all applications Several domains, accounts or relay endpoints
Operational risk Fewer moving parts More lookup and database entries to audit
iRedMail caution Usually independent of iRedMail’s per-domain database maps Check the active map first; replacing an existing MySQL lookup can break current routing

Port 587 appears in common Postfix relay examples and is the normal submission endpoint for many providers. Use the port and encryption requirements specified by your relay service; do not assume that every provider uses the same port.

Prerequisites and a safe change window

  • An Ubuntu server with iRedMail already installed and working for local submission.
  • Administrative access through sudo or a root shell.
  • An account with your upstream relay, its SMTP hostname, port, username and password or token.
  • A list of the applications or network ranges that are allowed to submit mail.
  • A maintenance window long enough to reload Postfix and send several test messages.

Do not begin by deleting iRedMail configuration files. First capture the active configuration and make a copy of every file you will edit:

sudo postconf -n > /root/postconf-before-send-only.txt
sudo postconf sender_dependent_relayhost_maps
sudo cp -a /etc/postfix/main.cf /etc/postfix/main.cf.before-send-only
sudo cp -a /etc/postfix/master.cf /etc/postfix/master.cf.before-send-only

The command output is the authority for your installed Postfix build. Paths and lookup methods can differ between iRedMail releases, so use the values shown on this server rather than copying a path from another installation.

Configure a single authenticated relay

1. Set the relay host in main.cf

Open the active Postfix configuration:

sudo editor /etc/postfix/main.cf

Add or change the following settings, replacing the example host and port with the values supplied by your relay service:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed
relayhost = [smtp.example.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous

The square brackets around the host are significant: they tell Postfix to connect to that exact host instead of performing an MX lookup for it. Keep only one active relayhost line. If an existing iRedMail setting already provides one, edit that line rather than creating a conflicting duplicate.

The smtp_sasl_security_options = noanonymous setting prevents anonymous SASL mechanisms. Your provider may require additional TLS or certificate settings; retain iRedMail’s existing secure transport configuration and follow that provider’s current Postfix instructions for any extra requirements.

2. Create and protect the SASL password map

Create the source password file with the relay endpoint as the key. The key must match the bracketed host and port used in relayhost:

sudo editor /etc/postfix/sasl_passwd
[smtp.example.com]:587 relay-user:strong-password

Use a generated password or provider token rather than a mailbox password that is reused elsewhere. Restrict the clear-text file to root and the Postfix processes that need it, then build the hashed map:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo chown root:root /etc/postfix/sasl_passwd
sudo chmod 600 /etc/postfix/sasl_passwd
sudo postmap /etc/postfix/sasl_passwd
sudo chmod 600 /etc/postfix/sasl_passwd.db

After postmap, both the source file and its .db file should be treated as credentials. Back them up only in an encrypted location. If you change the password later, edit the source file and run postmap again; Postfix reads the database, not the un-hashed text, during delivery.

3. Validate and reload

Check the syntax before asking Postfix to use the new map:

Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)
sudo postfix check
sudo systemctl reload postfix
sudo postconf relayhost smtp_sasl_auth_enable smtp_sasl_password_maps smtp_sasl_security_options

A successful reload does not prove authentication or delivery. It only proves that Postfix accepted the configuration. Perform the message test described later and inspect the mail log for the upstream server’s response.

Configure different relays for different senders

Inspect iRedMail’s current map before editing

iRedMail installations commonly use a database-backed sender-dependent map. Check the active value:

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

An output such as proxy:mysql:/etc/postfix/mysql/sender_dependent_relayhost_maps.cf means Postfix is already querying MySQL or MariaDB. Do not replace that line with a hash file merely because a tutorial uses one; doing so can silently remove existing sender routing.

Some installations expose the database-backed map through iRedMail’s administration data, while others have local customisations. Use the schema and map query already configured on this server, and take a database backup before changing rows. A per-domain relay setting in the iRedMail administration interface concerns received mail in some iRedMail versions; it should not be assumed to select the relay used for outbound messages.

Use a hash map only when no managed map is active

If postconf shows no existing sender-dependent map and you deliberately want a simple file-based setup, create a map such as:

example.org [smtp.example.com]:587
alerts.example.net [smtp.other.example]:587

Build it and point Postfix at it:

sudo postmap /etc/postfix/relayhost_maps
sudo postconf -e 'sender_dependent_relayhost_maps = hash:/etc/postfix/relayhost_maps'
sudo postconf -e 'smtp_sender_dependent_authentication = yes'
sudo systemctl reload postfix

The lookup keys and fallback order matter. Postfix’s sender-dependent authentication documentation describes checking sender-specific credentials before destination-based credentials and using a default relay when no sender match exists. Keep a default relayhost if unmatched senders must still have a defined route, and test both a matching and a non-matching sender.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC

Keep credentials aligned with sender routes

The password map must contain entries that match the lookup order used by your Postfix version and configuration. Depending on the active settings, Postfix can look up a sender address, a sender domain or the relay endpoint. Inspect the installed Postfix documentation and existing smtp_sasl_password_maps value rather than guessing the key. After every change, run postmap on the password file and send a message from each configured sender.

Restrict who is allowed to submit

Set Postfix mynetworks

mynetworks defines networks that Postfix treats as trusted clients. For a host used only by local applications, keep the trust boundary on loopback. For a separate application server on a private LAN, add only that server’s fixed address or the smallest required subnet. Review the active value with:

sudo postconf mynetworks

Edit /etc/postfix/main.cf only after documenting the current list. Never add an entire public address range or an interface that is reachable from the Internet simply to make a test pass.

Keep iRedAPD’s network list in sync

iRedMail’s policy daemon also has a network allow-list. The iRedAPD setting is in /opt/iredapd/settings.py and is commonly named MYNETWORKS. If a legitimate client is in Postfix’s mynetworks but not in iRedAPD’s list, policy checks can still reject it. If it is in iRedAPD’s list but Postfix does not trust it, Postfix can reject it first. Verify both lists and restart or reload the relevant service using the procedure documented for your installed iRedAPD release.

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

Choose the listening interfaces

When every sender runs on the same machine, set Postfix to listen on loopback only, using the syntax supported by your installed configuration:

inet_interfaces = loopback-only

For a private application network, listen on loopback and the specific private interface instead of every address. Confirm the result with postconf inet_interfaces and an operating-system socket check. An Internet-facing listener is not necessary for a local-only relay and increases the chance of accidental abuse.

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Prevent inbound mail from reaching the send-only host

Outbound relaying and inbound delivery are separate Postfix decisions. To make the role genuinely send-only:

  1. Restrict SMTP listening with inet_interfaces and your firewall so untrusted Internet hosts cannot connect.
  2. Allow only the loopback or private client addresses that actually submit mail.
  3. Ensure public DNS does not direct inbound mail for your production domain to this host when another system is responsible for receiving it.
  4. Review iRedMail’s local domains and aliases so you know which addresses Postfix still considers local. Do not remove local-domain settings blindly; applications may depend on them for submission.
  5. Test from an external machine that an unauthenticated connection cannot relay and that the host is not advertised as the destination for incoming mail.

If the same domain must both send through this Ubuntu host and receive elsewhere, treat DNS, mailbox hosting and outbound envelope routing as separate designs. A relayhost setting cannot move incoming mail to another service.

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

Send a controlled test message

Test locally first

Submit a message from the same host using the local sendmail-compatible interface or the application that will use the relay. Use a recipient mailbox you control and a distinctive subject. Immediately watch the mail log:

sudo tail -f /var/log/mail.log

On systems that route service logs through journald, use:

sudo journalctl -u postfix -f

A successful transaction normally shows Postfix connecting to the configured upstream host and receiving a successful SMTP response. The exact log wording varies by Postfix version and provider, so evaluate the delivery status and queue ID rather than looking for one fixed line.

Test every sender-dependent path

For a sender map, repeat the test with one sender that has a specific route and another that should use the default. Confirm in the log that each message connects to the intended relay and authenticates with the intended account. A message accepted locally but left in the queue is not a successful send-only test.

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

Test rejection from an untrusted host

From a machine outside the approved networks, attempt an SMTP submission without authentication. The server should refuse relay or refuse the connection according to your access policy. Do not use a real recipient for this test. If the host accepts and queues mail from an untrusted source, stop the service’s external exposure, correct mynetworks, iRedAPD’s MYNETWORKS, listener interfaces and firewall rules, then repeat the test.

Troubleshoot the common failure modes

Symptom Likely cause What to check
“SASL authentication failed” Wrong credential, wrong map key or stale database file Confirm the exact bracketed host and port in sasl_passwd, run postmap again, check file permissions and inspect the active smtp_sasl_password_maps value.
Upstream says relay access denied The provider does not permit the account, sender or destination Verify the relay account, allowed sender identities and provider port. This is an upstream policy response, not proof that local Postfix is broken.
Message remains queued Network, DNS, TLS or upstream availability problem Use the queue ID in the mail log, confirm that the configured relay host resolves and is reachable, and read the complete deferred-delivery reason.
Per-domain route is ignored An existing MySQL map was overwritten, or the lookup key does not match Run postconf sender_dependent_relayhost_maps, restore the original managed map if necessary, and verify whether the map expects an address or domain key.
Local client is rejected Its address is absent from one of the allow-lists Compare mynetworks with iRedAPD’s MYNETWORKS, check the client’s actual source address and reload the service after editing.
External host can relay Overly broad trusted networks or an exposed listener Remove public ranges from mynetworks, narrow inet_interfaces, block unwanted SMTP access at the firewall and retest from outside.
Postfix will not reload Syntax error or invalid map reference Run postfix check, inspect the service journal, and compare the changed lines with the backup made before the change.

Operate the relay securely

  • Keep /etc/postfix/sasl_passwd and its database readable only by the required account or root.
  • Use a relay-specific credential that can be revoked independently of user mailboxes.
  • Rotate the credential at the upstream provider, update the map, run postmap, reload Postfix and send a test.
  • Monitor the mail log and queue for unexpected volume, repeated authentication failures or deferred messages.
  • Record the approved client addresses and review them whenever an application is retired or moved.
  • Preserve a known-good copy of main.cf and the active map definitions so a failed change can be reversed quickly.

To inspect queued mail without altering it, use:

sudo postqueue -p

Do not purge the queue as a first response. Capture queue IDs and log messages first; deleting queued mail can destroy evidence and legitimate messages.

Global relay or standalone Postfix?

For a server that already runs iRedMail and needs local applications, keeping iRedMail and configuring Postfix as an outbound relay avoids introducing a second mail stack. A standalone Postfix relay can have a smaller footprint, but deciding between the two depends on the services you already use, your update process and whether iRedMail’s filtering and administration components are needed. The available configuration evidence does not establish a universal winner. Treat it as an architectural trade-off, not as a feature guarantee of a particular iRedMail release.

Final verification checklist

  • postconf -n shows the intended relayhost or sender-dependent map.
  • The relay endpoint in the password file exactly matches the configured host and port, including brackets where required.
  • postmap has been run after the latest credential change and both map files have restrictive permissions.
  • Postfix’s mynetworks and iRedAPD’s MYNETWORKS contain every approved client and no public range.
  • inet_interfaces and the firewall expose SMTP only where clients require it.
  • A local test reaches the upstream relay and arrives at the recipient.
  • Each sender-dependent route has been tested, including the fallback route.
  • An external unauthenticated host cannot relay through the server.
  • Public DNS and the receiving-mail design do not send inbound domain mail to this send-only host.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.