具有多个附件和加密的 UNIX 电子邮件
有没有一种方法(最好是一种简单、简洁的方法)在 UNIX 中从命令行发送带有多个加密附件的电子邮件?
这是在工作环境中,所以我犹豫要不要安装任何东西。
Is there a way (preferably a simple, concise way) to send an email from the command line in UNIX with multiple encrypted attachments?
This is in a workplace environment, so I am hesitant to install anything.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
命令行工具
openssl
通常已安装在大多数类 UNIX 服务器上。它有点像一把加密瑞士军刀。它的openssl smime
实用程序允许您创建 S/ MIME 标准加密和/或签名邮件。The command-line tool
openssl
is usually already installed on most UNIX-like servers. It is something of a cryptographic swiss-army knife; itsopenssl smime
utility allows you to create S/MIME standard encrypted and/or signed mail.假设您有两个加密文件 file1.pgp file2.pgp (编辑:uuencode -> uuencode -m)
Tar 并邮寄它们
收件人将需要一些东西来打开 tar 容器:windows 7zip 等。您也可以压缩文件。 gzip 将无法工作。
如果文件未加密,您可以使用 zip 进行加密和密码保护。
从某种意义上说,这是不安全的,因为某些人可以看到您在 unix 机器上使用 ps 命令输入的密码。
编辑:十二月 26120120
Assume you have two encrypted files file1.pgp file2.pgp (edit: uuencode -> uuencode -m)
Tar and mail them
The recipient will need something to open the tar container: windows 7zip, etc. You can also zip the files. gzip will not work.
If the files are not encrypted you can encrypt and password protect with zip
This is not secure in the sense that some can see you enter the password with the ps command on the unix box.
edit: Dec 26120120
我讨厌提供这个作为答案,因为它和摩西一样古老,甚至可能更过时,但我使用 nmh 此类事情的命令系统。
它非常深奥,但你可以用它构建几乎任何你想要的东西。它甚至可能已经安装在您的系统上,我怀疑这将是一个好处。
我毫不怀疑有无数更新、更灵活、更时髦、更精彩的系统可以满足此类需求。我只是不认识他们。我在该系统下访问了大约 25 年积累的电子邮件,并且在该系统上编写了数十个应用程序以实现定制的小方法。
我仍然使用
vi
来编辑回复邮件,并在终端窗口中阅读邮件。我仍然保留着在perl
发明之前使用过的脚本。这就是多么古老的事啊。我第一次使用它是在 80 年代初或中期。除了/usr/ucb/Mail
之外,我不记得它之前的任何内容。编写一个sh
或perl
脚本将 MH 命令粘合在一起以准确完成您所要求的操作是很容易的。不过,我不希望其他人有 MH。我妈妈设法应付了这个问题,但她自己就是一个 vi 用户,并且比我学习了更多的汇编语言。除了她之外,我不知道是否还能数出六个仍然使用 MH 发送邮件的朋友。
不过,它确实有一个好处:您永远、永远、永远不会被任何试图欺骗您陷入网络钓鱼攻击的人欺骗,因为您总是将 HTML 邮件视为纯文本最初(至少我是这样设置的),所以你立即会发现链接很奇怪。
I hate to offer this as an answer because it’s as old as Moses and probably even more out of date, but I use the nmh system of commands for this sort of thing.
It’s incredibly abstruse, but you can build most anything you want out of it. It might even already be installed on your system, which I suspect would be a benefit.
I have no doubt there are infinitely many newer, slicker, hipper, and more wonderful systems out there for this sort of thing. I just don’t know them. I’ve got some 25 years worth of accumulated email that I access under this system, and I’ve written dozens of applications on top of it for customized little approaches.
I still answer mail using
vi
to edit, and I read mail in a Terminal window. I still have scripts around I used from back beforeperl
was even invented. That’s how ancient this is. I first started using it in early or mid-80s. I can’t remember anything before it except perhaps/usr/ucb/Mail
. It would be easy to write ansh
orperl
script that glues together MH commands to do exactly what you’re asking for.I wouldn’t wish MH on anybody else, though. My mom manages to cope with it, but she’s a
vi
user herself and has studied more assembly language than I have. Beyond her, I don’t know if I can count a half-dozen friends who still use MH for their mail.It does have one thing going for it, though: you’ll never, ever, ever get spoofed by anybody trying to dupe you into falling for a phishing exploit, because you always eyeball even HTML mail as plaintext initially (at least that’s how I have it set up), so you immediately see that the links are wacky.