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 ...
随机推荐
- Android Bluetooth Stack: Bluedroid(五岁以下儿童):The analysis of A2DP Source
1. A2DP Introduction The Advanced Audio Distribution Profile (A2DP) defines the protocols and proced ...
- java设计模式之九外观模式(Facade)
外观模式是为了解决类与类之家的依赖关系的,像spring一样,可以将类和类之间的关系配置到配置文件中,而外观模式就是将他们的关系放在一个Facade类中,降低了类类之间的耦合度,该模式中没有涉及到接口 ...
- Asterisk 未来之路3.0_0004
原文:Asterisk 未来之路3.0_0004 Asterisk Wiki asterisk 的Wiki是很多启迪和困惑的发源地,另外一个最重要的VOIP知识库www.voip-info.org ...
- poj3744高速功率矩阵+可能性DP
Scout YYF I Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 4410 Accepted: 1151 Descr ...
- js 监控浏览器关闭事件
代码如下: <!DOCTYPE html> <html> <head> <title>监控浏览器关闭事件</title> </head ...
- Ajax实现在textbox中输入内容,动态从数据库中模糊查询显示到下拉框中
功能:在textbox中输入内容,动态从数据库模糊查询显示到下拉框中,以供选择 1.建立一aspx页面,html代码 <HTML> <HEAD> <title>We ...
- bash下几个替换运算符的区分
bash下几个替换运算符的区分 2012-03-21 22:20:54 分类: Python/Ruby 一直对四个替换运算符比较的迷惑,分布太清楚,记下来避免再次遗忘: ${name:-word} ...
- 使用LFM(Latent factor model)隐语义模型进行Top-N推荐
最近在拜读项亮博士的<推荐系统实践>,系统的学习一下推荐系统的相关知识.今天学习了其中的隐语义模型在Top-N推荐中的应用,在此做一个总结. 隐语义模型LFM和LSI,LDA,Topic ...
- 基于ffmpeg的C++播放器1
基于ffmpeg的C++播放器 (1) 2011年12月份的时候发了这篇博客 http://blog.csdn.net/qq316293804/article/details/7107049 ,博文最 ...
- ELF二进制目标文件详解
以下内容为<<linux内核编程>>笔记 链接程序 找出所有引用的外部模块并链接起来,这些外部模块或函数库一般来自于开发者,操作系统和C运行库. 链接程序取出这些函数库,修订指 ...