Closed regnull closed 2 years ago
Here's the problem. Currently, we strip all the internal addresses from the message before we pipe the message to sendmail. This is done to prevent sendmail from delivering messages to the ubikom recipients, because it will happily do just that. So, if we don't strip the internal addresses, the messages to internal recipients will be delivered twice, first time directly, and the second time via gateway. But if we strip the internal addresses, the external users receive weird messages addressed to no one (if we strip message from To header).
A solution would be to modify gateway receiver to ignore messages originating from Ubikom (because they are already delivered, bypassing gateway).
So, if bob@ubikom.cc sends message to alice@ubikom.cc, and CC to joe@gmail.com, message to alice is delivered directly. Gateway gets the message, and forwards it to sendmail as is. Sendmail sends it to postfix, which pipes it back to gateway. Gateway looks at it, says oh it's from bob@ubikom.cc, so I will just ignore it. Nice.
Which is incorrect... We are doing it to avoid piping emails to external users to the external mail client, but there must be a better way.