简体   繁体   English

设置MRA(fetchmail / getmail)以通过POP / IMAP从Gmail中提取所有文件夹

[英]Setting up a MRA (fetchmail/getmail) to pull all folders from Gmail over POP/IMAP

I would like to setup fetchmail or getmail to pull email from Gmail. 我想设置fetchmail或getmail来从Gmail中提取电子邮件。 I would prefer it to be IMAP but I can live with POP as well. 我希望它是IMAP,但我也可以使用POP。 The issue I'm running into is that all these seem to want you to specify the exact list of folders you want checked (this is cleaner in IMAP than POP). 我遇到的问题是,所有这些似乎都要求您指定要检查的文件夹的确切列表(这在IMAP中比POP更干净)。

This is a hassle since I frequently change my list of folders and when I do, I don't want to have to change my configuration file to add/remove folders. 这是一个麻烦,因为我经常更改我的文件夹列表,当我这样做时,我不想更改我的配置文件来添加/删除文件夹。 When something changes, I automatically want a mbox or a maildir directory to 'show up' with the contents of my new folder. 当某些内容发生变化时,我会自动希望mbox或maildir目录“显示”我的新文件夹的内容。 I would also prefer the mbox to have the same name as the folder on the server 我还希望mbox与服务器上的文件夹具有相同的名称

The closest thing I could find was the -r option in fetchmail but that doesn't seem to do this either. 我能找到的最接近的东西是fetchmail中的-r选项,但似乎也没有这样做。 I'm sure I must be missing something since every email client is able to do this and I'm hoping that that functionality lives inside the MRA and not in the MUA. 我确信我必须遗漏一些东西,因为每个电子邮件客户端都能够做到这一点,我希望这个功能存在于MRA中而不是MUA中。

Update: I'd like to move this thread to Serverfault and I'm ok with voting to close this and migrate. 更新:我想将此线程移至Serverfault,我可以通过投票来关闭它并进行迁移。 Unfortunately, I dont have the rep to do it myself yet 不幸的是,我还没有代表自己做

With getmail you can use the following line in your configuration to get all your mail : 使用getmail,您可以在配置中使用以下行来获取所有邮件:

mailboxes = ("[Google Mail]/All Mail",)

With IMAP you can list the folders on the server, that way email clients can do whatever they need. 使用IMAP,您可以列出服务器上的文件夹,这样电子邮件客户端就可以做任何他们需要的事情。 In getmail it depends on how the email retrievers are written. 在getmail中,它取决于电子邮件检索器的编写方式。 If this configuration does not work, you can check the IMAP retriever code and write a specific one that suits your needs ;-) 如果此配置不起作用,您可以检查IMAP检索器代码并编写适合您需要的特定代码;-)

my 2 cents 我的2美分

PS: I have no getmail installation to check if that do the trick ... PS:我没有安装getmail来检查是否有诀窍......

You could look into imapsync . 你可以看看imapsync It is designed to recursively sync up IMAP accounts. 它旨在递归地同步IMAP帐户。 You will need an IMAP account for the destination. 您将需要一个目的地的IMAP帐户。 I have not tested it with gmail but if gmail is a well behaved IMAP server it should work. 我没有用gmail测试它,但如果gmail是一个表现良好的IMAP服务器它应该工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM