スクリプトのMutt、受信者が指定されていない - 添付ファイル、複数の受信者

スクリプトのMutt、受信者が指定されていない - 添付ファイル、複数の受信者

No Recipients SpecifiedbashスクリプトでMuttからEメールを送信するとエラーが発生します。他のフォーラムの質問を見たところ、ここで一般的な構文エラーは問題ではないと思います(最後に-aオプションを使用して受信者など)。私はいくつかのコマンド配列を試しました。

コードはコマンドラインで動作しているように見えますが、スクリプト内では失敗し、興味深いことに、受信者が複数の人にのみ失敗します。アドレスを含む文字列変数の使用方法に問題がありますか?

コンテキスト:

私はDebian GNU / Linux 7.7を実行しています。

スクリプトは、コマンドラインでテストするために使用するのと同じユーザーとして実行されるサービスで呼び出されます。どの環境変数を確認するのかわかりませんが、スクリプトが単一の受信者に対して正しく機能しない限り、ここから始めることをお勧めします。

関連コードは次のとおりです。

#Email .7z file
EmailTo="[email protected] [email protected]"
echo "$(date '+%m/%d/%Y,%T'): Sending email to $EmailTo..."
echo "Attachment: $myPath/$dateStr.7z"
echo "Subject: $dateStr Daily Data"
mutt -s "$dateStr Daily Data" -a "$myPath/$dateStr.7z" -- $EmailTo <<EOF
Daily data for $dateStr attached.
EOF

私も同様のバリエーションを試しました。

mutt -a "$myPath/$dateStr.7z" <<EOF
To: $EmailTo
Subject: "$dateStr Daily Data"
Daily data for $dateStr attached.
EOF

同様の結果が表示されます。すべての変数が画面にうまく印刷されるので、次に何を試すべきかわかりません。

mutt -v私のスクリプトに追加すると、次のようになります。

Mutt 1.5.21 (2010-09-15)
Copyright (C) 1996-2009 Michael R. Elkins and others.
Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'.
Mutt is free software, and you are welcome to redistribute it
under certain conditions; type `mutt -vv' for details.

System: Linux 3.2.0-4-amd64 (x86_64)
ncurses: ncurses 5.9.20110404 (compiled with 5.9)
libidn: 1.25 (compiled with 1.25)
hcache backend: tokyocabinet 1.4.47
Compile options:
-DOMAIN
+DEBUG
-HOMESPOOL  +USE_SETGID  +USE_DOTLOCK  +DL_STANDALONE  +USE_FCNTL
-USE_FLOCK +USE_POP  +USE_IMAP  +USE_SMTP -USE_SSL_OPENSSL
+USE_SSL_GNUTLS  +USE_SASL  +USE_GSS  +HAVE_GETADDRINFO +HAVE_REGCOMP  
-USE_GNU_REGEX +HAVE_COLOR  +HAVE_START_COLOR  +HAVE_TYPEAHEAD  
+HAVE_BKGDSET +HAVE_CURS_SET  +HAVE_META  +HAVE_RESIZETERM
+CRYPT_BACKEND_CLASSIC_PGP  +CRYPT_BACKEND_CLASSIC_SMIME  
+CRYPT_BACKEND_GPGME -EXACT_ADDRESS  -SUN_ATTACHMENT
+ENABLE_NLS  -LOCALES_HACK  +COMPRESSED  +HAVE_WC_FUNCS  
+HAVE_LANGINFO_CODESET  +HAVE_LANGINFO_YESEXPR
+HAVE_ICONV  -ICONV_NONTRANS  +HAVE_LIBIDN  +HAVE_GETSID  +USE_HCACHE
-ISPELL
SENDMAIL="/usr/sbin/sendmail"
MAILPATH="/var/mail"
PKGDATADIR="/usr/share/mutt"
SYSCONFDIR="/etc"
EXECSHELL="/bin/sh"
MIXMASTER="mixmaster"
To contact the developers, please mail to <[email protected]>.
To report a bug, please visit http://bugs.mutt.org/.

misc/am-maintainer-mode
features/ifdef
features/xtitles
features/trash-folder
features/purge-message
features/imap_fast_trash
features/sensible_browser_position
features-old/patch-1.5.4.vk.pgp_verbose_mime
features/compressed-folders
features/compressed-folders.debian
debian-specific/Muttrc
debian-specific/Md.etc_mailname_gethostbyname.diff
debian-specific/use_usr_bin_editor.diff
debian-specific/correct_docdir_in_man_page.diff
debian-specific/dont_document_not_present_features.diff
debian-specific/document_debian_defaults
debian-specific/assumed_charset-compat
debian-specific/467432-write_bcc.patch
debian-specific/566076-build_doc_adjustments.patch
misc/define-pgp_getkeys_command.diff
misc/gpg.rc-paths
misc/smime.rc
upstream/531430-imapuser.patch
upstream/537818-emptycharset.patch
upstream/543467-thread-segfault.patch
upstream/542817-smimekeys-tmpdir.patch
upstream/548577-gpgme-1.2.patch
upstream/553321-ansi-escape-segfault.patch
upstream/568295-references.patch
upstream/547980-smime_keys-chaining.patch
upstream/528233-readonly-open.patch
upstream/228671-pipe-mime.patch
upstream/383769-score-match.patch
upstream/578087-header-strchr.patch
upstream/603288-split-fetches.patch
upstream/537061-dont-recode-saved-attachments.patch
upstream/608706-fix-spelling-errors.patch
upstream/620854-pop3-segfault.patch
upstream/611412-bts-regexp.patch
upstream/624058-gnutls-deprecated-set-priority.patch
upstream/624085-gnutls-deprecated-verify-peers.patch
upstream/584138-mx_update_context-segfault.patch
upstream/619216-gnutls-CN-validation.patch
upstream/611410-no-implicit_autoview-for-text-html.patch
upstream/path_max
upstream/CVE-2014-0467.patch
upstream/771125-CVE-2014-9116.patch
misc/579967-fixes-german-translation.patch
mutt.org

ベストアンサー1

date | mutt $USER  -s "$subject" -a file1 file2 

私のため。同様に:

mutt $USER  -s "$subject" -a file1 file2 << EOF
Hello Word
EOF

そして

for $u in User1 User2
do 
date | mutt $u -s "message to $u" -a file1.jpg file2.txt
done

おすすめ記事