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
World desk13 min

How to Change the Envelope From Address in Postfix

A practical Postfix guide to changing the SMTP envelope sender with sender_canonical_maps or smtp_generic_maps, including envelope-only rules, commands, verification and troubleshooting.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use sender_canonical_maps to rewrite a sender during Postfix cleanup, rebuild its lookup table with postmap, and reload Postfix. To change only the SMTP envelope sender while leaving the visible From: header untouched, set sender_canonical_classes = envelope_sender. Use smtp_generic_maps instead when the rewrite should happen only as mail leaves the host through SMTP.

Envelope sender and the visible From address are different

The envelope sender is the address Postfix supplies in the SMTP MAIL FROM command. Receiving systems use it for delivery decisions, bounce handling and other transport functions. The message also contains a visible From: header, which mail clients display to readers. Changing one does not automatically change the other.

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.

A receiving server may expose the envelope sender as a Return-Path: header after delivery. Editing the message’s visible From: header is therefore not a reliable way to change the address used for bounces. Configure the SMTP envelope layer explicitly.

This distinction is the first diagnostic question: do you want to change the transport identity used by MAIL FROM, the author identity displayed in the message, or both? Postfix offers different mapping stages and classes for those requirements. A successful header rewrite can still leave the SMTP envelope unchanged, and a successful envelope rewrite can intentionally leave the reader-facing header alone.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

Choose the mapping mechanism before editing files

Mechanism Where it runs Addresses it can affect Typical use
sender_canonical_maps Postfix cleanup processing Envelope sender and, by default, header sender; classes can be restricted Sender-focused rewriting that should be applied as Postfix processes the message
smtp_generic_maps Outbound SMTP delivery Envelope and header addresses Converting local or private addresses only when mail leaves this host

Choose sender_canonical_maps when the requirement is specifically “rewrite this sender” and you need control over envelope and header classes. Choose smtp_generic_maps when the transformation belongs at the outbound SMTP client stage. The generic mapping is the outbound counterpart to canonical mapping and is non-recursive.

Neither setting is a substitute for the other. A cleanup-stage rule may affect messages before they are queued or delivered, while a generic rule is evaluated when Postfix delivers through SMTP. A service in master.cf can also disable address mappings, so a service-level exception may override a globally correct configuration.

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

Compare the choices on four axes before making a change:

  • Processing stage: canonical mapping runs during cleanup; generic mapping runs when the SMTP client delivers.
  • Address scope: canonical classes can be narrowed to the envelope sender, while generic mapping affects envelope and header addresses.
  • Direction: canonical rewriting belongs to normal message processing; generic rewriting is specifically an outbound transformation.
  • Service behavior: a master.cf service using no_address_mappings can bypass mappings that are active elsewhere.

Method 1: rewrite with sender_canonical_maps

This is the usual sender-focused solution. The example below maps one original address to one replacement address. Replace the addresses with values valid for your environment.

1. Add the sender map in main.cf

Edit /etc/postfix/main.cf and add a supported table type. A documented LMDB example is:

sender_canonical_maps = lmdb:/etc/postfix/sender_canonical

Installations without LMDB support can use another table type available on that system, such as:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sender_canonical_maps = hash:/etc/postfix/sender_canonical

The database prefix must match the lookup-table support compiled into your Postfix installation. Keep the path consistent with the file you will edit in the next step. If postconf shows a different existing value, edit that configuration deliberately rather than creating competing definitions.

2. Create the source map

Create /etc/postfix/sender_canonical. Put the original sender on the left and the replacement on the right, separated by whitespace:

[email protected] [email protected]

The left side is the address Postfix receives from the message. The right side is the address Postfix should use after the mapping is applied. Add additional explicit lines when more senders need different replacements. Avoid an unintended wildcard or catch-all entry while testing; a broad pattern can rewrite senders you did not intend to touch.

Keep the source file as the authoritative, human-readable copy. The indexed file created by postmap is derived data. When troubleshooting, confirm that you edited the same source path named in main.cf, rather than a similarly named file in another directory.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

3. Decide whether headers should change

By default, sender canonical mapping applies to both the envelope sender and header sender. To rewrite only the SMTP envelope sender, add this setting to /etc/postfix/main.cf:

sender_canonical_classes = envelope_sender

With that restriction, the MAIL FROM address is mapped but the message’s visible From: sender is left as it was. If you omit the setting, the default classes include envelope_sender and header_sender, so the same mapping can alter both layers.

Use the default only when changing the visible sender is intentional. If users must continue seeing the original author address while bounces go to a different mailbox, the envelope-only setting is the important part of the configuration. Conversely, do not select envelope-only behavior if the operational requirement is to make both the transport and visible sender consistent.

4. Build the indexed lookup table

After creating or changing the source file, run postmap against that exact path:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
postmap /etc/postfix/sender_canonical

Postfix reads the generated indexed database, not just the text file. Run the command after every edit; otherwise the active lookup data can remain stale even though the source file looks correct. This rebuild is required for additions, deletions and corrections alike.

5. Reload Postfix

postfix reload

A reload makes the changed configuration visible without waiting for the normal configuration delay and does not require stopping the mail service. Keep the table rebuild and reload together in your change procedure so that a corrected map is actually active.

What canonical mapping changes in practice

Sender-specific mappings are applied before common canonical_maps. That ordering helps keep a sender-only requirement from unintentionally becoming a broader canonical rewrite that also changes recipients. It also means you should inspect any existing canonical configuration when a result looks wider than expected: the sender map may be correct while a later or common rule accounts for another change.

Method 2: rewrite at outbound SMTP time with smtp_generic_maps

Use a generic map when the address should be transformed only as Postfix sends mail through its SMTP client. This is useful when software submits mail with a local-only domain but external recipients must see a publicly deliverable address.

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

Configure the generic map

Add the map to /etc/postfix/main.cf:

smtp_generic_maps = hash:/etc/postfix/generic

Create /etc/postfix/generic with a left-to-right mapping:

[email protected] [email protected]

Then compile and activate it:

postmap /etc/postfix/generic
postfix reload

The generic mapping replaces envelope and header addresses during outbound SMTP delivery. It is non-recursive, so Postfix does not repeatedly feed a replacement back through the same mapping. Because it affects both address layers at that delivery stage, it is not the right choice when the visible From: header must remain unchanged.

Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

This outbound timing is useful when the local representation is acceptable inside the host or queue but is not suitable for the next SMTP server. The address presented at the external boundary can consequently differ from the address used earlier in processing. If the requirement is to change the sender before queuing or to preserve a header independently, use the canonical mechanism instead.

How the processing stages affect the result

Cleanup-stage canonical rewriting

sender_canonical_maps is evaluated in Postfix cleanup processing. Sender-specific mappings are applied before common canonical_maps, which helps keep a sender-only requirement from unintentionally turning into a broader recipient rewrite. The result can travel with the queued message and be used by later delivery stages.

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.

Because the mapping is associated with cleanup, test messages submitted through different services can have different results if one service disables address mappings. Do not assume that a map tested through local pickup was also used by a submission service or another path.

Outbound SMTP generic rewriting

smtp_generic_maps is evaluated when Postfix is acting as an SMTP client for delivery. The address used internally before delivery can therefore differ from the address presented to the next SMTP server. This stage-specific behavior is why generic mapping is suited to translating local addresses only at the external boundary.

Generic mapping is non-recursive. A replacement is not repeatedly looked up as another source value in the same generic table. Define the intended final address directly in the right-hand side of the entry.

Service-level bypasses

A service definition in master.cf may include:

receive_override_options=no_address_mappings

When that option is present for the service receiving the message, address mappings can be disabled there. A map that works for ordinary mail can consequently appear ineffective for one submission, pickup or other service. Compare the service path used by the test message with the relevant master.cf entry before changing a working global map.

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

This is a scope issue, not necessarily a syntax issue. First identify how the failing message entered Postfix, then inspect that service’s override options. Changing the global map cannot affect a service that explicitly bypasses address mappings.

Verify the active configuration and the actual envelope sender

Verification should distinguish configuration state from the address that a receiving server actually sees.

  1. Check which mechanism is active. For canonical rewriting, run postconf sender_canonical_maps sender_canonical_classes. For outbound rewriting, run postconf smtp_generic_maps.
  2. Open the source map and confirm the intended original address is on the left and replacement address on the right. Check for spelling, whitespace errors and unintended wildcard entries.
  3. Run postmap against the exact source file after the last edit. A changed text file without a rebuilt table is not an active change.
  4. Run postfix reload after rebuilding the table.
  5. Send a controlled test message through the same Postfix service and delivery path used in production.
  6. Inspect the receiving server’s SMTP transaction, delivered headers or displayed Return-Path. Confirm the envelope sender changed, and separately confirm whether the visible From: header changed. A header-only inspection cannot prove what was sent in MAIL FROM.

For an envelope-only canonical rule, the expected result is a new envelope sender with the original visible From: value. For a generic rule, expect both envelope and header addresses to reflect the outbound mapping when the mapped address appears in each layer.

Use a newly submitted controlled message for verification. A message already queued may have gone through an earlier processing state, so it is not a reliable test of a newly rebuilt map and reloaded configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

Troubleshoot a mapping that appears not to work

The configuration shows the old value

  • Run the appropriate postconf command and verify that the map parameter points to the file you edited.
  • Check that the table prefix, such as lmdb: or hash:, is supported by this Postfix installation.
  • Re-run postmap using the exact source path, then reload Postfix.

The envelope changed, but the From header did not—or vice versa

Check sender_canonical_classes. The default includes both envelope_sender and header_sender; setting it to envelope_sender deliberately limits the rewrite. If you selected smtp_generic_maps, remember that its outbound mapping affects both envelope and header addresses, so it cannot provide envelope-only behavior.

Do not infer the envelope value from a displayed header. Confirm the SMTP transaction or the receiving server’s resulting Return-Path, then inspect the visible From: separately.

A rule works for one mail path but not another

Inspect the service in master.cf. The no_address_mappings override can bypass address mappings for a particular service even when the global configuration is correct. Repeat the test through the exact service that failed.

The source file was edited but delivery is unchanged

The indexed database may still contain the previous contents. Rebuild it with postmap, reload Postfix, and send a new controlled message. Existing mail already queued may have been processed under the earlier state, so test a newly submitted message.

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

A recipient reports the wrong Return-Path

Check the envelope transaction rather than changing only the visible header. The address supplied in MAIL FROM is the value that governs bounce routing. Use the receiving server’s transaction details or delivered message metadata to determine whether the intended envelope mapping was applied.

The map appears to rewrite too much

Review the source file for a wildcard or broad pattern and verify whether the default canonical classes are rewriting header senders as well as envelope senders. An explicit entry and sender_canonical_classes = envelope_sender provide a narrower test. Also inspect common canonical_maps, because sender-specific mappings are processed before those common mappings.

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

Practical configuration patterns

Keep the visible author address, change only bounces

Use canonical mapping with the envelope class restricted:

# /etc/postfix/main.cf
sender_canonical_maps = hash:/etc/postfix/sender_canonical
sender_canonical_classes = envelope_sender
# /etc/postfix/sender_canonical
[email protected] [email protected]
postmap /etc/postfix/sender_canonical
postfix reload

This pattern separates the transport sender from the author identity shown in the message.

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

Translate a local submission address for external SMTP

Use a generic map when the rewrite belongs only at the outbound boundary:

# /etc/postfix/main.cf
smtp_generic_maps = hash:/etc/postfix/generic
# /etc/postfix/generic
[email protected] [email protected]
postmap /etc/postfix/generic
postfix reload

This changes the envelope and header forms presented during outbound SMTP delivery.

Safe change and rollback checklist

  • Back up the current main.cf and map file before editing.
  • Make one mechanism responsible for the requirement: canonical mapping for cleanup-stage sender control, or generic mapping for outbound SMTP translation.
  • Use an explicit sender entry while testing instead of a broad pattern.
  • Rebuild the indexed table after each source-file change.
  • Reload Postfix and verify with a newly submitted test message.
  • To roll back, restore the previous map and configuration values, run postmap on the restored source file, and execute postfix reload.

A rollback is incomplete if only the text file is restored. The indexed table must also be rebuilt, and Postfix must be reloaded so the restored configuration and lookup data are visible to subsequent messages.

Decision summary

Requirement Configuration choice Important qualification
Change the envelope sender during normal Postfix processing sender_canonical_maps Rebuild with postmap and reload
Change only MAIL FROM while preserving visible From: sender_canonical_maps plus sender_canonical_classes = envelope_sender The default classes also include header_sender
Rewrite addresses only as mail leaves through SMTP smtp_generic_maps Outbound mapping affects envelope and header addresses and is non-recursive
One service ignores an otherwise valid map Inspect that service’s master.cf entry receive_override_options=no_address_mappings can bypass mappings

Frequently Asked Questions

How do I change only the Postfix envelope-from address?

Configure sender_canonical_maps, add the original and replacement addresses to the map, and set sender_canonical_classes = envelope_sender. Rebuild the table with postmap and run postfix reload. The visible From: header remains unchanged.

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

How do I change the Return-Path in Postfix?

Change the SMTP envelope sender, not only the visible header. The envelope sender is supplied in the MAIL FROM command and may appear as Return-Path: after delivery. Use a canonical sender map for normal processing, or a generic map for outbound SMTP rewriting.

What is the difference between MAIL FROM and From:?

MAIL FROM is part of the SMTP envelope and is used for delivery and bounces. From: is a message header displayed by mail clients. They are separate layers, so changing the header alone does not change the bounce address.

Should I use sender_canonical_maps or smtp_generic_maps?

Use sender_canonical_maps for sender-focused cleanup rewriting and control it with sender classes. Use smtp_generic_maps when the transformation should occur only as Postfix delivers through SMTP, such as converting a local-only domain for external delivery.

Why did my canonical map change the visible From header too?

The default sender canonical classes include both envelope_sender and header_sender. Set sender_canonical_classes = envelope_sender when the visible header must remain unchanged.

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

Does smtp_generic_maps support envelope-only rewriting?

No. The generic mapping replaces envelope and header addresses during outbound SMTP delivery. It is therefore unsuitable when you must change MAIL FROM while preserving the visible From: header.

Do I need to run postmap after editing the map?

Yes. Postfix reads the indexed lookup database generated by postmap. Run postmap against the exact source file after every change, then reload Postfix so the active configuration sees the rebuilt data.

Is a Postfix restart required?

Use postfix reload after rebuilding the map. A reload makes configuration changes visible without stopping the mail service or waiting for the normal configuration delay.

Why does the map work for one service but not another?

Check the relevant master.cf service. A service can specify receive_override_options=no_address_mappings, which bypasses address mappings for messages entering through that path.

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

How can I verify the actual envelope sender?

Send a controlled new message through the same service and delivery path, then inspect the receiving server’s SMTP transaction, delivered metadata or resulting Return-Path. A visible From: header alone cannot prove which address was used in MAIL FROM.

The Bottom Line

For a Postfix envelope-from rewrite, use sender_canonical_maps, rebuild the map with postmap, and reload Postfix. Add sender_canonical_classes = envelope_sender when only MAIL FROM should change. Choose smtp_generic_maps for outbound-only rewriting, and always verify the receiving server’s envelope transaction separately from the visible From: header.

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 *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
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.