X-header X-APP-VOLT:Yesを.tar添付ファイル付きの電子メールのヘッダーに追加しようとしています。 usr/sbin/sendmailとmailxにしかアクセスできません。ルートアクセス権がないため、他のバージョンのmailxまたはmuttをダウンロードできません。
以下のコードを使用してx-headerをusr/sbin/sendmailに追加できますが、.tar添付ファイルを追加する方法がわかりません。
/usr/sbin/sendmail -i -- toemail << END
To: toemail
Subject: Test
X-APP-VOLT: Yes
Hope this works!
END
以下のコードを使用して.tarファイルをmailxに添付できますが、xヘッダーを追加する方法がわかりません。私のmailxにも-aオプションがありません。
cat file | uuencode filename | mailx -s "Test" toemail
ありがとうございました
複数のコマンドの出力をsendmail入力にパイプできます。
以下のコードが機能しない場合は、使用する名前(コマンド)シェル。
(
# Command 1: "here document with headers and initial body lines
cat << END
To: toemail
Subject: Test
X-APP-VOLT: Yes
Hope this works!
Email Body line 1
END
# Command 2: uuencode file
cat file | uuencode filename
) | /usr/sbin/sendmail -i -- toemail