Mutt

用mutt连接SMTP服务器发邮件

守給你的承諾、 提交于 2019-12-06 03:19:40
mutt是linux命令行下的email客户端,相当于outlook的角色,可以用来收发邮件,本文主要讲解如何配置连接到SMTP服务器发送邮件,用来发个告警什么的。 最早我都是自己搭建一个SMTP server,比如sendmail, postfix, 然后通过它发邮件,后来发现因为自己临时搭的邮件服务太简陋,经常被正规的邮箱当垃圾邮件或直接不接收它递送出去的邮件而影响正常的使用,所以研究起连接正规服务器的方法。 环境: ubuntu 14.04 apt-get install mutt vim /etc/Muttrc 追加如下内容: # Connection set ssl_starttls=yes set ssl_force_tls=yes set ssl_use_sslv3=yes set timeout=60 set smtp_authenticators="login" set smtp_url="smtp://xxx\@xxxx.com@smtp.office365.com:587" #set content_type="text/html" # Outgoing set realname="zhang san" set from="zhangsan@xxxx.com" set smtp_pass="password" 解释: smtp_url 指定服务器地址

starting remote script via ssh containing nohup

混江龙づ霸主 提交于 2019-12-05 05:46:09
I want to start a script remotely via ssh like this: ssh user@remote.org -t 'cd my/dir && ./myscript data my@email.com' The script does various things which work fine until it comes to a line with nohup: nohup time ./myprog $1 >my.log && mutt -a ${1%.*}/`basename $1` -a ${1%.*}/`basename ${1%.*}`.plt $2 < my.log 2>&1 & it is supposed to do start the program myprog, pipe its output to mylog and send an email with some datafiles created by myprog as attachment and the log as body. Though when the script reaches this line, ssh outputs: Connection to remote.org closed. What is the problem here?

mutt command with multiple attachments in single mail unix

若如初见. 提交于 2019-12-03 08:37:58
问题 My requirement is to attach all the .csv files in a folder and send them in a single mail. Here is what have tried, mutt -s "subject" -a *.csv -- abc@gmail.com < subject.txt The above command is not working (It's not recognizing multiple files) and throwing the error Error sending message, child exited 67 (User unknown.). Could not send the message. Then I tried using multiple -a option as follows, mutt -s "subject" -a aaa.csv -a bbb.csv -- abc@gmail.com < subject.txt This works as expected.

监控Linux系统内存的一些方法

会有一股神秘感。 提交于 2019-11-30 22:50:09
本文档介绍监控 Linux系统 内存的一些方法 一、安装 Linux 下面的一个邮件客户端Msmtp软件(类似于一个Foxmail的工具) 1、下载安装:https://marlam.de/msmtp/download/ # tar jxvf msmtp-1.4.16.tar.bz2 # cd msmtp-1.4.16 # ./configure --prefix=/usr/local/msmtp # make # make install 2、创建msmtp配置文件和日志文件(host为邮件域名,邮件用户名test,密码123456) # vim ~/.msmtprc account default host 126.com from test@126.com auth login user test password 123456 logfile ~/.msmtp.log # chmod 600 ~/.msmtprc # touch ~/.msmtp.log 3、mutt安装配置:(一般linux下有默认安装mutt) # vim ~/.muttrc set sendmail="/usr/local/msmtp/bin/msmtp" set use_from=yes set realname="memory" set from=test@126.com set envelope

Send Html page As Email using “mutt”

匆匆过客 提交于 2019-11-30 04:20:46
I have been using mutt to send emails from inside another application & it works fine. I have to send html files and currently I have to send them as attachments. So I use mutt -s "hi" -a attach.html user@domain.com < /dev/null But if I try to send the html file as the body as follows mutt -e content_type=text/html Email address -s "subject" < test.html then instead of the html file i get the source text of the html file. Is there any way that I can make the body of the message as html instead of plain text??? vstm When I try your command, mutt is telling me that content_type=text/html is an

How to change the sender's name or e-mail address in mutt?

泪湿孤枕 提交于 2019-11-29 21:12:33
How can I change the sender's name or e-mail address ( From: header) used by mutt ? Normally, mutt sets the From: header based on the from configuration variable you set in ~/.muttrc : set from="Fubar <foo@bar>" If this is not set, mutt uses the EMAIL environment variable by default. In which case, you can get away with calling mutt like this on the command line (as opposed to how you showed it in your comment): EMAIL="foo@bar" mutt -s '$MailSubject' -c "abc@def" However, if you want to be able to edit the From: header while composing , you need to configure mutt to allow you to edit headers

监控Linux系统内存的一些方法

耗尽温柔 提交于 2019-11-28 21:45:12
本文档介绍监控 Linux系统 内存的一些方法 一、安装 Linux 下面的一个邮件客户端Msmtp软件(类似于一个Foxmail的工具) 1、下载安装:https://marlam.de/msmtp/download/ # tar jxvf msmtp-1.4.16.tar.bz2 # cd msmtp-1.4.16 # ./configure --prefix=/usr/local/msmtp # make # make install 2、创建msmtp配置文件和日志文件(host为邮件域名,邮件用户名test,密码123456) # vim ~/.msmtprc account default host 126.com from test@126.com auth login user test password 123456 logfile ~/.msmtp.log # chmod 600 ~/.msmtprc # touch ~/.msmtp.log 3、mutt安装配置:(一般linux下有默认安装mutt) # vim ~/.muttrc set sendmail="/usr/local/msmtp/bin/msmtp" set use_from=yes set realname="memory" set from=test@126.com set envelope

How to change the sender's name or e-mail address in mutt?

﹥>﹥吖頭↗ 提交于 2019-11-27 10:13:35
问题 How can I change the sender's name or e-mail address ( From: header) used by mutt ? 回答1: Normally, mutt sets the From: header based on the from configuration variable you set in ~/.muttrc : set from="Fubar <foo@bar>" If this is not set, mutt uses the EMAIL environment variable by default. In which case, you can get away with calling mutt like this on the command line (as opposed to how you showed it in your comment): EMAIL="foo@bar" mutt -s '$MailSubject' -c "abc@def" However, if you want to

CentOS挂载磁盘

泄露秘密 提交于 2019-11-25 16:52:27
查看系统中未挂载的所有磁盘 fdisk -l 通常情况下,已挂载的磁盘会有磁盘label、identifier和分区信息,因此从上图可以看出/dev/sdb没有挂载 对磁盘进行分区 磁盘分区有主分区、扩展分区和逻辑分区 fdisk /dev/sdb 磁盘可分次多个分区,为管理方便,这儿只划分了一个分区,分区结束后,注意要写入磁盘分配(w)。当分区较大时,需要几秒钟时间写入分区信息。分区结果如下图。 格式化磁盘 磁盘分区后,必须对分区格式化才能使用,目前Linux下常用的文件系统格式为ext4 mkfs.ext4 /dev/sdb1 挂载磁盘 格式化后的磁盘可以保存信息,但必须挂载到文件系统的某一个路径下,才能按照文件路径进行访问。挂载磁盘时需要为磁盘指定路径,如下图所示。 mkdir /data mount /dev/sdb1 /data 磁盘挂载成功后,即可采用操作文件夹的方式使用该磁盘,磁盘信息如下图。 设置开机自动挂载 新的磁盘分区挂在后,如果系统重新启动,分区信息会丢失。此时,需将磁盘分区及挂载信息告知系统(/etc/fstab)。 nano /etc/fstab 在文件最后加入新挂载的分区和挂载点信息。 通过 lsblk -f 可以查看树状分区信息。 ********注: /etc/fstab 文件包含了如下字段,通过空格或 Tab 分隔: <file system>