mail-in-a-box / mailinabox

Mail-in-a-Box helps individuals take back control of their email by defining a one-click, easy-to-deploy SMTP+everything else server: a mail server in a box.
https://mailinabox.email/
Creative Commons Zero v1.0 Universal
14.02k stars 1.44k forks source link

Sending emails from another domain #2011

Open kprokopenko opened 3 years ago

kprokopenko commented 3 years ago

Hello.

The domain example.com is managed by MIAB. The domain example.net is not managed by MIAB.

My PHP script sends mail FROM: robot@example.net. For this, I add alias robot@example.net (Permited users robot@example.com).

image

Everything is fine and the mail is being sent. But when trying to send an email from user@example.com to any address in the example.net domain (user@example.net), an SMTP Error (550) appears: Failed to add recipient "user@example.net" ( 1 <user@example.net>: Recipient address rejected: User unknown in virtual mailbox table).

I assume that after adding the alias, the entire example.net domain came under the control of MIAB.

Is this a bug or a feature? Maybe there are other ways to send emails from mail from another domain?

myfirstnameispaul commented 3 years ago

When you state a domain is "handled by", do you mean: MiaB is hosting the email for the domain or MiaB is the name server for the domain?

Are any other servers able to successfully send mail to example.net?

kprokopenko commented 3 years ago

Thank you for your interest.

Miab is hosting for mail and for DNS at example.com. example.net is not affiliated with MIAB. Hosted by Google Corporate (G Suite).

Are any other servers able to successfully send mail to example.net?

Yes, if I send email from any address outside the domain example.com (and therefore outside MIAB's control), the mail is delivered to example.net.

myfirstnameispaul commented 3 years ago

The tool is intended for configuring alias addresses for mail being sent to MiaB. Your use case seems outside this scope.

Even if it is a bug, it is unlikely to get patched unless you want to contribute the code, as this is essentially an undesirable configuration from the perspective a personal mail server.

If you want to share what you are trying to accomplish, there may be an alternative solution.

raccettura commented 2 years ago

Running across the same limitation. I suspect I'm not alone with this. Gsuite going away (becoming paid only) means a lot of people looking pay-per-address email hosting.

One affordable workaround is host your primary on one of the pricier paid options, and forward the rest of your business email addresses to a MiaB server (email forwards are normally free).

Problem is replying to an email exposes the MiaB server unless MiaB can be configured correctly. Setup as a catch all means mail intended for your domain gets rejected by MiaB which doesn't know what to do with it. Setup without means you're not authorized to send.