オプション -a ヘッダーに入力します。
クイック コマンド:
mail -a FROM:example@unixlinux.online example@unixlinux.online
ロングコマンド
mail --append="FROM:example@unixlinux.online" example@unixlinux.online
Usage: mail [OPTION...] [address...] -a, --append=HEADER: VALUE append given header to the message being sent -A, --attach=FILE attach FILE --content-type=TYPE set content type for subsequent --attach options -e, --exist return true if mail exists --encoding=NAME set encoding for subsequent --attach options -E, --exec=COMMAND execute COMMAND -F, --byname save messages according to sender -H, --headers write a header summary and exit -i, --ignore ignore interrupts -n, --norc do not read the system mailrc file -N, --nosum do not display initial header summary -p, --print, --read print all mail to standard output -q, --quit cause interrupts to terminate program -r, --return-address=ADDRESS use address as the return address when sending mail -s, --subject=SUBJ send a message with the given SUBJECT -t, --to precede message by a list of addresses -u, --user=USER operate on USER's mailbox共通オプション
--config-file=FILE, --rcfile=FILE load this configuration file --config-help show configuration file summary --config-lint, --rcfile-lint check configuration file syntax and exit --config-verbose, --rcfile-verbose verbosely log parsing of the configuration files --no-site-config, --no-site-rcfile do not load site configuration file --no-user-config, --no-user-rcfile do not load user configuration file --set=PARAM=VALUE set configuration parameter --show-config-options show compilation optionsグローバル デバッグ設定
--debug-level=LEVEL set Mailutils debugging level --debug-line-info show source info with debugging messages -?, --help give this help list --usage give a short usage message -V, --version print program version長いオプションの必須またはオプションの引数は、対応する短いオプションの必須またはオプションでもあります。
これを試してください:
mail -s 'Some Subject' -r 'First Last <example@unixlinux.online>' example@unixlinux.online
これにより、両方の From: が設定されます そして封筒の差出人。
これは、使用しているメール クライアントによって異なります。一部の Linux ディストリビューションは mailx にリンクしています -r from-addr を使用できる場所 パラメータ。
mutt がある場合は、 mutt -e "set from='name <example@unixlinux.online>'> を使用できるはずです .
mail を持つ他のディストリビューション コマンドは echo "test"|mail -s "subject" example@unixlinux.online -- -f example@unixlinux.online を使用できる必要があります .