Ubuntu 中sendmail 的安装、配置与发送邮件的具体实现

Ubuntu 中sendmail 的配置 ubuntu下sendmail的配置,经过ubuntu14.04测试好用 立即下载

from: http://mars914.iteye.com/blog/1470961 author: mars914

一、安装      

ubuntu中sendmail函数可以很方便的发送邮件,ubuntu sendmail先要安装两个包。

必需安装的两个包:

Java代码   收藏代码
  1. <span style="font-size: small;">sudo apt-get install sendmail  
  2. sudo apt-get install sendmail-cf</span>  

 

下面几个包是可选的:

Java代码   收藏代码
  1. <span style="font-size: small;">squirrelmail              //提供webmail          
  2. spamassassin          //提供邮件过滤  
  3. mailman                   //提供邮件列表支持  
  4. dovecot                   // 提供IMAP和POP接收邮件服务器守护进程  
  5. </span>  

 

 

注意:

  • Ubuntu下使用最常用的mail功能,需要安装mailutils,
  • 安装命令:sudo apt-get install mailutils  
  • 使用带附件的功能,则还需要安装sharutils,
  • 安装命令:sudo apt-get install sharutils;(yum install sharutils )

     

    终端输入命令:ps aux |grep sendmail
    输出如下:

    root     20978  0.0  0.3   8300  1940 ?        Ss   06:34   0:00 sendmail: MTA: accepting connections          
    root     21711  0.0  0.1   3008   776 pts/0    S+   06:51   0:00 grep sendmail

     

    说明sendmail 已经安装成功并启动了

     

     

    二、配置

     

     

    sendmail 默认只会为本机用户发送邮件,只有把它扩展到整个Internet,才会成为真正的邮件服务器。

     

    打开sendmail的配置宏文件:/etc/mail/sendmail.mc

     vi  /etc/mail/sendmail.mc

     

    找到如下行:

    Java代码   收藏代码
    1. <span style="font-size: small;">DAEMON_OPTIONS(`Family=inet,  Name=MTA-v4, Port=smtp, Addr=127.0.0.1')dnl</span>  

     修改Addr=0.0.0.0  ,表明可以连接到任何服务器。

     

    生成新的配置文件:

    Java代码   收藏代码
    1. <span style="font-size: small;">#cd /etc/mail  
    2. #mv sendmail.cf sendmail.cf~      //做一个备份  
    3. #m4 sendmail.mc > sendmail.cf   //>的左右有空格,提示错误没有安装sendmail-cf  
    4. </span>  

     

     

    三、测试发送邮件

     

    常用发送邮件方式如下:

        1.如何写一般的邮件: mail test@126.com  Cc 编辑抄送对象,Subject:邮件主题,输入回车,邮件正文后,按Ctrl-D结束

        2.快速发送方式: echo “邮件正文” | mail -s 邮件主题 test@126.com

        3.以文件内容作为邮件正文来发送: mail -s test test@126.com < test.txt

        4.发送带附件的邮件: uuencode 附件名称 附件显示名称 | mail -s 邮件主题 发送地址

           例如: uuencode test.txt test.txt | mail -s Test test@126.com

vos如何对接okcc(保姆级教程) 1.添加账户 点击 系统->账户管理 [图片] 2.创建费率 系统->费率管理 点击添加 阅读详情

相关推荐

从零到一:Mx_yolo本地训练与K210部署实战指南

本文详细介绍了从零开始进行Mx_yolo本地模型训练到K210部署的全流程实战指南。涵盖环境配置、数据准备、模型训练与调优、模型转换及K210部署等关键步骤,并提供了常见问题解决方案和性能优化技巧,帮助开发者高效完成AI模型在嵌入式设备的落地应用。

weixin_29081163的博客 251

ubuntu配置邮件服务器-sendmail

Ubuntu下配置邮件服务器

m0_56363537的博客 4412

ELK 企业级日志分析系统(1)

ELK平台是一套完整的日志集中处理解决方案,将、Logstash和Kiabana三个开源工具配合使用, 完成更强大的用户对日志的查询、排序、统计需求。ElasticSearch:是基于Lucene(一个全文检索引擎的架构)开发的分布式存储检索引擎,用来存储各类日志。Elasticsearch 是用 Java 开发的,可通过 RESTful Web 接口,让用户可以通过浏览器与 Elasticsearch 通信。

云计算运维工程师的成长之路 1864

Linux ubuntu发送邮件

Linux ubuntu发送邮件

YY_Share的博客 4815

Android双目摄像头(RGB+IR)实时预览与人脸活体检测实战指南

本文详细介绍了Android双目摄像头(RGB+IR)实时预览与人脸活体检测的实战指南。通过双摄同步预览、人脸检测与活体判断等技术实现,提升安全认证的准确性和鲁棒性。文章还提供了开发环境搭建、常见问题解决方案及性能优化建议,帮助开发者快速掌握双目摄像头在Android平台的应用。

vulkan6gpu的博客 686

[ vulhub漏洞复现篇 ] ActiveMQ反序列化漏洞复现(CVE-2015-5254)

Apache ActiveMQ是美国阿帕奇(Apache)软件基金会所研发的一套开源的消息中间件,它支持Java消息服务、集群、Spring Framework等。由于ActiveMQ是一个纯Java程序,因此只需要操作系统支持Java虚拟机,ActiveMQ便可执行。Apache ActiveMQ 5.13.0之前5.x版本中存在安全漏洞,该漏洞源于程序没有限制可在代理中序列化的类。......

qq_51577576的博客 4444

Ubuntu配置sendmail client,用sendmail命令来发送邮件

2、一般需要安装sendmail和m4 sendmail-cf,因为sendmail发送邮件时不需要邮件账号和密码,但是需要在/etc/mail/sendmail.mc中配置邮件服务器地址,再通过m4 sendmail.mc >sendmail.cf命令把邮件服务器地址编辑到sendmail.cf。3、配置sendmail服务器的这台需要发送邮件的机器,服务器名必须带上.XX.com类似这样的域名后缀,否则无法把邮件发出去并且会报错DSN: Service unavailable。

lusklusklusk的博客 739

【AI智能体】全场景AI智能体工作台WorkBuddy实战操作详解

全场景AI智能体工作台WorkBuddy实战操作详解

congge 5484

ubuntu发送使用sendmail发送邮件

一,安装邮件传输代理程序sudo apt-get install sendmail  sudo apt-get install sendmail-cf二, ubuntu下最常使用的是mail功能,需要安装mailutilssudo apt-get install mailutils还有几个可选包:squirrelmail # 提供webmail spamassassin # 提供邮件过滤 ma...

疯狂的浣熊的博客 4434

高斯过程的数学理解

G澳大利亚的过程是有益的,特别是当我们有少量数据时。当我在制造业担任数据科学家时,我们的团队使用这种算法来揭示我们接下来应该进行哪些实验条件。但是,此算法不如其他算法流行。在这篇博客中,我将通过可视化和 Python 实现来解释高斯过程 [1] 的数学背景。

gongdiwudu的专栏 3604

UWB芯片DW3000之PDOA测向实现源码

本文详细介绍如何基于UWB芯片DW3000之PDOA测向的源码实现。

DT程序员的博客 2613

Ubuntu 中sendmail 的安装、配置与发送邮件的具体实现

一、安装        ubuntu中sendmail函数可以很方便的发送邮件,ubuntu sendmail先要安装两个包。 必需安装的两个包: sudo apt-get install sendmail sudo apt-get install sendmail-cf   下面几个包是可选的: squirrelmail //提供webmail ...

mars914的专栏 732

Python爬虫教程:抓取纽约时报文章存档

爬虫技术主要用于从网站上抓取并提取数据。HTTP请求:使用requests库发送HTTP请求以获取网页。网页解析:使用或lxml库解析HTML网页。数据存储:将抓取的数据保存为CSV、JSON等格式,或者存储在数据库中。防反爬虫技术:模拟正常的用户请求,避免被反爬虫机制封锁。多线程与异步爬取:提高抓取效率。通过这篇博客,您已经学习了如何使用Python爬取纽约时报的历史文章存档。本文介绍了如何模拟请求头、抓取网页内容、解析HTML并提取数据,最后存储到CSV文件或数据库中。

2201_76125261的博客 592

Ubuntu中sendmail的安装、配置与发送邮件的具体实现

参考博客http://blog.youkuaiyun.com/xin_yu_xin/article/details/45115723因为生产需要,实现如下功能:Linux下监控磁盘使用量并在超过阀值后自动发送报警邮件(实现该功能请参考博客:http://www.heminjie.com/system/linux/1923.html)一、安装      ubuntu中sendmail函数可以很方便的发送邮件,u...

qq_34721505的博客 3441

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

ubuntu 安装sendmail功能 (实现邮件的发送)

在Linux下通过PHP的ubuntu sendmail函数可以很方便的发送邮件,可是微酷在安装ubuntu sendmail后却总接收不到邮件,搞了一晚上也还是糊涂着,虽然最后能成功接收了,不过还是晕。 ubuntu sendmail先要安装两个包 sudo apt-get install sendmail sudo apt-get install sendmail-cf这两个是必需的

Kris0x007的专栏 3674

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

ubuntu php.ini sendmail_path,ubuntu 安装sendmail功能 (实现邮件的发送)

在Linux下通过PHP的ubuntu sendmail函数可以很方便的发送邮件,可是微酷在安装ubuntu sendmail后却总接收不到邮件,搞了一晚上也还是糊涂着,虽然最后能成功接收了,不过还是晕。ubuntu sendmail先要安装两个包sudo apt-get install sendmailsudo apt-get install sendmail-cf这两个是必需的还有几个可选的s...

weixin_30696571的博客 340

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Linux下sendmail配置

linux下可以配置sendmail作为邮件服务器,可以使用系统用户作为账号进行发送邮件(不需要真实的邮箱账号)安装: sudo apt install sendmail 或 sudo yum install sendmailCentOS 配置root@ubuntu:~# cat /etc/mail/local-host-names # local-host-names - include al

Windeal 4260

Linux 命令行发邮件sendmail,mailutils,mutt msmtp

本文环境:Ubuntu 14.04全新安装【1.sendmail】 发邮件【2.mailutils】 发邮件【3.mutt msmtp】 发邮件【1.sendmail】#sudoapt-getinstallsendmail 然后通过ps查看是否有sendmail进程,如果存在,则安装成功: #ps-ef|grepsendmail root12821013:...

weixin_34072637的博客 558

linux git 发邮件,linux – GitLab不发送邮件

我的VM上安装了Linux Ubuntu 14.04.最近我使用GitLabsite上的说明安装了GitLab 7.8.2,并在使Gitlab发送邮件时遇到了问题.例如,当我尝试使用Web界面创建新用户时,我没有收到来自服务器的任何确认邮件.>我已将postfix配置到我的环境(设置“mynetworks”,“myhostname”),并使用sendmail成功将测试邮件发送到我的yahoo...

weixin_33384949的博客 386

ubuntu sendmail配置发送邮件

ubuntu中sendmail函数可以很方便的发送邮件,ubuntu sendmail先要安装两个包。 必需安装的两个包: 代码 sudo apt-get install sendmail sudo apt-get install sendmail-cf 下面几个包是可选的: 代码 squirrelmail //提供webmail spamassassin ...

weixin_45439698的博客 614
上一篇: Resolving a 'sticky tag is not a branch' error
下一篇: HOW TO: Using CVS
flex4
博客等级 码龄16年 6粉丝 4原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值