everyone. I have installed Postfix on a server with Aliases and Domains from a MySQL Database.
It is configured to forward some adresses to other Mail Accounts and also delivers some mails in local mailboxes that will be queried over a dovecot imap server.
For this example let there be two users:
forwarded@domain.com
what is a user that gets its mail just forwarded to let's sayforwarded@forwarded-host.com
local@domain.com
what is a user that accesses its mail from local IMAP.
Now, I want to fetch some Mails from another mailserver and handle them as if they were sent to a user of my Mailserver.
Lets say those corelations exist:
forwarded@domain.com
has two external accounts:user-a@externaldomain.com
anduser-a@some-other-company.com
local@domain.com
has also one external accountuser-b@externaldomain.com
The Problem is the new mails on that other Mailserver is not always in the inbox, it might be in subdirectories: mailinglists/all
or mailinglists/it
but also in mailinglists/some-other-department
which is not interesting and should not be delivered.
I already found a programm called fetchmail
but I cannot find how to fetch subdirectories or decide which subdirectories are fetched.