通过控制台在Mutt中更改发件人的地址 [英] Change sender's address in mutt via console

查看:232
本文介绍了通过控制台在Mutt中更改发件人的地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在通过控制台使用mutt时动态设置发件人的地址(不作文).我检查了描述的所有内容,并尝试了 this SO问题,但没有任何效果.不管我做什么,都没有任何改变. 我设置

I want to dynamically set the sender's address when using mutt via console (not composing). I checked everything which is described, tried everything from this SO question but nothing works. There is no change at all, no matter what I do. I set

set from="sender@help.me"
set edit_headers=yes

在/etc/Muttrc和〜/.muttrc中,我也尝试了各种-e命令,例如

in both the /etc/Muttrc and ~/.muttrc, also, I tried all sort of -e commands, like

-e "set from=email@example.com"
-e 'my_hdr From:sender@help.me'
-e "send-hook . 'my_hdr From: Other Name <otheremail\@example.com>'"
having export EMAIL=sender@help.me  in front

但是我将始终收到来自username@compname.de

but I will always receive mails from username@compname.de

一个典型的呼叫看起来像这样

A typical call looks like this

export EMAIL="sender@help.me" && echo | mutt -s "VERSANDTEST" -c "mycc@help.me"  -e 'my_hdr From:sender@help.me' -a /opt/data/YoloDat.txt /opt/data/TroloDat.txt  -- "myaddress@help.me"  < /tmp/mailbody

任何更多的想法表示赞赏

Any more ideas appreciated

推荐答案

在.muttrc中使用set use_envelope_from = yes.这会在调用sendmail传递邮件时添加-f选项,从而迫使该信封使用与发件人:标头字段相同的信封地址.

Use set use_envelope_from = yes in your .muttrc. This adds the -f option when calling sendmail to deliver the mail, forcing it to use the same address for the envelope as for the From: header field.

在命令行中使用my_hdr-Flag不需要在.muttrc中设置set edit_headers = yes.

Setting set edit_headers = yes in .muttrc was not required to use the my_hdr-Flag on the command line.

echo "Test" | mutt -e "my_hdr From:sender@domain.tld" -- receiver@domain.tld

这篇关于通过控制台在Mutt中更改发件人的地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆