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 ...
随机推荐
- Quartz.NET 的任务调度管理工具
[更新] 基于Quartz.NET 的任务调度管理工具 更新列表: 任务参数可视化. 立即中断正在执行的任务. 每个任务独立的应用程序域 上一版参见: 基于Quqrtz.NET 做的任务调度管理工 ...
- 欧几里德欧几里德原理和扩展的原则,(Euclidean Theory and Extended Euclidean Theory)学习笔记
题记:这是我第四次审查扩展欧几里德原理,由于不经常使用.当你想使用,可以不记得细节,经常检查信息,所以,简单地梳理这一原则和扩展欧几里德的原则,以博客存档以备查用. 一个.欧几里德原理 欧几里德原理( ...
- Spring之使用Annotation注解开发项目
我们也可以使用Annotation来实现注入操作,提高我们写代码的灵活性和效率.spring中要使用annotation,需要在配置文件中增加: <beans xmlns="http: ...
- 第3章3节《MonkeyRunner源码剖析》脚本编写示例: MonkeyImage API使用示例(原创)
天地会珠海分舵注:本来这一系列是准备出一本书的,详情请见早前博文“寻求合作伙伴编写<深入理解 MonkeyRunner>书籍“.但因为诸多原因,没有如愿.所以这里把草稿分享出来,所以错误在 ...
- 在VS下用C语言连接SQLServer2008
原文:在VS下用C语言连接SQLServer2008 step1:启动SQLSERVER服务 step2:打建立数据库test,在test库中建立test表(a varchar(200),b varc ...
- ActionScript GifPlayer的修改
ActionScript不能播放gif格式的图片,在做as项目的时候如果需要用到加载gif动画图片时,就需要引入第三方包. 常用的第三方包是GifPlayer,在github上可以找到该项目的源代码C ...
- jquery 部分效果
$(selector).hide() 隐藏被选元素 $(selector).show() 显示被选元素 $(selector).toggle() ...
- June本地环境搭建
python-china.org论坛使用的June程序就是这货了,使用了Python Flask + SQLite + Node.js 的轻论坛,以后就打算拿这个学习了,如果可能,进行二次开发. Gi ...
- Android Studio设置自己主动编project
在Eclipse自己主动编译兄弟习惯,刚搬到Android Studio.当然,错过这个功能,自己主动编译每次执行意味着更短的时间. Android Studio里面事实上也是有自己主动编译功能的,只 ...
- HDU 5185 Equation (DP)
题目:LINK 题意:求满足题目要求的x序列的种类数. 能够发现符合条件的序列去重后是一个0, 1, ..., k的连续序列(k满足k*(k+1)/2 <= n) ,则这个去重后的序列长度最长为 ...