首页 \ 问答 \ 如何从Gmail下载许多电子邮件附件(How to download many email attachments from gmail)

如何从Gmail下载许多电子邮件附件(How to download many email attachments from gmail)

我有一个设备,它将每日统计信息作为gmail电子邮件地址的附件发送。 过滤器标识发件人并将邮件隔离到邮箱中的文件夹中。 目前已累计约2000封电子邮件。 我需要下载这些附件,以便汇总和分析数据。 我想我可以写一个宏来移动鼠标,点击屏幕上的正确位置等等但是想知道是否有一种编程方式来简单地从文件夹中的所有电子邮件下载所有附件。


I have a device that sends daily statistics as an attachment to an email address at gmail. A filter identifies the sender and sequesters the mails into a folder in the mailbox. Currently ~2000 emails have accumulated. I need to download these attachments so the data can be aggregated and analyzed. I supposed I could write a macro to move the mouse, click the right places on the screen, etc. but was wondering if there is a programmatic way to simply download all the attachments from all the emails in a folder.


原文:https://stackoverflow.com/questions/37262556
更新时间:2022-03-11 22:03

最满意答案

[更新:从Go 1.8开始, GOPATH默认为$HOME/go ,但如果您想了解GOPATH布局,自定义等等,您可能仍然会发现这有用)

官方Go站点讨论了GOPATH以及如何布局工作区目录 。

export GOPATH="$HOME/your-workspace-dir/" - 在shell中运行它,然后将其添加到~/.bashrc或等效项,以便将来会为您设置。 Go将在src/bin/pkg/下安装包。 如果您想发布到GitHub,您可以将自己的软件包放在$GOPATH/src之下,如$GOPATH/src/github.com/myusername/ 。 您也可能希望在.bashrc export PATH=$PATH:$GOPATH/bin ,以便您可以在$GOPATH下运行编译的程序。

或者, 通过Rob Pike ,您还可以设置CDPATH以便在bash中打包export CDPATH=.:$GOPATH/src/github.com:$GOPATH/src/golang.org/x更快: export CDPATH=.:$GOPATH/src/github.com:$GOPATH/src/golang.org/x表示您可以键入cd net/html而不是cd $GOPATH/src/golang.org/x/net/html

Keith Rarick 指出,您可以设置GOPATH=$HOME ,将Go的src/pkg/bin/目录放在您的homedir下。 这可能很好(例如,您的路径中可能已经有$HOME/bin ),但当然有些人使用多个工作空间等。


[Update: as of Go 1.8, GOPATH defaults to $HOME/go, but you may still find this useful if you want to understand the GOPATH layout, customize it, etc.]

The official Go site discusses GOPATH and how to lay out a workspace directory.

export GOPATH="$HOME/your-workspace-dir/" -- run it in your shell, then add it to ~/.bashrc or equivalent so it will be set for you in the future. Go will install packages under src/, bin/, and pkg/, subdirectories there. You'll want to put your own packages somewhere under $GOPATH/src, like $GOPATH/src/github.com/myusername/ if you want to publish to GitHub. You'll also probably want export PATH=$PATH:$GOPATH/bin in your .bashrc so you can run compiled programs under $GOPATH.

Optionally, via Rob Pike, you can also set CDPATH so it's faster to cd to package dirs in bash: export CDPATH=.:$GOPATH/src/github.com:$GOPATH/src/golang.org/x means you can just type cd net/html instead of cd $GOPATH/src/golang.org/x/net/html.

Keith Rarick notes you can set GOPATH=$HOME to put Go's src/, pkg/ and bin/ directories right under your homedir. That can be nice (for instance, you might already have $HOME/bin in your path) but of course some folks use multiple workspaces, etc.

相关问答

更多
  • 不要用 sudo ,OS X 下我一般是直接在当前目录下用的,不设置 GOPATH ,现用现设。 $ GOPATH=`pwd` go get github.com/revel/revel
  • 从Go 1.8开始,默认的GOPATH值是/ go。 GOPATH是你的源代码将会存在的地方。 您可以使用默认的或使用自定义的,例如,我使用D:\ go。 IDE没有检测到GOPATH,因为没有设置。 当你下载Go时,你也会看到安装说明,请看看这个。 As of Go 1.8, the default GOPATH value is /go. GOPATH is where your source code will live. You can either use the default one or u ...
  • 碰到同样的问题。 修复很简单:只需在整个路径名前面指定驱动器即可。 发生此问题是因为我按照Go“入门”页面上的说明进行操作,并设置了GOPATH=%HOMEPATH%\Work 。 问题在于%HOMEPATH%被定义为相对路径( \Users\MyName ),因此GOPATH现在指向\Users\MyName\Work 。 我需要做的就是设置GOPATH=c:\Users\MyName\Work并且错误消失。 Ran into same problem. Fix is quite simple: just ...
  • [更新:从Go 1.8开始, GOPATH默认为$HOME/go ,但如果您想了解GOPATH布局,自定义等等,您可能仍然会发现这有用) 官方Go站点讨论了GOPATH以及如何布局工作区目录 。 export GOPATH="$HOME/your-workspace-dir/" - 在shell中运行它,然后将其添加到~/.bashrc或等效项,以便将来会为您设置。 Go将在src/ , bin/和pkg/下安装包。 如果您想发布到GitHub,您可以将自己的软件包放在$GOPATH/src之下,如$GOP ...
  • 更新,从Go 1.8开始 :如果要安装Go 1.8(发布:2017年2月)或更高版本,则由GO工具链自动确定 GOPATH。 它默认为$HOME/go on macOS(nee OS X) - 例如/Users/matt/go/ 。 这使得开始使用Go更加容易,您可以在安装Go后立即go get 。 对于shell :(手动方法) 〜/ .bash_profile应该包含export GOPATH=$HOME/go并且还export PATH=$GOPATH/bin:$PATH 。 使用 ...
  • 只要编译器知道在哪里找到它,$ GOPATH就可以是你选择的任何位置(除了少数例外)。 如果您更改它,请确保使用更新路径 export GOPATH=/path/to/gopath 我个人的偏好是保持$ GOPATH与我的代码分开,除非我正在编写一个意图通过go get 导入的包,在这种情况下我将编写代码 $GOPATH/src/ 当你使用go get 时,这是包存储的标准位置 $GOPATH can really be any locati ...
  • sudo go get github.com/go-sql-driver/mysql 这个运行在root用户下运行,没有设置$GOPATH 。 做就是了: go get github.com/go-sql-driver/mysql 一般来说,做: go get 在项目文件夹中,它将安装所有依赖项。 以下将安装测试中提到的依赖项: go get -t sudo go get github.com/go-sql-driver/mysql This runs go get under root user ...
  • 正如上述评论者所说,你不应该使用sudo和go get 。 当您这样做时,您拥有root用户的环境(没有您的GOPATH),并且您创建的任何文件或目录都不会被您的用户编辑。 在过去, go get命令不会警告没有$GOPATH ,因此更容易被这个绊倒。 要修复权限,请运行以下命令将所有权更改回用户: sudo chown -R "$USER:" "$GOPATH" 您应该只需要运行一个普通的go get因为您可以(并且应该)将$GOPATH设置$GOPATH您可以控制的目录。 请务必阅读如何编写Go代码 ...
  • (2018年第二季度: 请注意,对于vgo项目 , GOPATH最终可能会被弃用,以支持基于项目的工作流。 这将避免GOPATH我在下面提出的基于项目的手动GOPATH ) 2016年6月:您不必仅依赖一个GOPATH (即一个工作区 )。 我的完整GOPATH包括: 一个全局路径(对于所有实用程序,如goimports ), github.com/smartystreets/goconvey $HOME/go github.com/smartystreets/goconvey $HOME/go githu ...
  • 事实证明,去检查文件“src / cmd / go / alldocs.go”以验证路径是goroot。 我打开了一个关于积极检查的问题 ,但它以“无法修复”的方式关闭。 至少它可以使用不同的错误消息,但这就是今天的工作方式 As it turns out, go get checks for the file "src/cmd/go/alldocs.go" to verify that the path is goroot. I opened an issue about the aggressive c ...

相关文章

更多

最新问答

更多
  • python的访问器方法有哪些
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。
  • 响应navi重叠h1和nav上的h1链接不起作用(Responsive navi overlaps h1 and navi links on h1 isn't working)
  • 在C中读取文件:“r”和“a +”标志的不同行为(Reading a File in C: different behavior for “r” and “a+” flags)
  • NFC提供什么样的带宽?(What Kind of Bandwidth does NFC Provide?)
  • 元素上的盒子阴影行为(box-shadow behaviour on elements)
  • Laravel检查是否存在记录(Laravel Checking If a Record Exists)
  • 设置base64图像的大小javascript - angularjs(set size of a base64 image javascript - angularjs)
  • 想学Linux 运维 深圳有哪个培训机构好一点
  • 为什么有时不需要在lambda中捕获一个常量变量?(Why is a const variable sometimes not required to be captured in a lambda?)
  • 在Framework 3.5中使用服务器标签<%=%>设置Visible属性(Set Visible property with server tag <%= %> in Framework 3.5)
  • AdoNetAppender中的log4net连接类型无效(log4net connection type invalid in AdoNetAppender)
  • 错误:发送后无法设置标题。(Error: Can't set headers after they are sent. authentication system)
  • 等待EC2实例重启(Wait for an EC2 instance to reboot)
  • 如何在红宝石中使用正则表达式?(How to do this in regex in ruby?)
  • 使用鼠标在OpenGL GLUT中绘制多边形(Draw a polygon in OpenGL GLUT with mouse)
  • 江民杀毒软件的KSysnon.sys模块是什么东西?
  • 处理器在传递到add_xpath()或add_value()时调用了什么顺序?(What order are processors called when passed into add_xpath() or add_value()?)
  • sp_updatestats是否导致SQL Server 2005中无法访问表?(Does sp_updatestats cause tables to be inaccessible in SQL Server 2005?)
  • 如何创建一个可以与持续运行的服务交互的CLI,类似于MySQL的shell?(How to create a CLI that can interact with a continuously running service, similar to MySQL's shell?)
  • AESGCM解密失败的MAC(AESGCM decryption failing with MAC)
  • SQL查询,其中字段不包含$ x(SQL Query Where Field DOES NOT Contain $x)
  • PerSession与PerCall(PerSession vs. PerCall)
  • C#:有两个构造函数的对象:如何限制哪些属性设置在一起?(C#: Object having two constructors: how to limit which properties are set together?)
  • 平衡一个精灵(Balancing a sprite)
  • n2cms Asp.net在“文件”菜单上给出错误(文件管理器)(n2cms Asp.net give error on Files menu (File Manager))
  • Zurb Foundation 4 - 嵌套网格对齐问题(Zurb Foundation 4 - Nested grid alignment issues)
  • 湖北京山哪里有修平板计算机的