Linux下配置用msmtp和mutt发邮件

Linux下可以直接用mail命令发送邮件,但是发件人是user@servername,如果机器没有外网的dns,其他人就无法回复。此时,有一个可以使用网络免费邮箱服务的邮件发送程序就比较重要了。msmtp就是这样的一个程序。

#1、下载源码包

wget http://sourceforge.net/projects/msmtp/files/msmtp/1.4.31/msmtp-1.4.31.tar.bz2/download

#2、解压

tar -jxvf msmtp-1.4.31.tar.bz2 && cd msmtp-1.4.31

#build and install

./configure --prefix=/usr/local/msmtp && make && make install

#link to /usr/bin

ln -s /usr/local/msmtp/bin/msmtp /usr/bin/msmtp

 

#3、新建msmtp的配置文件

mkdir /usr/local/msmtp/etc && vim /usr/local/msmtp/etc/msmtprc

 

#4、输入如下内容

# Set default values for all following accounts.
defaults

logfile /var/log/msmtp/msmtp.log
# The SMTP server of the provider.
account 163

# SMTP邮件服务器地址
host smtp.163.com

# 发送的邮件Email
from user@163.com
auth login

# 邮件服务器登录账号
user user@163.com

# 邮件服务器登陆密码
password password
# Set a default account
account default : 163

 

#############################################

#5、测试msmtp是否配置正确

msmtp test@163.com
test
[ctrl+d]

#6、安装配置mutt
yum install -y mutt
vim /etc/Muttrc

#输入如下内容:
set sendmail='/usr/bin/msmtp'
set use_from=yes set realname='YOURNAME'
set from=user@163.comset envelope_from=yes auto_view text/html set charset='utf-8'
set send_charset='utf-8'
set locale ='zh_CN.UTF-8'
set content_type = 'text/html\;charset=utf-8'
set rfc2047_parameters=yes

#6、配置完毕,测试一下吧!
echo  "测试test"|mutt -s "test"  receiver@163.com
 
 
Git培训PPT实战设计指南:30分钟交付可动手课件 Git作为主流分布式版本控制系统,其核心价值在于提升团队协作效率与代码可追溯性。理解工作区、暂存区与仓库的三层模型是掌握Git操作的基础原理,而真实工程场景中,开发者最常面临初始化失败、分支切换报错、中文乱码、SSL证书异常及历史丢失等高频问题。本内容聚焦企业内训与高校实验教学场景,提供面向实操的PPT结构优化策略、命令教学优先级划分、错误回显可视化规范及即用型诊断脚本,尤其强化git switch、git restore等现代命令的兼容性说明与安全边界提示,助力讲师快速构建‘打开即教、讲完即练’的工程师友 阅读详情

相关推荐

Depth Anything 3实战:如何用DINOv2 Transformer一键生成3D高斯点云?

本文详细介绍了Depth Anything 3(DA3)模型如何利用DINOv2 Transformer架构,实现从单张或多视角图像一键生成高质量3D高斯点云。DA3通过统一的深度-射线表示和自适应注意力机制,简化了传统复杂的3D重建流程,并可直接微调用于3D高斯渲染,为图形学、CV和内容创作领域提供了高效的端到端解决方案。

postgres8guard的博客 728

Linux命令行发邮件实战:msmtp+mutt配置与生产告警脚本

在Linux系统中,命令行邮件能力是运维自动化、服务监控和CI/CD告警的基础通信机制。其本质是通过轻量SMTP客户端(如msmtp)与终端邮件工具(如mutt)协同,完成身份认证、TLS加密传输、MIME编码及附件处理等关键环节。技术价值在于零GUI依赖、低资源占用、高可审计性,适用于服务器监控、磁盘告警、日志归档等典型场景。本文聚焦Linux下基于msmtp和mutt的端到端配置实践,覆盖Gmail/企业邮箱多源适配、应用专用密码、SPF/DKIM可信发信、中文UTF-8支持及cron环境健壮调用等核心

weixin_33691700的博客 503

PaddleOCR GPU部署:从环境配置到避坑实战指南

本文详细介绍了PaddleOCR GPU部署的全过程,从环境配置到避坑实战指南。通过分析常见的部署失败原因,提供硬件兼容性自查、软件环境精配方案以及路径配置的解决方案,帮助用户高效完成GPU加速的OCR任务部署,避免90%的常见错误。

weixin_30839881的博客 426

msmtp+mutt发送TLS邮件异常处理

转载注明出处:msmtp+mutt发送TLS邮件异常处理 异常:msmtp: the server sent an empty reply解决方法:tls_starttls off异常:msmtp: TLS certificate verification failed: the certificate hasn’t got a known issuer异常:msmtp: account zleb

Maxi的专栏 4700

【图文步骤】EC-Engineer部分操作详细步骤

EC-Engineer部分功能详细使用手册

weixin_42212468的博客 6198

从网口变压器到TVS管:手把手设计通过4KV浪涌的以太网电路

本文详细解析工业级以太网接口4KV浪涌防护设计,从网口变压器选型到TVS管布局,提供通过IEC61000-4-5标准测试的完整方案。重点介绍Bob Smith电路优化和PCB设计技巧,帮助工程师有效应对雷电感应和设备开关瞬态干扰,确保工业设备稳定运行。

study的专栏 309

jetty http2 Empty reply from server

http2访问jetty 提示 Empty reply from server

zsp8503的博客 628

告别命令行!用这个开源的Web版Kettle工具,5分钟搞定数据集成任务编排

本文介绍了一款开源的Web版Kettle工具,通过直观的拖拽界面大幅提升数据集成效率,告别复杂的命令行操作。该工具基于Kettle核心引擎,支持跨平台协作、轻量化访问和降低学习曲线,特别适合业务分析师快速上手。实测显示,使用该工具后任务配置错误率下降62%,协作效率提升40%。

weixin_30267785的博客 447

Mutt+msmtp使用外部邮箱发送邮件

msmtp下载msmtp http://sourceforge.net/projects/msmtp/files/msmtp/ # xz -d msmtp-1.6.5.tar.xz # tar xvf msmtp-1.6.5.tar -C /usr/local/src/ # mkdir /usr/local/msmtp # ./configure –prefix=/

tshangshi的专栏 2222

GD32测量pwm波频率以及占空比

1、需求 最近做的一个项目,其中有一个传感器输出是pwm波形,频率代表速度,频率越高速度越快。不同的占空比代表不同的故障类型。占空比10%~90%,频率范围20hz ~1khz。 基于以上的需求,单片机要实现两个功能: 1、测量频率 2、测量占空比 这怎么玩呢?从没搞过啊。 2、需求分析 经过查找资料以及参考正点原子的教程,发现单片机的定时器的输入捕获功能能够实现该功能。 2.1分析 如上图所示,测量占空比和测量频率实际上就是测量波形的长度。 对于占空比,就是测量T2与T1时刻的差值 对于频率,就是测量T

Jack Yi的博客 9099

Python从0到100(二):Python语言介绍及第一个Pyhon程序

Python从0到100(二):Python语言介绍及第一个Pyhon程序。与C和Java比,Python的学习成本和难度曲线不是低一点,更适合新手入门,自底向上的技术攀爬路线。

拥有百余位万粉技术博主、200余位可合作代发博主,私域技术社群规模达千人,商务合作私信 5448

利用msmtp发送邮件

利用msmtp可以发送邮件,但是好像只能发送文本,并没有发送jpg,bmp图片等类似附件的功能。上百度,google搜索了下,一般只有msmtp+mutt发送邮件的功能。要在嵌入式下如果只是发送文本,用msmtp应该是足够了,但是发送jpg,bmp等附件可能不可以(估计需要自己改

dadaguo3000的专栏 6591

寻路最终版哦

相信大家用unity3d寻路的时候,一定会碰到多人

yxriyin的专栏 6962

cetos6配置用msmtp和mutt发邮件(阿里云)

  Linux下可以直接用mail命令发送邮件,但是发件人是user@servername,如果机器没有外网的dns,其他人就无法回复。此时,有一个可以使用网络免费邮箱服务的邮件发送程序就比较重要了。msmtp就是这样的一个程序。 一、安装msmtp   1.下载源码包 cd /usr/local/src && wget https://nchc.dl.sourcefor...

weixin_30568715的博客 4720

lwip-2.0.3

lwip是瑞典计算机科学院(SICS)的Adam Dunkels 开发的一个小型开源的TCP/IP协议栈。实现的重点是在保持TCP协议主要功能的基础上减少对RAM 的占用。

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

ESP32-CAM烧录失败原因与硬件级解决方案

ESP32-CAM烧录本质上是嵌入式系统启动模式切换过程,其核心在于通过UART串口配合GPIO0/RST引脚强制进入Bootloader下载模式。由于该模块无内置USB转串口芯片,必须依赖外部TTL模块实现电平转换与时序控制,而CH340G芯片因DTR/RTS精准翻转特性,在自动复位时序上显著优于CP2102;同时,3.3V稳定供电(峰值电流≥500mA)和共地设计直接决定烧录成功率。这些底层电气约束,使ESP32-CAM烧录成为软硬协同的典型工程实践场景——既涉及串口通信协议、复位时序、电源完整性等基础

weixin_34174422的博客 364

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

msmtp+mutt自动发邮件

下载MSMTP wget http://nchc.dl.sourceforge.net/sourceforge/msmtp/msmtp-1.4.17.tar.bz2 tar xvf msmtp-1.4.17.tar.bz2 cd msmtp-1.4.17 ./configure --prefix=/usr/local/msmtp make make install cd /usr

学而知不足 1013

深度学习工具包 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下运用mutt和msmtp发邮件

在Linux系统中,想要发送邮件,可以使用mutt和msmtp服务。 1、安装mutt和msmtp服务, 执行命令:sudo apt-get install mutt    sudo apt-gey install msmtp 2、mutt的配置 系统全局设置/etc/Muttrc,如果使用某个系统用户,可以在~/.muttrc中设置。 vi .muttrc se

wsj_wsj_123的博客 899

使用mutt+msmtp做linux邮件客户端

这几天领导让我部署开发部门写的一个脚本,需要把脚本生成的附件通过email发到他的邮箱里面去。那就开始干吧,因为之前一直用mail 命令来发邮件,可是这次行不通了。因为要带附件。有人告诉我mail 命令也能带附件,可是我怎么也没找到相关的参数。可又不想搭个mail服务器,因为闲麻烦。     于是就开始在网上找简单又有效的命令行客户端,还真让我找到了。那就是MUTT+MSMTP,看到网上好多文章

郑明经的专栏 1092

树莓派 msmtp和mutt 的安装和配置

1,安装mutt sudo apt-get install mutt 2,安装msmtp sudo apt-get install msmtp 3,设置mutt /etc/Muttrc   # 系统全局设置 ~/.muttrc    # 使用某个系统用户 raspberrypi# vim ~/.muttrc set sendmail="/usr/bin/msmtp" set...

weixin_30652879的博客 424

linux使用MSMTP和Mutt从命令行发送电子邮件

在本教程中,我们将学习如何安装 MSMTP 和 Mutt。我们将使用 MSMTP 将我们的电子邮件转发到 QQ邮箱服务器再转发到其他邮箱 mutt - 用户代理客户端 msmtp - 支持服务器配置文件的轻型 SMTP 客户端。

tiaga的博客 1747
上一篇: 点球成金
下一篇: seg格式文件的分析
weixin_33918357
博客等级 码龄11年 5413粉丝 134原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值