linux 原生系统发送电子邮件 (在本地与因特网)
有用的资料在 Linux mail 命令
http://www.cnblogs.com/JemBai/archive/2012/01/24/2329136.html
还有这里 Linux系统下mail命令使用
http://www.php100.com/html/webkaifa/Linux/2009/0315/6309.html (介绍的挺详细的)
可是上面的链接都没有说是怎么打开邮件代发服务的。所以在很大程度上,不是一个傻瓜教程。
针对我的系统 linuxmint 13 , ubuntu 12.04 的衍生版,我准备采用这种方法
一般准备开始使用的时候会遇到下面这样的问题

发现不在/usr/lib/sendmail 下面,那么用命令
find / -name sendmail -print
搜索了下,原来在 /usr/sbin/sendmail 中 (linuxmint 13)
于是直接调用

结果还出现请安装MTA
于是在软件源里面又搜索了下MTA

搜索了一下,大致了解了一下MTA的意思, mail transport agent
然后又google一下,觉得大家会有多种MTA解决方案。比较常见的有postfix
然后看了下postfix的具体内容
alex@universe / $ apt-cache show postfix
Package: postfix
Priority: optional
Section: mail
Installed-Size:
Maintainer: LaMont Jones <lamont@debian.org>
Architecture: amd64
Version: 2.9.-~12.04.
Replaces: mail-transport-agent
Provides: default-mta, mail-transport-agent
Depends: libc6 (>= 2.14), libdb5., libsasl2- (>= 2.1.), libsqlite3- (>= 3.5.), libssl1.0.0 (>= 1.0.), debconf (>= 0.5) | debconf-2.0, netbase, adduser (>= 3.48), dpkg (>= 1.8.), lsb-base (>= 3.0-), ssl-cert, cpio
Recommends: python
Suggests: procmail, postfix-mysql, postfix-pgsql, postfix-ldap, postfix-pcre, sasl2-bin, libsasl2-modules, dovecot-common, resolvconf, postfix-cdb, mail-reader, ufw, postfix-doc
Conflicts: libnss-db (<< 2.2-), mail-transport-agent, smail
Filename: pool/main/p/postfix/postfix_2.9.6-~12.04.1_amd64.deb
Size:
MD5sum: b0f7d4d22db0931a3004aaaff0ba6804
SHA1: 9f5e22ece0f39eae298b535ff0a7d390a75401c1
SHA256: 0bbbe26a6298e282d948d61b71661014e9915cba3ccf3717e0a41e97f7441436
Description-en: High-performance mail transport agent
Postfix is Wietse Venema's mail transport agent that started life as an
alternative to the widely-used Sendmail program. Postfix attempts to
be fast, easy to administer, and secure, while at the same time being
sendmail compatible enough to not upset existing users. Thus, the outside
has a sendmail-ish flavor, but the inside is completely different.
Homepage: http://www.postfix.org
Description-md5: 98656fbf1bb45b53edd367037a2e5a90
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
Supported: 5y
Task: mail-server Package: postfix
Priority: optional
Section: mail
Installed-Size:
Maintainer: LaMont Jones <lamont@debian.org>
Architecture: amd64
Version: 2.9.-
Replaces: mail-transport-agent
Provides: default-mta, mail-transport-agent
Depends: libc6 (>= 2.14), libdb5., libsasl2-, libsqlite3- (>= 3.5.), libssl1.0.0 (>= 1.0.), debconf (>= 0.5) | debconf-2.0, netbase, adduser (>= 3.48), dpkg (>= 1.8.), lsb-base (>= 3.0-), ssl-cert, cpio
Recommends: python
Suggests: procmail, postfix-mysql, postfix-pgsql, postfix-ldap, postfix-pcre, sasl2-bin, libsasl2-modules, dovecot-common, resolvconf, postfix-cdb, mail-reader, ufw
Conflicts: libnss-db (<< 2.2-), mail-transport-agent, smail
Filename: pool/main/p/postfix/postfix_2.9.1-4_amd64.deb
Size:
MD5sum: e86312470d009f8001983a62c718c81d
SHA1: af26fc8133a5f1fdb357a1b923c5bee7c5f0a3cc
SHA256: 5bd0b17affa241e5c620f95629136d3dfd319553f4c3cb74fa83e598c9e87e43
Description-en: High-performance mail transport agent
Postfix is Wietse Venema's mail transport agent that started life as an
alternative to the widely-used Sendmail program. Postfix attempts to
be fast, easy to administer, and secure, while at the same time being
sendmail compatible enough to not upset existing users. Thus, the outside
has a sendmail-ish flavor, but the inside is completely different.
Homepage: http://www.postfix.org
Description-md5: 98656fbf1bb45b53edd367037a2e5a90
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
Supported: 5y
然后,准备安装postfix
sudo apt-get install postfix
会遇见下面的一个configuration of postfix

我们一般选择Internet site 就好了。

然后再选择

然后系统就开始自动安装了。
最后在系统安装信息的末尾,你能看到这个:
“
After modifying main.cf, be sure to run '/etc/init.d/postfix reload'.
Running newaliases
* Stopping Postfix Mail Transport Agent postfix [ OK ]
* Starting Postfix Mail Transport Agent postfix [ OK ]
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
”
上面说明MTA postfix服务已经在运行了

然后简单的,给本地用户发送一条mail,测试一下效果,采用方法如下:

看到

这时候再看看邮件内容是啥:

很好一目了然。是这样的邮件。
分析: 如果在发送邮件的时候,我们多加一些邮件选项,比如说Cc Bcc Forward Reply 等等,或者直接发送HTML代码格式的邮件,这样将更有说服力。
好了,上面的邮件发送只是本地邮件发送,我们现在需要来真格的,要看看在线发送到Internet的邮件服务!
这个先留下一会儿,我先去睡个觉。。
——————————————————分割线 07:03 A.M. 1st Augest————————————————————————
linux 原生系统发送电子邮件 (在本地与因特网)的更多相关文章
- linux通过使用mail发送电子邮件
通过外部方法发送的电子邮件 bin/mail默认为本地sendmail发送电子邮件,求本地的机器必须安装和启动Sendmail服务.配置很麻烦,并且会带来不必要的 资源占用.而通过改动配置文件能够使用 ...
- 孤荷凌寒自学python第六十一天在Fedora28版的linux系统上找搭建本地Mongodb数据服务
孤荷凌寒自学python第六十一天在Fedora28版的linux系统上找搭建本地Mongodb数据服务 (完整学习过程屏幕记录视频地址在文末) 今天是学习mongoDB数据库的第七天.成功在本地搭建 ...
- 使用php发送电子邮件(phpmailer)
在项目开发过程中,经常会用到通过程序发送电子邮件,例如:注册用户通过邮件激活,通过邮件找回密码,发送报表等.这里介绍几种通过PHP发送电子邮件的 方式(1)通过mail()函数发送邮件(2)使用fso ...
- Linux常用系统函数
Linux常用系统函数 一.进程控制 fork 创建一个新进程clone 按指定条件创建子进程execve 运行可执行文件exit 中止进程_exit 立即中止当前进程getdtablesize 进程 ...
- Servlet 发送电子邮件
使用 Servlet 发送一封电子邮件是很简单的,但首先您必须在您的计算机上安装 JavaMail API 和 Java Activation Framework)JAF). 您可以从 Java 网站 ...
- 《Linux/UNIX系统编程手册》第56章 SOCKET:介绍
关键词: 1. socket基础 一个典型的客户端/服务器场景中,应用程序使用socket进行通信的方式如下: 各个应用程序创建一个socket.socket是一个允许通信的设备,两个应用程序都需要用 ...
- 【转帖】Linux 内核系统架构
Linux 内核系统架构 描述Linux内核的文章已经有上亿字了 但是对于初学者,还是应该多学习多看,毕竟上亿字不能一下子就明白的. 即使看了所有的Linux 内核文章,估计也还不是很明白,这时候 ...
- linux下系统对于sigsegv错误时的处理
一般来讲,对非法地址的访问会导致应用程序收到由系统发送的sigsegv信号,默认情况下,函数对于这个信号的处理是退出. 但是为了方便调试,我们可以自己设置处理函数,使用signal函数. 这里比较重要 ...
- Windows与Linux/Mac系统时间不一致的解决方法
Windows与Linux/Mac系统时间不一致的解决方法 分类: linux2012-02-12 14:25 1691人阅读 评论(1) 收藏 举报 windowsubuntusystemlinux ...
随机推荐
- C++外观设计模式模式(三)
3.外观模式总结 引入了外观类.解除了客户类与子系统的耦合性.客户类不须要直接操作子系统,而是由外观类负责处理,对client而言是透明的,客户类仅仅须要操作外观类就能够了,符合"迪迷特法则 ...
- mysql5.6.16绿色版配置、运行
原文:mysql5.6.16绿色版配置.运行 1.从该地址http://dev.mysql.com/downloads/mysql/中选择windows的版本,选择下载. 2.将下载的压缩包解压. 3 ...
- IIS 7.5 使用URL Rewrite模块简单设置网页跳转
原文 IIS 7.5 使用URL Rewrite模块简单设置网页跳转 我们都知道Apache可以在配置文件里方便的设置针对网页或网站的rewrite,但是最近接手了一组IIS服务器,发现这货简单的没有 ...
- javascritpt 原型链
// 基类 var BaseCalculator = function(){ this.decimalDigits = 2; }; // public BaseCalculator.prototype ...
- userAgent,JS这么屌的用户代理,你造吗?——判断浏览器内核、浏览器、浏览器平台、windows操作系统版本、移动设备、游戏系统
1.识别浏览器呈现引擎 为了不在全局作用域中添加多余变量,这里使用单例模式(什么是单例模式?)来封装检测脚本.检测脚本的基本代码如下所示: var client = function() { var ...
- Android接口测试-JUnit入门
1.下载:http://www.junit.org 2.配置AndroidManifest.xml,在application节点加入 <!--使用单元测试库--> <u ...
- [Node.js框架] 为什么要开发 Codekart 框架
两年前,在被php的$符号和字符串处理折磨得半夜骂娘之后,我义无反顾地决定:珍爱生命,远离php. 之后一直在寻找一门“完美的语言”,先后接触了Lisp.python.java.Ruby.Lisp几乎 ...
- Java 异常归纳总结
1.异常的分类 1) Checked exception: 这类异常都是Exception的子类 .异常的向上抛出机制进行处理,如果子类可能产生A异常,那么在父类中也必须throws A异常.可能导致 ...
- 学习使用简单的php
配置文件在:/etc/php5/$中,不同的模式含有自己的php.ini配置文件.php可以运行于多种模式:cgi.fastcgi.cli.web模块模式等4种: 我现在使用的模式是cli模式,这里进 ...
- Visual Studio 中的单元测试 UNIT TEST
原文:Visual Studio 中的单元测试 UNIT TEST 注:本文系作者原创,可随意转载,但请注明出处.如实在不愿注明可留空,强烈反对更改原创出处.TDD(Test-Driven Devel ...