October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober 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 Email Forwarding with Postfix on a Linux VPS

Set up reliable domain-to-mailbox forwarding with Postfix virtual aliases, while avoiding relay loops, stale maps, and open-relay risks on a Linux VPS.
Length15 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use Postfix virtual aliasing to forward addresses on your domain to Gmail or another mailbox. Declare the domain with virtual_alias_domains, map each full recipient address in virtual_alias_maps, build the lookup database with postmap, check the configuration, and reload Postfix. Keep the domain out of mydestination and relay_domains, and restrict trusted networks so the VPS cannot become an open relay.

What you are configuring

Postfix can accept mail for a domain hosted on your VPS and redirect each recipient to another address. The forwarding decision is made with a virtual alias map. A recipient such as [email protected] can be sent to joe@somewhere, while another address on the same domain can point to a different destination.

As an Amazon Associate I earn from qualifying purchases.

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.

This is different from delivering mail to a local Unix account. Virtual aliasing operates on complete addresses, including the domain, and is intended for remote destinations as well as local ones. It changes the SMTP envelope recipient used for delivery; it does not rewrite the message’s headers. The original sender and visible To, Cc, and From fields therefore remain subject to the normal message headers, while Postfix uses the translated envelope recipient to determine where delivery goes.

The basic flow is:

  • DNS directs the domain’s incoming mail to the VPS.
  • Postfix recognizes the domain as a virtual alias domain.
  • A lookup table translates each hosted address to a destination.
  • Postfix delivers the resulting message locally or to the remote mail provider.

Virtual aliases are recursive. If one alias points to an address that maps back to the original address, Postfix can loop. Intentional recursion must be terminated by aliasing the affected address to itself; otherwise, correct the mapping. This matters when aliases are chained across several addresses, not only when a line visibly points straight back to itself.

#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.

A forwarding map is a recipient-translation mechanism, not a complete mail-hosting or sender-authentication system. It does not by itself provide a mailbox, rewrite headers, establish a sending reputation, or guarantee that Gmail and other providers will place forwarded messages in the inbox.

Prerequisites before editing Postfix

Point inbound DNS at the VPS

The domain’s MX records must point to the VPS, or to the inbound host that is supposed to hand mail to this Postfix instance. Without that, senders will deliver somewhere else and your forwarding map will never be consulted. If a separate inbound host is intentional, verify that it actually passes the recipient to this Postfix server; merely adding a map on the VPS cannot override the MX destination.

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

Confirm the VPS can receive and send SMTP

You need a stable public address and a clear policy for TCP port 25. Some providers block or restrict outbound port 25, and firewalls or network policy can prevent direct Internet delivery. Reverse DNS may also be required by the VPS provider or by recipient mail systems. These conditions are provider- and environment-specific; Postfix itself cannot guarantee them.

Inbound reachability and outbound reachability are separate checks. An MX record can direct mail to the VPS successfully while the provider still blocks outbound connections to recipient servers. Check both paths before diagnosing a map as broken. A message accepted by Postfix may remain queued or be deferred if the outbound path is unavailable.

Choose direct delivery or an SMTP relay

With direct delivery, your VPS connects to recipient systems itself. You retain control of the sending IP and its reverse-DNS configuration, but you must handle port-25 availability, queue behavior, bounces, and IP reputation. An authenticated or otherwise approved SMTP relay can be preferable when direct delivery is blocked or unreliable. A relay adds dependence on another service and may change how authentication, encryption, bounce processing, and reputation are managed.

Decision factor Direct delivery from the VPS SMTP relay or smarthost
Sending IP and reverse DNS You control the VPS address and its reverse-DNS setup. The relay generally controls the sending infrastructure.
Port 25 Requires provider and firewall support for outbound SMTP. Useful when direct port-25 delivery is restricted.
Authentication and encryption Configured between your Postfix host and each recipient system. Configured for the relay’s approved submission method.
Queue and bounce handling Operated and monitored on your VPS. Shared with or delegated to the relay according to its service.
Reputation Depends on your VPS IP and sending practices. Depends substantially on the relay’s reputation and policies.
Operational dependence Fewer third-party dependencies, but more administration. Less direct infrastructure work, with reliance on the relay.

The choice does not change the virtual-alias steps. In both cases, Postfix first translates the incoming recipient. The difference occurs when Postfix attempts to deliver the translated message. If you select a relay, follow that provider’s approved submission, authentication, and encryption requirements instead of assuming that direct Internet delivery settings will work unchanged.

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

Virtual aliases versus local aliases

Do not substitute /etc/aliases for a virtual-domain map when the addresses include a hosted domain. The two systems address different classes of recipients.

Property Local aliases Virtual aliases
Configuration /etc/aliases through alias_maps A map such as /etc/postfix/virtual through virtual_alias_maps
Lookup key Local part, such as postmaster Full address, such as [email protected]
Address scope Recipients considered local to the machine Addresses in a declared virtual domain
Remote destinations Not the mechanism for domain-wide remote forwarding Supports destinations such as joe@somewhere

A local alias can still be a destination of a virtual alias. For example, a virtual address can map to postmaster, after which local alias processing applies. The important distinction is that the incoming hosted address must be handled by the virtual map. If only a local username works during testing, that often indicates that you tested /etc/aliases rather than the virtual-domain path.

Plan the address list before editing the file. Decide which complete addresses should exist, which destination each one uses, and whether any address should intentionally remain local. Explicit entries make it easier to reject misspelled or abandoned recipients and avoid the broad behavior of a catch-all.

Configure the virtual alias domain

1. Check supported map types

Postfix installations do not all provide the same database back ends. Run:

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
postconf -m

Use a map type listed by that command. hash: is common on many installations; the official virtual-domain example also uses lmdb:. The prefix in virtual_alias_maps must match the type you later pass to postmap. A valid source file is not enough if Postfix is configured to read a different backend.

2. Declare the domain and map in main.cf

Edit /etc/postfix/main.cf and add or adjust:

virtual_alias_domains = example.com
virtual_alias_maps = lmdb:/etc/postfix/virtual

Replace example.com with your domain. If your system supports only a hash map, use:

virtual_alias_maps = hash:/etc/postfix/virtual

The virtual-domain declaration is required even when individual recipient mappings exist. It tells Postfix that the domain is accepted as a virtual alias domain rather than treated as an unrelated relay destination. If you host more than one forwarding domain, declare each intended virtual alias domain according to your Postfix configuration syntax and keep their mappings unambiguous.

3. Keep the domain out of conflicting classes

Do not also list the forwarding domain in mydestination or relay_domains. Misclassification can produce relay access denied or mail loops back to myself. A domain handled by virtual_alias_domains should not simultaneously be classified as a local destination or as a relay domain.

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

When troubleshooting, inspect the effective values rather than relying on memory about distribution defaults. A domain can appear in an included configuration file, a control-panel-generated setting, or another list you did not edit directly. The effective configuration is what determines how Postfix classifies the recipient.

4. Add recipient mappings

Create or edit /etc/postfix/virtual. The official pattern is:

[email protected] postmaster
[email protected]        joe@somewhere
[email protected]       jane@somewhere-else

Each line contains an incoming recipient and its destination, separated by whitespace. Use the complete incoming address, not only the username. You can map several addresses to one destination or send them to different destinations. Keep one mapping per line so that an edit, review, or later removal is easy to verify.

The destination can be a remote address such as [email protected] or a local recipient such as postmaster. A remote destination sends the message through the outbound delivery path you selected; a local destination continues through local alias or mailbox processing. The incoming domain still has to be declared as a virtual alias domain in either case.

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

For a catch-all, the virtual map syntax is:

@example.com [email protected]

A catch-all accepts otherwise-unmapped recipients. Test it deliberately: broad acceptance can attract backscatter and abuse, so an explicit list of valid addresses is safer for most forwarding-only domains. A catch-all also makes a typo look like a successful delivery, which can hide address-management mistakes until the destination mailbox is overwhelmed.

5. Build the indexed database

After every edit to the source file, rebuild the database with the same map type configured in main.cf:

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 postmap /etc/postfix/virtual

postmap writes the indexed lookup database beside the source file. With a hash map, that commonly produces /etc/postfix/virtual.db; LMDB creates its corresponding database files. If the map type or path differs from the configured value, edits will appear to have no effect because Postfix is reading another database.

Rebuild after adding, changing, or deleting a line. Treat the text file as the source of truth and the generated database as a compiled copy. Keep the path passed to postmap identical to the path after the map prefix in virtual_alias_maps; even a similarly named file in another directory is a different map.

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.

6. Check and reload Postfix

sudo postfix check
sudo postfix reload

Run postfix check after syntax or permission changes. Reloading makes the updated configuration available without stopping the mail service. If a check reports an error, fix it before testing delivery; a successful reload does not make an invalid or stale lookup database correct.

Protect the VPS from becoming an open relay

A forwarding host must accept mail for its own virtual domain without allowing arbitrary Internet users to relay through it. Postfix uses mynetworks to identify authorized clients and relay_domains to identify destinations for which forwarding is permitted. On a public VPS, keep trusted networks narrow—typically localhost and explicitly authorized systems—and do not authorize an Internet-facing subnet merely because it is convenient.

Review the effective configuration with:

postconf -n

Pay particular attention to mynetworks, relay_domains, recipient restrictions, and any catch-all entry. Postfix’s basic behavior allows clients in authorized network blocks to forward to any destination, so an overbroad mynetworks can turn the server into an open relay even if the virtual alias table is correct.

  • Authorize only networks and hosts that genuinely need to submit mail.
  • Do not add the whole public VPS subnet or an unrestricted Internet range to mynetworks.
  • Keep forwarding destinations limited to the addresses represented by your virtual-domain policy.
  • Test an unmapped recipient and confirm that it is rejected rather than accepted by an accidental catch-all.
  • Recheck restrictions after installing control-panel or distribution packages that may alter Postfix defaults.

Forwarding for your own virtual domain is not the same as permitting an authenticated client to choose any destination. Keep those concepts separate when reviewing restrictions. A request that arrives for an unmapped recipient should not become a general relay request simply because the connection originated outside the VPS or because a catch-all was added for convenience.

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

Verify the forwarding setup

Check the effective configuration

Use both commands below and investigate any error before sending test mail:

sudo postfix check
postconf -n

The output should show the intended virtual_alias_domains and the exact virtual_alias_maps path and map type. Also confirm that the forwarding domain is absent from conflicting destination classes and that trusted networks are no broader than intended.

Confirm that the database exists

Look beside /etc/postfix/virtual for the generated database. A hash configuration commonly creates /etc/postfix/virtual.db; an LMDB configuration creates the corresponding LMDB files. A missing or stale database means Postfix cannot use the latest mappings. Compare its modification time with the last successful postmap run after an edit.

Query one mapping directly

Ask the configured map for a known address. Substitute the map type that appears in virtual_alias_maps:

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
postmap -q '[email protected]' hash:/etc/postfix/virtual

For an LMDB setup, use lmdb:/etc/postfix/virtual instead. The command should print the destination associated with the address. An empty result indicates that the key is absent from the map or that you queried a different file or map type. Query at least one address after every batch of edits so a typo is found before a live sender exposes it.

Send a message from an unrelated account

Send mail to a mapped address from an account that is not an authorized local client. Confirm that the destination mailbox receives it, then inspect the message headers and the sender-side mail log. Headers show the resulting message path; logs reveal whether Postfix accepted the recipient, queued the message, deferred it, or received a remote rejection.

Use an unrelated sender for the test because a locally authorized client can follow a different submission or relay path. Test one mapped address at a time, record the destination, and avoid concluding that every alias works because a single address succeeded.

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

Test rejection and catch-all behavior

Send a separate test to an address that is not in the map. It should be rejected unless you intentionally configured a catch-all. If a catch-all exists, test an address that is not otherwise listed and verify that the result matches your abuse and backscatter policy. This negative test is essential: accepting a valid alias proves only that one lookup worked, not that unknown recipients are handled safely.

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

Troubleshoot common failures

“Relay access denied” or “mail loops back to myself”

Check that the domain appears in virtual_alias_domains. Remove it from mydestination and relay_domains, then rebuild the map and reload Postfix:

sudo postmap /etc/postfix/virtual
sudo postfix check
sudo postfix reload

These errors commonly result from classifying the same domain in incompatible ways. Confirm the effective values with postconf -n rather than checking only the line you remember adding to main.cf.

Edits do not change delivery

Run postmap against the exact source file and map type named in virtual_alias_maps. Then reload Postfix. Query the address with postmap -q and verify that the generated database timestamp changes after an edit. Editing the text file alone does not update an indexed map. If the query still returns the old destination, you are likely compiling or querying a different path from the one Postfix uses.

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

Only local usernames work

If postmaster works but [email protected] does not, you may be testing /etc/aliases instead of a virtual map. Add the full recipient address to /etc/postfix/virtual, rebuild the configured database, and reload. Remember that local aliases are looked up by local part, while virtual aliases are looked up by the complete address.

Outbound delivery is deferred or rejected

Inspect the mail log and the remote recipient’s response. Check the VPS provider’s port-25 policy, firewall rules, DNS, and reverse DNS. Recipient providers apply their own acceptance and reputation policies, so a correctly configured alias does not guarantee inbox placement. When direct delivery is unsuitable, configure an authenticated or otherwise approved SMTP relay and follow that service’s submission requirements.

Separate a forwarding decision from a delivery decision when reading logs. A successful virtual lookup means Postfix found a destination; it does not mean the destination server accepted the message. Deferrals, remote rejections, queue delays, and reputation responses occur after address translation and must be investigated along the selected outbound path.

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.

Unexpected forwarding or abuse

Review mynetworks, relay_domains, recipient restrictions, and every virtual-map entry. Look specifically for an unintended catch-all such as @example.com, an overbroad trusted network, or a recursive alias that sends mail back toward itself. Query suspicious addresses with postmap -q and compare the result with the intended address inventory.

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

Operational boundaries to keep in mind

Virtual aliasing solves recipient translation; it does not by itself solve sender authentication or reputation. Adding a map does not automatically configure SPF, DKIM, DMARC, reverse DNS, or acceptance by Gmail and other recipient providers. Those controls depend on your DNS, sending path, VPS provider, relay, and the policies of each receiving system.

Forwarding can also expose the VPS to unwanted traffic when a domain receives messages for addresses that were never intentionally created. An explicit map and a deliberate unmapped-recipient test provide a clearer boundary than a catch-all. If you later add an address, update the source file, rebuild the database, reload Postfix, and repeat both a positive lookup and a negative-recipient test.

Likewise, the examples above do not assume a particular Postfix version or Linux distribution. Use the map back end supported by your installation, verify the effective settings with postconf -n, and treat provider restrictions as deployment requirements rather than Postfix defaults. Keep a record of which map type, file path, domains, and destinations are active so future edits do not accidentally create a second, unused map.

Practical maintenance checklist

  • Keep MX records pointed at the intended inbound host and revisit them if the VPS address changes.
  • Keep virtual_alias_domains synchronized with the domains you actually operate.
  • After every map edit, run postmap, postfix check, and postfix reload.
  • Use postmap -q to verify new and changed entries before announcing an address.
  • Review postconf -n periodically for changes to trusted networks, relay domains, and recipient restrictions.
  • Test an unmapped address whenever a catch-all or policy change is introduced.
  • Monitor the mail log and destination feedback for deferred or rejected outbound messages.
  • Reassess direct delivery versus a relay if port 25, reverse DNS, or IP reputation becomes a problem.

Frequently Asked Questions

How do I forward mail from my domain to Gmail with Postfix?

Point the domain’s MX records to the VPS, declare the domain in virtual_alias_domains, and add a full-address mapping such as [email protected] [email protected] to /etc/postfix/virtual. Build the configured map with sudo postmap /etc/postfix/virtual, run sudo postfix check, and reload Postfix. Gmail still applies its own acceptance and filtering policies.

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

Why does Postfix report relay access denied?

Verify that the domain is listed in virtual_alias_domains and is not also listed in mydestination or relay_domains. Rebuild the map and reload Postfix. Use postconf -n to inspect the effective settings, including values supplied by included configuration.

Why does Postfix say mail loops back to myself?

The domain is often classified in conflicting destination classes, or an alias points back through a recursive chain. Keep the forwarding domain only in the virtual-alias class, correct the mapping, rebuild the database, and reload. Intentional recursion must terminate by aliasing the affected address to itself.

What is the difference between /etc/aliases and virtual_alias_maps?

/etc/aliases and alias_maps look up local parts such as postmaster. virtual_alias_maps looks up complete addresses such as [email protected] and can redirect them to remote destinations. A virtual alias may ultimately point to a local alias, but the incoming hosted address belongs in the virtual map.

Do I need to run postmap after every edit?

Yes. The indexed database is generated from the text source file, so editing the source alone does not change lookups. Run postmap with the same map type and path configured in virtual_alias_maps, then reload Postfix and verify the result with postmap -q.

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

How can I tell whether my Postfix server is an open relay?

Inspect mynetworks, relay_domains, recipient restrictions, and catch-all entries with postconf -n. Keep trusted networks limited to localhost and explicitly authorized systems, and test an unmapped recipient from an unrelated account. It should be rejected unless a catch-all was deliberately configured.

Should I use direct delivery or an SMTP relay?

Direct delivery gives you control of the VPS sending IP and reverse DNS but requires workable outbound port 25, queue management, bounce handling, and reputation management. An authenticated or approved relay can help when provider restrictions or reputation make direct delivery unsuitable, but it introduces a third-party dependency and its own authentication and submission requirements.

Why are messages accepted by Postfix but not reaching the destination?

A successful alias lookup only proves that Postfix translated the recipient. Check the mail log, outbound port-25 policy, firewall, DNS, reverse DNS, and the remote server’s response. The destination provider may defer or reject mail based on its own reputation and acceptance policies; a relay may be appropriate when direct delivery is unreliable.

The Bottom Line

For domain forwarding on a Linux VPS, use virtual_alias_domains and a full-address virtual_alias_maps file, compile it with postmap, validate with postfix check and postconf -n, and reload Postfix. Keep the domain out of mydestination and relay_domains, restrict mynetworks, test both mapped and unmapped recipients, and choose direct delivery or an approved SMTP relay based on your provider’s port-25, DNS, and reputation conditions.

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

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.

Leave a Reply

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

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.

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
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

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.