mailcow / mailcow-dockerized

mailcow: dockerized - 🐮 + 🐋 = 💕
https://mailcow.email
GNU General Public License v3.0
8.9k stars 1.17k forks source link

Allow "From" as an "external" email address #2622

Closed lbeltrame closed 4 years ago

lbeltrame commented 5 years ago

Is your feature request related to a problem? Please describe. One of my email address is at a domain that does not host mail, but instead it forwards mail to my address, but allows me to use its domain in "From". In Kolab, this is called "external email address".

Describe the solution you'd like It would be nice to allow this in mailcow without having to disable sender checking.

mkuron commented 5 years ago

One thing to keep in mind here is that SPF, DKIM and DMARC severely limit the usefulness of an "external email address" feature nowadays. If you control the other domain, it‘s ok, but there should be a big warning or even an SPF check when adding such an address. Otherwise we‘ll see people complaining that their messages sent like that go to spam.

lbeltrame commented 5 years ago

I'm aware. In this specific case, the service itself does not host any mailboxes and only uses forwarding. But I agree that a SPF check and a big warning would be useful.

andryyy commented 5 years ago

I have had some people asking to send from GMX, Web.de etc. (because it worked in XY before). So yes, we should add a big warning.

sunnyflo commented 5 years ago

Hi guys. I also misses an function to send from external mail. but i want to bypass the spf / dkim problem by using the gmx, web.de, etc. as a smarthost. In final the admin should assign the external smarthost to certain users. could this be possible ?

andryyy commented 5 years ago

You cannot use GMX, Web.de etc. as smarthost for your personal domain. Not exactly sure what you are doing. Gmail kind of allows this, but rewrites all mail to your Gmail address (correct me if I'm wrong).

You can only assign a sender dependent default transport to a domain. That's the other problem. You would need to be able to assign it to a mailbox or an alias. Feel free to create PR or sponsor it. :)

But before we talk about this sender transport thing, we would need to implement the "external addresses" stuff to the sender_acl.

It is much easier: you seem to have a working GMX account, just use it for SMTP in your client then. :)

sunnyflo commented 5 years ago

Hi Andre. I think you misunderstood my goals. Let me give you an example. My wife has a private mai account on our domain. Additionally she has an imap/smtp Account for her school job and an third account for the sports club where she is member of. In outlook it's easy. You simply add three accounts (pop3 or imap). If you want to send an mail, you can choose the right account by choosing within the "from" field in the blank email dialog. Something like this i wish to have in mailcow / sogo. It's quite easy to receive the mails by using the synchronisation function, but you have always send mail by defined domain. I hope you now understand my goals.

Flo

MightyPork commented 2 years ago

Hi, I'm sorry to bump into old thread, but didn't want to open a new issue for essentially the same question.

We're migrating family accounts from gmail legacy free workspace, the thing where you used your own domain with gmail, now they want to move people to a paid plan with prohibitive pricing. I set up mailcow to try as a replacement.

My old setup was like this:

family.cz - our custom domain with MX pointing to google joe@family.cz - my main mailbox hosted at gmail joe@work.cz - work e-mail with a webmail and a forwarding all to "joe@family.cz"

I have "joe@work.cz" added as an alias in gmail. All incoming mail goes to my gmail inbox thanks to the forward, and I have a dropdown in g-mail to choose the work address as "From:" when sending e-mail. I never had a problem with this setup, mails get delivered.

Now I'm looking into how to replicate this in mailcow, I'm somewhat confused by the settings. The docs were helpful in setting up the server, I can't find much info on this though.

The ideal solution, I think, would be to tell mailcow to use an external SMTP when sending "as" that external address, but how do I do this?

mkuron commented 2 years ago

It basically spoofs the sender field, if I uderstand it correctly.

Correct. And if work.cz has SPF/DKIM enabled, that spoofing can be detected by the recipient and the message will be recognized as spam.

I found the table "Sender-dependent transports" and "Transport Maps"

The latter is for matching a recipient domain and the former is essentially for setting a relayhost for individual domains of your server.

I can also add a new domain with "work.cz" into mailcow

Paired with a sender-dependent transport, that would help. But it would prevent you from sending messages to other addresses in the work.cz domain as Mailcow would consider them all to be local addresses.

I guess Mailcow doesn‘t currently have a good solution for your scenario. You would basically want to combine external sender addresses with sender-dependent transports.

MightyPork commented 2 years ago

But it would prevent you from sending messages to other addresses in the work.cz domain as Mailcow would consider them all to be local addresses.

In the domain settings dialog, there is this field for relaying:

Screenshot_20220126_092843

could that prevent this behavior and push everything to smtp?

mkuron commented 2 years ago

That looks like it might actually work. Give it a try and let us know!