vexim / vexim2

Virtual Exim 2
Other
70 stars 47 forks source link

No passwordcheck for relay-domains #214

Closed Udera closed 8 years ago

Udera commented 8 years ago

Fix for #211

alias-domains are inserted in a completely different table, therefore the split. Indeed we only need passwords for a new local domain, and there was a default password set. Now I changed it to verify passwords only for local domains.

Udera commented 8 years ago

That's the problem if you want to make it too short and elegant ;-)

rimas-kudelis commented 8 years ago

Line 140 should be changed to simple else, and lines 153-154 should be moved below this condition.

😒

Udera commented 8 years ago

I missed that, will do it tonight.

Udera commented 8 years ago

Instead of

if ($_POST !== "alias") ...
elseif ($_POST === "alias") ...
else ...

We just use:

if ($_POST === "alias) ...
else ....
Udera commented 8 years ago

Fixed the error message.

The ampersand in the URL seem to be allright: https://github.com/vexim/vexim2/pull/214#discussion_r77436532

Udera commented 8 years ago

There is an if()-loop from line 119 (checking on db-insert for new domain) and the header is reached when this fails (in between is a second db-query creating the postmaster-user). The die is useless.

rimas-kudelis commented 8 years ago

Ah, I see now. It would have been more obvious if the last header() line was swapped with the preceding closing curly brace though, but this is not necessary.

Anyway, please unescape the ampersand. HTTP headers are NOT same as HTML content, so they need no escaping. The link you gave seems irrelevant in our context.

Udera commented 8 years ago

I added the changes.

rimas-kudelis commented 8 years ago

Thank you!