r-raymond / nixos-mailserver

A complete and Simple Nixos Mailserver
GNU General Public License v3.0
181 stars 27 forks source link

catchAll issue during sending #110

Closed tokudan closed 6 years ago

tokudan commented 6 years ago

When using the catchAll of a user, that user is not allowed to send from arbitrary email addresses from the given domains. It only works if an alias "@example.com" is added instead for the user.

SNM Version: v2.1.3

Nixos Version: 17.09

Relevant part of the config to reproduce:

mailserver = {
  domains = [ "example.com" ];
  loginAccounts = {
    "someone@example.com" = {
      catchAll = [ "example.com" ];
    };
};

What I expected to happen:

That user can send mails from "abc@example.com".

What happened:

SMTP submission error: 453 4.7.1 abc@example.com: Sender address rejected: not owned by user someone@example.com

Relevant journald log:

Apr 02 15:32:13 freya postfix/smtpd[3493]: NOQUEUE: reject: RCPT from unknown[2a02::8fe2]: 453 4.7.1 abc@example.com: Sender address rejected: not owned by user someone@example.com; from=abc@example.com to=somewhere_remote@example.net proto=ESMTP helo=

Note: I had soft_bounce enabled during the tests, so the regular error is probably 553 instead of 453.

r-raymond commented 6 years ago

This is by design. We could possibly add another sendAll option if this is something people want. Can you describe your usecase?

tokudan commented 6 years ago

There's no specific usecase, apart from my assumptions about catchAll and aliases. My assumption was that aliases was intended for full email addresses and catchAll for whole domains. But as they can be mixed in aliases... What's the actual point of having both? I assumed catchAll would also allow me to send emails with all sender addresses as well, as I use a whole domain for my emails (company A would get an email address like companya.com-12345678@example.com). If this only works for explicit aliases "@example.com", then that's fine for me and I'd just include that a notice in the documentation, so users actually see a difference between catchAll and aliases.