Folder sorting issue retrieving ALL IMAP mailboxes from external srv/account (getmail or dovecot config?)

NethServer Version: 7
Module: dovecot

Hallo,
I’d like to use Nethserver as a gateway/proxy to locally store/manage external mail accounts (like gmail) but I need to find the right way to fetch and sinc in/out both inbound and outbound folders on each account.

My first problem:
I saw getmail IMAP retrieve template can be personalized with option “mailboxes = ALL” and it works like a charm fetching all folders , BUT EVERY email fetched from external server is stored in Incoming folder instead of original folder (ex. INBOX.Sent is stored locally in Inbox folder, and so on), How do I fix this?

2.nd problem:
For each account/client I need to SMTP/relay outgoing emails so that the sent mail goes in the corresponding folder in the external mail server.

  • I can not use customer IP/direct SMTP because they are in black list
  • I can not configure external SMTP directly in the mail clients because the sent mail obviously would not be stored in the sent folder on the external server
  • Smarthost option does not seem to be the right solution.
    How can I solve?

Many thanks in advance.

My 2c: keep using gmail as usual and sync your local account with the remote one using imapsync
Otherwise you’ve to choose which one you want to use

As I read on Imapsync official site:

“imapsync is not suitable for maintaining a synchronization between two active imap accounts while the user is working on both sides”

They suggest offlineimap or mbsync, any experience with them?