2011-09-15 3 views
13

sendmailコマンドを実行する私は通常[email protected]のような送信者のメールを受け取ります。bashを使ってsendmailの送信者を変更する

sendmailを使って電子メールを送信し、送信者をコマンドの実行に使用したユーザーアカウントと異なるものにする方法はありますか?あなたが探していることは-fある

答えて

31

sendmail -F "Your name" -f "[email protected]" < your-message.txt 

sendmail man pageから:

-Ffullname Set the full name of the sender. 

-fname  Sets the name of the ``from'' person (i.e., the sender of the 
      mail). -f can only be used by ``trusted'' users (normally 
      root, daemon, and network) or if the person you are trying to 
      become is the same as the person you are. 
関連する問題