OS X:发送邮件到本地主机 [英] OS X: sending mail to localhost
问题描述
出于测试目的,我希望将邮件发送到我的本地用户帐户,而不是我的网络服务器。我不确定如何使用mail.app这样做。任何帮助将不胜感激。
For testing purposes I want send mail to my localhost user account rather than my webserver. I am unsure how to do this using mail.app. Any help would be appreciated.
推荐答案
如果您不具体想使用Mail.app,可以使用 mail
命令。打开终端和
If you don't specifically want to use Mail.app, you can send mail using the mail
command. Open Terminal and:
mail -s "Testing" `whoami`@`hostname`
<type something>
Ctrl-D to finish and send
这些都是反引号,而不是单引号。 whoami
返回当前用户的用户名, hostname
返回本地计算机的主机名。它也可以是明确的:
Those are backticks, not single quotes. whoami
returns the current user's username and hostname
returns the local machine's hostname. It could also be explicit:
mail -s "Testing" john@mymac.local
编辑:只需阅读你的澄清。 Mail.app将它的数据存储在〜/ Mail中,主要在SQLite数据库(Envenlope Index文件)中。感兴趣的表格将是邮箱
和邮件
。电子邮件的文本存储在各个邮箱/文件夹目录中的各个文件中。如果您想要访问Mail.app(实时)提取的电子邮件,可能会是这样的方式。
Just read your clarification. Mail.app stores it's data in ~/Mail, mostly in an SQLite database (the 'Envenlope Index' file). The tables of interest would be mailboxes
and messages
. The text of the email is stored in individual files in the respective mailbox/folder directories. This would probably be the way to go, if you want to access email that has been fetched by Mail.app (in realtime).
另一种选择是导出你的邮件从Mail.app使用mbox格式,并使用dbr描述的技术访问它。根据是否需要实时访问,您可能可以编写自动导出的东西。
Yet another option would be to export your mail from the Mail.app using the mbox format and access it using the technique described by dbr. Depending on whether or not realtime access is desired, you might be able to script something up that automates the export.
这篇关于OS X:发送邮件到本地主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!