Here we can see, “Disable Local Email Delivery With Postfix and iRedMail”
You’re trying to disable local email delivery on your DIY email server using iRedMail and postfix, but you’re hitting your head against the wall. You utilize a home server for email delivery, but your inbox is on a separate server. In this article, I’ll share what I’ve learned about using Postfix to disable local email delivery and require all emails for specific domains to be forwarded through their respective MX addresses.
I looked and searched for this information on the internet, and to be honest, I’m not sure if it will work for your configuration. Nonetheless, given the amount of time I spent researching this issue, even as a non-Linux server specialist, I felt I’d share my findings to alleviate your frustration.
The Error
You’ve come to the right spot if you’re getting the “unknown user in virtual mailbox table” issue. You want postfix to stop attempting to deliver email to non-existent email accounts on your server. Is that too much to hope for?
Fixing Postfix To Disable Local Email Delivery For A Domain
Because main.cf contains all of the postfix’s major configuration parameters, and you can open it with vim /etc/postfix/main.cf.
Look for the virtual mailbox domains line and insert a # in front of it to comment it out. This will completely prevent local email delivery. Here’s one of mine:
#virtual_mailbox_domains = proxy:ldap:/etc/postfix/ldap/virtual_mailbox_domains.cf
Then, under the relay domains line, prepend whatever is there with the domain names of the email accounts whose inboxes are hosted on your home email server. This is how mine looks:
relay_domains = payette.email, $mydestination, proxy:ldap:/etc/postfix/ldap/relay_domains.cf
Finally, locate the transport maps line and append hash:/etc/postfix/transport to whatever is already present. In the next stage, we’ll create the real file. This is how mine looks:
transport maps = hash:/etc/postfix/transport, proxy:ldap:/etc/postfix/ldap/transport maps user.cf, proxy:ldap:/etc/postfix/ldap/transport maps domain.cf, proxy:ldap:/etc/postfix/ldap/transport maps domain.cf, proxy:ldap:/etc/postfix/
All that’s needed is to create the transport file, which instructs the MX server to “take all incoming email to this domain and pass it through this MX server instead!”
So, type vim /etc/postfix/transport to make the file. Put the MX server inside brackets for each domain you want to stop local delivery for, as shown in the example below. Here’s one of mine:
payetteforward.com smtp:[aspmx.l.google.com]
Then, by entering postmap /etc/postfix/transport, do whatever postmap does with the file. That’s crucial — I’d explain why, but I’m sure it’s well beyond your comprehension. (I don’t have a clue what it does.)
Trick: If you’re not sure what the correct MX server for a domain is, you can use this groovy command to figure it out – I think you’ll like it, guy.
dig -tmx payetteforward.com
After that, type the service to restart Postfix. Restart postfix, say a prayer, and try again. If it succeeds, I’d like you to buy me a Corvette. If it doesn’t, please let me know in the comments area, and we can collaborate to make this a more understandable approach to resolving the issue.
Postfix Post Fix
For the time being, consider yourself lucky that the problem has been solved: You’ve turned off local delivery on your postfix or iRedMail-based email server and replaced it with the necessary MX addresses.
Conclusion
I hope you found this guide useful. If you’ve got any questions or comments, don’t hesitate to use the shape below.
User Questions
1. Why am I receiving emails from the mail delivery subsystem repeatedly?
When you receive an email from a “MAILER-DAEMON” or a “Mail Delivery Subsystem” with a subject like “Failed Delivery” or something similar, it signifies that an email you sent was returned to you as undeliverable. The reason for the delivery failure is frequently included in these notifications, which are generated automatically.
2. Why am I getting a notification that says “Mail delivery failed, message to sender”?
This type of error usually occurs when the recipient server is down, or the intended recipient does not exist on the remote server. A banned server could potentially be to blame.
3. What exactly does the term “Mail delivery subsystem” imply?
When you receive mail from a “MAILER-DAEMON” or a “Mail Delivery Subsystem” with a subject like “Failed Delivery,” it signifies that a message you sent was returned to you as undeliverable. The reason for the delivery failure is frequently included in these notifications, which are generated automatically.
4. Disable Forwarding of emails : r/sysadmin – Reddit
5. Block email access : r/Office365 – Reddit