In /etc/courier/aliases/users I've added a line like this:
@<domain2>: user@<domain1>
You're missing a step. What this syntax means is that when a message arrives
for joe@domain2 then it will be delivered to user-joe@domain1. You need to
include instructions in the "user@domain1" account which tell courier what to
do with that address or it will be rejected.
Hmm, okay, but I've just one system user that accepts mails (called
maildrop). I'm using virtual users with virtual domains. Mails for
user@<domain1> will be accepted by courier, if the email address is in
the mysql database. Users login to IMAP and POP3 using this email
address, maildir and a password also saved in the database. Every
incoming message will be delivered by maildrop to the user maildrop. The
filter itself uses HOST and LOCAL variable to determinate the location
<maildrop-homedir>/<domain>/<user>/Maildir (because my maildrop doesn't
use the maildir table-column from the database - it never calls the
mysql database. I don't know why not - but that is another question).
If I want to deliver any mail from <domain2> to a virtual user, do I
have to put the .courier-* file into the <maildir-home> directory? But
what "user" I have to save in /etc/courier/aliases? maildrop? And then -
how do I tell courier to accept messages for that user? I'm using the
email addesses as user-account-names.
I've tried /etc/courier/aliasdir/.courier-default with no content
(default delivery) and a | /usr/bin/maildrop but both results in a bad
command syntax error in syslog. How to I tell the system to forward
emails for *@<domain2> to another email address.
Read the "Virtual Domains" section of the makealiases man page to see exactly
how this works. Basically if you want "postmaster@domain2" to be accepted
and delviered then you need to create a ".courier-postmaster" file in the
HOME directory for "user" whch tells courier what to do with mail for that
address. You can also use a .courier-default file in the user account which
tells courier what to do with mail that doesn't match anything else. So if
you put "./Maildir" into a .courier-default file for "user" then ALL mail
@domain2 would be accepted and stored in user's INBOX.
Jeff Jansen