{"id":328,"date":"2013-08-09T16:18:21","date_gmt":"2013-08-09T16:18:21","guid":{"rendered":"cd00692c3bfe59267d5ecfac5310286c"},"modified":"2013-08-09T16:18:21","modified_gmt":"2013-08-09T16:18:21","slug":"","status":"publish","type":"post","link":"https:\/\/www.xiaobo.li\/notes\/archives\/328","title":{"rendered":"linux mail"},"content":{"rendered":"<p>\u5728Linux\u7cfb\u7edf\u4e0bmail\u547d\u4ee4\u7684\u6d4b\u8bd5<\/p>\n<p style=\"text-indent:2em;\">1. \u6700\u7b80\u5355\u7684\u4e00\u4e2a\u4f8b\u5b50\uff1a<\/p>\n<p style=\"text-indent:2em;\">&nbsp;mail -s test yangfang@fudan.edu.cn<\/p>\n<p style=\"text-indent:2em;\">\u8fd9\u6761\u547d\u4ee4\u7684\u7ed3\u679c\u662f\u53d1\u4e00\u5c01\u6807\u9898\u4e3atest\u7684\u7a7a\u4fe1\u7ed9\u540e\u9762\u7684\u90ae\u7bb1\uff0c\u5982\u679c\u4f60\u6709mta\u5e76\u4e14\u540e\u9762\u7684\u90ae\u7bb1\u4e0d\u4f1a\u6321\u8fd9\u79cd\u53ef\u80fd\u83ab\u540d\u5947\u5999\u7684\u4fe1\u7684\u65f6\u5019\uff0c\u5c31\u80fd\u6536\u5230\u8fd9\u5c01\u4fe1\u4e86\u3002\u5982\u679c\u4f60\u4e0d\u60f3\u88ab\u8fd9\u79cd\u4e71\u4e03\u516b\u7cdf\u7684\u4e8b\u60c5\u5e72\u6270\uff0c\u540e\u9762\u7684\u90ae\u7bb1\u8bf7\u4f7f\u7528\u672c\u5730\u5e10\u6237\u3002 \n<\/p>\n<p style=\"text-indent:2em;\">2. \u7b2c\u4e8c\u4e2a\u4f8b\u5b50\uff1a<\/p>\n<p style=\"text-indent:2em;\">&nbsp;\u4e09\u79cd\u5e38\u7528\u683c\u5f0f\u53d1\u4fe1<\/p>\n<p style=\"text-indent:2em;\">mail -s test yangfang@fudan.edu.cn #\u7b2c\u4e00\u79cd\u65b9\u6cd5\uff0c\u4f60\u53ef\u4ee5\u628a\u5f53\u524dshell\u5f53\u6210\u7f16\u8f91\u5668\u6765\u7528\uff0c\u7f16\u8f91\u5b8c\u5185\u5bb9\u540eCtrl-D\u7ed3\u675f<\/p>\n<p style=\"text-indent:2em;\">echo \u201cmail content\u201d|mail -s test yangfang@fudan.edu.cn #\u7b2c\u4e8c\u79cd\u65b9\u6cd5\uff0c\u6211\u7528\u7684\u6700\u591a\uff0c\u53ef\u80fd\u662f\u559c\u6b22\u7ba1\u9053\u7684\u7f18\u6545\u5427<\/p>\n<p style=\"text-indent:2em;\">mail -s test yangfang@fudan.edu.cn &lt; file #\u7b2c\u4e09\u79cd\u65b9\u6cd5\uff0c\u4ee5file\u7684\u5185\u5bb9\u4e3a\u90ae\u4ef6\u5185\u5bb9\u53d1\u4fe1<\/p>\n<p style=\"text-indent:2em;\">&nbsp;\u5176\u5b9e\u4f60\u5f88\u5bb9\u6613\u53d1\u73b0mail\u4ece\u6807\u51c6\u8f93\u5165\u8bfb\u53d6\u6587\u4ef6\u5185\u5bb9\u5e76\u53d1\u4fe1\uff0c\u6211\u4e5f\u53ea\u60f3\u8ba9\u4f60\u77e5\u9053\u8fd9\u4e00\u70b9\uff0c\u5230\u6b64\uff0c\u7b2c\u4e8c\u4e2a\u4f8b\u5b50\u7ed3\u675f\u3002<\/p>\n<p style=\"text-indent:2em;\">&nbsp;3. \u7b2c\u4e09\u4e2a\u4f8b\u5b50\uff0c\u5e26\u9644\u4ef6\u7684\u90ae\u4ef6<\/p>\n<p style=\"text-indent:2em;\">&nbsp;\u5982\u679c\u4f60\u7684\u7cfb\u7edf\u91cc\u6ca1\u6709uuencode\u547d\u4ee4\u7684\u8bdd\uff0c\u8bf7\u5148\u5b89\u88c5sharutils(yum install sharutils)<\/p>\n<p style=\"text-indent:2em;\">&nbsp;uuencode \u9700\u8981\u4e24\u4e2a\u53c2\u6570\uff0c\u7b2c\u4e00\u4e2a\u662f\u4f60\u8981\u53d1\u9001\u7684\u6587\u4ef6(\u4eec)\uff0c\u5f53\u7136\u8fd9\u4e2a\u4e5f\u53ef\u4ee5\u7528\u7ba1\u9053\u6765\u505a\uff0c\u7b2c\u4e8c\u4e2a\u662f\u663e\u793a\u7684\u6587\u4ef6\u540d<\/p>\n<p style=\"text-indent:2em;\">&nbsp;uuencode \/home\/yfang\/a.gif a.gif|mail -s pictest yangfang@fudan.edu.cn<\/p>\n<p style=\"text-indent:2em;\">tar czf - \/home\/yfang\/ | uuencode home.tgz |mail -s pictest yangfang@fudan.edu.cn<\/p>\n<p style=\"text-indent:2em;\">&nbsp;ps: \u987a\u4fbf\u8865\u4e00\u53e5\uff0cslackware\u4e0b\u7684mail\u597d\u50cf\u6709\u4e00\u4e2a-a\u53c2\u6570\uff0c\u53ef\u4ee5\u76f4\u63a5\u6dfb\u52a0\u9644\u4ef6\uff0c\u6211\u6ca1\u6709\u7528\u8fc7\u3002<\/p>\n<p style=\"text-indent:2em;\">\u8f6c\u81ea:http:\/\/www.svn8.com\/linux\/accidence\/20091016\/10858.html<\/p>\n<p>Linux\u4e0bMail\u547d\u4ee4\u6536\u96c62007-10-28 10:01\u7cfb\u7edf\u6536\u5230\u90ae\u4ef6\u90fd\u4f1a\u4fdd\u5b58\u5728\u201c\/var\/spool\/mail\/[linux\u7528\u6237\u540d]\u201d\u6587\u4ef6\u4e2d\u3002<br \/>\n\u5728linux\u4e2d\u8f93\u5165mail\uff0c\u5c31\u8fdb\u884c\u4e86\u6536\u4ef6\u7bb1\uff0c\u5e76\u663e\u793a\u4e8c\u5341\u5c01\u90ae\u4ef6\u5217\u8868\u3002<\/p>\n<p>\u6b64\u65f6\u547d\u4ee4\u63d0\u793a\u7b26\u4e3a\"&amp;\"<br \/>\nunread \u6807\u8bb0\u4e3a\u672a\u8bfb\u90ae\u4ef6<br \/>\nh|headers \u663e\u793a\u5f53\u524d\u7684\u90ae\u4ef6\u5217\u8868<br \/>\nl|list \u663e\u793a\u5f53\u524d\u652f\u6301\u7684\u547d\u4ee4\u5217\u8868<br \/>\n?|help \u663e\u793a\u591a\u4e2a\u67e5\u770b\u90ae\u4ef6\u5217\u8868\u7684\u547d\u4ee4\u53c2\u6570\u7528\u6cd5<br \/>\nd \u5220\u9664\u5f53\u524d\u90ae\u4ef6\uff0c\u6307\u9488\u5e76\u4e0b\u79fb\u3002 d 1-100 \u5220\u9664\u7b2c1\u5230100\u5c01\u90ae\u4ef6<br \/>\nf|from \u53ea\u663e\u793a\u5f53\u524d\u90ae\u4ef6\u7684\u7b80\u6613\u4fe1\u606f\u3002 f num \u663e\u793a\u67d0\u4e00\u4e2a\u90ae\u4ef6\u7684\u7b80\u6613\u4fe1\u606f<br \/>\nf|from num \u6307\u9488\u79fb\u52a8\u5230\u67d0\u4e00\u5c01\u90ae\u4ef6<br \/>\nz \u663e\u793a\u521a\u8fdb\u884c\u6536\u4ef6\u7bb1\u65f6\u7684\u540e\u9762\u4e8c\u5341\u5c01\u90ae\u4ef6\u5217\u8868<br \/>\nmore|p|page \u9605\u8bfb\u5f53\u524d\u6307\u9488\u6240\u5728\u7684\u90ae\u4ef6\u5185\u5bb9 \u9605\u8bfb\u65f6\uff0c\u6309\u7a7a\u683c\u952e\u5c31\u662f\u7ffb\u9875\uff0c\u6309\u56de\u8f66\u952e\u5c31\u662f\u4e0b\u79fb\u4e00\u884c<br \/>\nt|type|more|p|page num \u9605\u8bfb\u67d0\u4e00\u5c01\u90ae\u4ef6<br \/>\nn|next|{\u4ec0\u4e48\u90fd\u4e0d\u586b} \u9605\u8bfb\u5f53\u524d\u6307\u9488\u6240\u5728\u7684\u4e0b\u4e00\u5c01\u90ae\u4ef6\u5185\u5bb9<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp; \u9605\u8bfb\u65f6\uff0c\u6309\u7a7a\u683c\u952e\u5c31\u662f\u7ffb\u9875\uff0c\u6309\u56de\u8f66\u952e\u5c31\u662f\u4e0b\u79fb\u4e00\u884c<br \/>\nv|visual \u5f53\u524d\u90ae\u4ef6\u8fdb\u5165\u7eaf\u6587\u672c\u7f16\u8f91\u6a21\u5f0f<br \/>\nn|next|{\u4ec0\u4e48\u90fd\u4e0d\u586b} num \u9605\u8bfb\u67d0\u4e00\u5c01\u90ae\u4ef6<br \/>\ntop \u663e\u793a\u5f53\u524d\u6307\u9488\u6240\u5728\u7684\u90ae\u4ef6\u7684\u90ae\u4ef6\u5934<br \/>\nfile|folder \u663e\u793a\u7cfb\u7edf\u90ae\u4ef6\u6240\u5728\u7684\u6587\u4ef6\uff0c\u4ee5\u53ca\u90ae\u4ef6\u603b\u6570\u7b49\u4fe1\u606f<br \/>\nx \u9000\u51famail\u547d\u4ee4\u5e73\u53f0\uff0c\u5e76\u4e0d\u4fdd\u5b58\u4e4b\u524d\u7684\u64cd\u4f5c\uff0c\u6bd4\u5982\u5220\u9664\u90ae\u4ef6<br \/>\nq \u9000\u51famail\u547d\u4ee4\u5e73\u53f0,\u4fdd\u5b58\u4e4b\u524d\u7684\u64cd\u4f5c\uff0c\u6bd4\u5982\u5220\u9664\u5df2\u7528d\u5220\u9664\u7684\u90ae\u4ef6\uff0c\u5df2\u9605\u8bfb\u90ae\u4ef6\u4f1a\u8f6c\u5b58\u5230\u5f53\u524d\u7528\u6237\u5bb6\u76ee\u5f55\u4e0b\u7684mbox\u6587\u4ef6\u4e2d\u3002\u5982\u679c\u5728mbox\u4e2d\u5220\u9664\u6587\u4ef6\u624d\u4f1a\u5f7b\u5e95\u5220\u9664\u3002<br \/>\n\u5728linux\u6587\u672c\u547d\u4ee4\u5e73\u53f0\u8f93\u5165 mail -f mbox\uff0c\u5c31\u53ef\u4ee5\u770b\u5230\u5f53\u524d\u76ee\u5f55\u4e0b\u7684mbox\u4e2d\u7684\u90ae\u4ef6\u4e86\u3002<br \/>\ncd \u6539\u53d8\u5f53\u524d\u6240\u5728\u6587\u4ef6\u5939\u7684\u4f4d\u7f6e<br \/>\n\u5199\u4fe1\u65f6\uff0c\u8fde\u6309\u4e24\u6b21Ctrl+C\u952e\u5219\u4e2d\u65ad\u5de5\u4f5c\uff0c\u4e0d\u9001\u6b64\u4fe1\u4ef6\u3002<br \/>\n\u8bfb\u4fe1\u65f6\uff0c\u6309\u4e00\u6b21Ctrl+C\uff0c\u9000\u51fa\u9605\u8bfb\u72b6\u6001\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>---------------------<\/p>\n<p><strong>\u9700\u8981\u7684\u914d\u7f6e<\/strong><\/p>\n<p>\u914d\u7f6e\u65b0\u7248mailx\u4f7f\u7528\u5916\u90e8\u90ae\u7bb1\u53d1\u9001\u90ae\u4ef6\uff1a<\/p>\n<div>&nbsp;<\/div>\n<div>&nbsp; &nbsp; &nbsp; \u7f16\u8f91\/etc\/nail.rc(\u6ce8\u610f\u4e0d\u662f\u65e7\u7248\u7684\/etc\/mail.rc)\uff1avi \/etc\/nail.rc<\/div>\n<div>&nbsp;<\/div>\n<div>&nbsp; &nbsp; &nbsp; \u6dfb\u52a0\u4e24\u884c\uff1a<\/div>\n<div>&nbsp;<\/div>\n<div>set from=myname@qq.com smtp=smtp.qq.com<\/div>\n<div>set smtp-auth-user=myname smtp-auth-password=password smtp-auth=login<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u5728Linux\u7cfb\u7edf\u4e0bmail\u547d\u4ee4\u7684\u6d4b\u8bd5<\/p>\n<p style=\"text-indent:2em;\">1. \u6700\u7b80\u5355\u7684\u4e00\u4e2a\u4f8b\u5b50\uff1a<\/p>\n<p style=\"text-indent:2em;\">&nbsp;mail -s test yangfang@fudan.edu.cn<\/p>\n<p style=\"text-indent:2em;\">\u8fd9\u6761\u547d\u4ee4\u7684\u7ed3\u679c\u662f\u53d1\u4e00\u5c01\u6807\u9898\u4e3atest\u7684\u7a7a\u4fe1\u7ed9\u540e\u9762\u7684\u90ae\u7bb1\uff0c\u5982\u679c\u4f60\u6709mta\u5e76\u4e14\u540e\u9762\u7684\u90ae\u7bb1\u4e0d\u4f1a\u6321\u8fd9\u79cd\u53ef\u80fd\u83ab\u540d\u5947\u5999\u7684\u4fe1\u7684\u65f6\u5019\uff0c\u5c31\u80fd\u6536\u5230\u8fd9\u5c01\u4fe1\u4e86\u3002\u5982\u679c\u4f60\u4e0d\u60f3\u88ab\u8fd9\u79cd\u4e71\u4e03\u516b\u7cdf\u7684\u4e8b\u60c5\u5e72\u6270\uff0c\u540e\u9762\u7684\u90ae\u7bb1\u8bf7\u4f7f\u7528\u672c\u5730\u5e10\u6237\u3002 \n<\/p>\n<p style=\"text-indent:2em;\">2. \u7b2c\u4e8c\u4e2a\u4f8b\u5b50\uff1a<\/p>\n<p style=\"text-indent:2em;\">&nbsp;\u4e09\u79cd\u5e38\u7528\u683c\u5f0f\u53d1\u4fe1<\/p>\n<p style=\"text-indent:2em;\">mail -s test yangfang@fudan.edu.cn #\u7b2c\u4e00\u79cd\u65b9\u6cd5\uff0c\u4f60\u53ef\u4ee5\u628a\u5f53\u524dshell\u5f53\u6210\u7f16\u8f91\u5668\u6765\u7528\uff0c\u7f16\u8f91\u5b8c\u5185\u5bb9\u540eCtrl-D\u7ed3\u675f<\/p>\n<p style=\"text-indent:2em;\">echo \u201cmail content\u201d|mail -s test...<\/p>\n<p> <a href=\"https:\/\/www.xiaobo.li\/notes\/archives\/328\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[287],"tags":[85],"class_list":["post-328","post","type-post","status-publish","format-standard","hentry","category-linux","tag-mail"],"_links":{"self":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts\/328","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/comments?post=328"}],"version-history":[{"count":0,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts\/328\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/media?parent=328"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/categories?post=328"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/tags?post=328"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}