The query should be returning any of the "aliases" (email addresses),

I think our confusion lies in our understanding of the word alias. You just said it should return the aliases. I believe this to be wrong. It should return the SASL username that the user is logged in as.

Example;

I have an email u...@example.com, to send an email i have to login to the IMAP client with u...@example.com. I create an alias by adding al...@example.com to a table which is read by virtual_alias_maps. This table has al...@example.com -> u...@example.com.

   u...@example.com is the username.
   al...@example.com is the alias.

The query for reject_sender_login_mismatch would be sending the alias al...@example.com as %s to the query and expecting to get back a list of usernames such as u...@example.com so it can match one of those returned usernames against the username logged in to the IMAP client.

   SELECT username FROM table WHERE alias='%s'

So when you say "The query should be returning any of the aliases" this is wrong in my understanding of English. You are supplying the alias %s and the query is returning usernames.

I know we are saying the same thing, it appears our choice of words and their meanings differ. The difference is i have the ability to read what you have said, comprehend the meaning behind it to understand what you mean and not nitpick the words out of context.


Your response seemed to indicate that the SASL login as the lookup key,
and an email address as the result.

I used email/username interchangeability and indicated that in my email. While I know it is not the ONLY way, it is a common way, that users login using their email address as their username. So yes, the returned result is an email address, the user's email address, their username, that they are logged in as. I never said the lookup was SASL login, I said lookup was an alias and return result was email/username.


Well, but the query has no access to the user name the user is logged
as, because that's not the lookup key.  The lookup key is a the sender
address, and so there's no choice but to return them all.

Yes we all know this, no one disputed it, not the OP or myself. This is why i have repeatedly said you send the alias %s to the query and the query returns the usernames allowed to use that alias. But your choice of words here "no choice but to return them all", return them all? All of the sender addresses in the database? Why would you do that? Then anyone can send any email as any user :) While i KNOW what you meant, it is NOT what you said. Shall we hold you to the same standard?

I don't want this to become bitter. I was just annoyed to being implied stupid and that I'm wrong when we are both saying the same thing and i feel as if you didn't comprehend what i was saying. It would have been different if you just would have added that returned usernames can be more than one result as I can see that part needed clarifying. But nothing else i said was wrong. And I'm not sure why you keep saying the query should return aliases. That is wrong :)

Reply via email to