I have set up a Postfix mail server which uses Courier in order to provide an SMTP service. On my server there is a user called joe
.
I used alias maps to make mail to [email protected]
redirect to joe
using test: joe
in my /etc/aliases
. Seeing as there is just one email address and one domain, I don't want to use MySQL to manage aliases as this seems to be a massive overkill for my scenario.
I have two questions...
People can send mail to
[email protected]
as well as[email protected]
and it will still go to the accountjoe
. I don't particularly want this, primarily as I am worried people could start spamming system user accounts. Is there a way to disable this?When I use Courrier-IMAP to login to IMAP, is there a way I can login with
test
or[email protected]
as my username rather thanjoe
? I would not like to create a user calledtest
if at all possible.
Thanks :)
About your 1st question, if you already set test to go to joe then it will go to joe, as you made test an alias to joe and joe is the main account. You must make a new user name for test if you wanted it to be an account and not just an alias.
If you want to disable test, then redirect it to nobody
test: nobody
and nobody change it fromnobody: root
tonobody: /dev/null
.And about your 2nd question you can't login with an alias as it has no password, and it's not an account. The alias only redirects to an account that have a user name and password.
I think part of the confusion is around the role of an alias: AFAIK, the concept of the alias is that both the aliased and 'real' inboxes work.
If you want
test
without exposingjoe
, create an inbox for test, but not for joe.You could, I guess, create some config to manually reject emails to
joe
other than those coming from your own domain, but that seems a complicated and fragile way of getting what you want.Not completely sure if Courier can do it, but I know dovecot allows you to set up 'public' or shared inboxes, which might be a better fit for what you seem to be trying to do.
Edit:
Thinking about it, you could abuse domains to achieve what you want: have postfix accept incoming email for (e.g.) example.com, and alias to secret.example.com/example.local (or whatever seems reasonable to you).
So long as your server doesn't accept emails to example.local other than from itself, I think that could do what you are hoping to do.
Well, you can use mailfilter to move to trash all the mail destinated to [email protected]