I have configured it from the dashboard but I see that it only downloads me the INBOX folder. Of the other folders there is no trace. Where can I find the getmail configuration file so that it can be modified with “mailboxes = ALL”?
All IMAP retriever types also take the following optional parameters:
mailboxes (tuple of quoted strings) — a list of mailbox paths to retrieve mail from, expressed as a Python tuple. If not specified, the default is to retrieve mail from the mail folder named INBOX. You might want to retrieve messages from several different mail folders, using a configuration like this:
Note that the format for hierarchical folder names is determined by the IMAP server, not by getmail. Consult your server’s documentation or postmaster if you’re unsure what form your server uses. If your mailbox names contain non-ASCII characters, ensure that your getmailrc file is stored with UTF-8 encoding so that getmail can correctly determine the unicode character names that need to be quoted in IMAP’s modified UTF-7 encoding; if you do not do this, the mailbox names will not match what the server expects them to be, or will cause UnicodeErrors when attempting to load your getmailrc file. As a special case, in getmail version 4.29.0 and later, the unquoted base (non-tuple) value ALL (case-sensitive) means to retrieve mail from all selectable IMAP mailboxes in the account. To retrieve messages from all mailboxes, you would use:
Lory temo sia lo stesso problema che avevo io: "mailboxes = ALL " mi prelevava la posta da tutti i subfolders lato provider (inbox, sent, bozze, spam, etc…) ma mi salvava TUTTA la posta in INBOX lato server, invece di ricreare la stessa struttura. Per questo problema dovetti cambiare completamente sistema e rinunciare a nethserver.
Lory I fear it is the same problem that I had: “mailboxes = ALL” picked up the mail from all the subfolders on the provider side (inbox, sent, drafts, spam, etc …) but it saved/stored ALL the mail in INBOX folder nethserver side, instead to recreate the same structure. For this problem I had to completely change system and give up on nethserver.
ciao @Computer_Doctor , si non vedo la stessa struttura e penso che mi salvi tutto nella INBOX come mi segnali, dopo aver attivato “mailboxs = ALL” vedo un sacco di messaggi in entrata.
Eh peccato però, NS mi piace assai.
hello @Computer_Doctor , you do not see the same structure and I think it saves me everything in the INBOX as you signal me, after activating “mailboxs = ALL” I see a lot of incoming messages.
Too bad though, I like NS a lot.
Exactly, if you read my original post you will see that I had reported this problem some time ago and the answers were not helpful. In the meantime I have received notifications of improvements and implementations, but I fear that not much has changed in this regard. The only thing you should try / verify is the nomenclature of the folders (on the provider side and locally) … and possibly try to manually force the same structure locally (or use aliases). Obviously it is important that Dovecot is configured well otherwise it messes up.
Alternatively you could use a great Getmail or Impasync TOGETHER with Nethserver (even on separate or virtual machines) … it is certainly a hybrid and requires medium to high skills but it works and I have tried it for myself.
IMHO and theorycally: if there is an option to synchronize/fetch ALL folders, there must also be:
a) a function that recreates the folders locally
b) “something” (like rules) which establishes in which folder or sub-folder the mail is placed
IF you find A or B (and work on it) you’ve got the solution. But anyone here answered this so far.
You can actually do this if you use MDA_external and the %(mailbox) substitution. Note you can use getmail’s included mbox or maildir MDA scripts, you don’t have to use a 3rd-party one. You’ll have to ensure the destination maildirs or mbox files exist before trying to deliver to them, of course.
But if you’re looking for a single setting to just say “replicate the IMAP structure from there to here”, getmail isn’t designed to do that. There are other tools that are; some people mention imapsync.
I forgot to mention the other solution that I’ve used in the past. You can run getmail with multiple rc files; just specify the folders to retrieve from manually (rather than using ALL) and specify a different destination in each rc file.
type = Maildir
path = ~/Mail/hobbies/railroads/
mailboxes = (“work”, )
type = Maildir
path = ~/Mail/inbox/
… and then running getmail with multiple rc files.
the debian packaging for getmail actually includes such a wrapper shell script, called “getmails”.
you might be able to get dovecot sieve to read the folder name from the X-getmail-retrieved-from-mailbox header and file automatically creating missing folders as it goes. It would rely on some sieve extensions that I don’t use, so I’m not sure.