Mutt는 자동으로 이메일 전송에 실패합니다. 오류나 실패가 없습니다. 하지만 이메일이 성공적으로 전송될 때도 있고 실패할 때도 있습니다.
이것이 하나의 작업에 필요한 모든 설치 가능 파일/라이브러리를 설치하는 방법입니다.
sudo apt-get update
sudo apt install snapd
sudo snap install okular
sudo apt install mailutils
sudo apt install mutt
다른 작업에서는 다음과 같은 이메일을 보냅니다.
url=https://dev.azure.com/xyz/project/_build/results?buildId=$(Build.BuildId)
echo -e "$url"
mutt -v
echo -e "Hello All,\n\n Please find inline as well as attached the elaborative test results which $(Agent.JobStatus) and generated \n\nRegards\nQA Team\n\nLink to Azure DevOps Pipeline Build : $url-- [email protected]
아래는 보낸 이메일의 로그입니다. 여기에는 오류가 없습니다.
2023-06-13T06:34:21.9114531Z ##[section]Starting: Email with E2E report and logs using utils
2023-06-13T06:34:21.9118245Z ==============================================================================
2023-06-13T06:34:21.9118373Z Task : Bash
2023-06-13T06:34:21.9118437Z Description : Run a Bash script on macOS, Linux, or Windows
2023-06-13T06:34:21.9118539Z Version : 3.214.0
2023-06-13T06:34:21.9118605Z Author : Microsoft Corporation
2023-06-13T06:34:21.9118684Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/bash
2023-06-13T06:34:21.9118799Z ==============================================================================
2023-06-13T06:34:22.0517617Z Generating script.
2023-06-13T06:34:22.0538699Z ========================== Starting Command Output ===========================
2023-06-13T06:34:22.0549802Z [command]/usr/bin/bash /home/vsts/work/_temp/8c145d8d-536a-4543-addb-40c24c02f85d.sh
2023-06-13T06:34:22.0625138Z https://dev.azure.com/xyz/project/_build/results?buildId=5209788
2023-06-13T06:34:22.0656911Z Mutt 1.13.2 (2019-12-18)
2023-06-13T06:34:22.0657459Z Copyright (C) 1996-2016 Michael R. Elkins and others.
2023-06-13T06:34:22.0658162Z Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'.
2023-06-13T06:34:22.0658578Z Mutt is free software, and you are welcome to redistribute it
2023-06-13T06:34:22.0658981Z under certain conditions; type `mutt -vv' for details.
2023-06-13T06:34:22.0659300Z
2023-06-13T06:34:22.0660934Z System: Linux 5.15.0-1038-azure (x86_64)
2023-06-13T06:34:22.0661328Z ncurses: ncurses 6.2.20200212 (compiled with 6.2)
2023-06-13T06:34:22.0661631Z libidn: 1.33 (compiled with 1.33)
2023-06-13T06:34:22.0734866Z hcache backend: tokyocabinet 1.4.48
2023-06-13T06:34:22.0735064Z
2023-06-13T06:34:22.0735270Z Compiler:
2023-06-13T06:34:22.0735584Z Using built-in specs.
2023-06-13T06:34:22.0735779Z COLLECT_GCC=gcc
2023-06-13T06:34:22.0736064Z COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
2023-06-13T06:34:22.0736360Z OFFLOAD_TARGET_NAMES=nvptx-none:hsa
2023-06-13T06:34:22.0736561Z OFFLOAD_TARGET_DEFAULT=1
2023-06-13T06:34:22.0736984Z Target: x86_64-linux-gnu
2023-06-13T06:34:22.0738676Z Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.1' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-Av3uEd/gcc-9-9.4.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
2023-06-13T06:34:22.0739695Z Thread model: posix
2023-06-13T06:34:22.0739956Z gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
2023-06-13T06:34:22.0740049Z
2023-06-13T06:34:22.0741633Z Configure options: '--build=x86_64-linux-gnu' '--prefix=/usr' '--includedir=\${prefix}/include' '--mandir=\${prefix}/share/man' '--infodir=\${prefix}/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-silent-rules' '--libdir=\${prefix}/lib/x86_64-linux-gnu' '--libexecdir=\${prefix}/lib/x86_64-linux-gnu' '--disable-maintainer-mode' '--disable-dependency-tracking' '--with-mailpath=/var/mail' '--enable-compressed' '--enable-debug' '--enable-fcntl' '--enable-hcache' '--enable-gpgme' '--enable-imap' '--enable-smtp' '--enable-pop' '--enable-sidebar' '--enable-nntp' '--enable-dotlock' '--disable-fmemopen' '--with-curses' '--with-gnutls' '--with-gss' '--with-idn' '--with-mixmaster' '--with-sasl' '--without-gdbm' '--without-bdb' '--without-qdbm' '--with-tokyocabinet' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fdebug-prefix-map=/build/mutt-30uNgF/mutt-1.13.2=. -fstack-protector-strong -Wformat -Werror=format-security' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2'
2023-06-13T06:34:22.0742559Z
2023-06-13T06:34:22.0742969Z Compilation CFLAGS: -Wall -pedantic -Wno-long-long -g -O2 -fdebug-prefix-map=/build/mutt-30uNgF/mutt-1.13.2=. -fstack-protector-strong -Wformat -Werror=format-security
2023-06-13T06:34:22.0743153Z
2023-06-13T06:34:22.0743297Z Compile options:
2023-06-13T06:34:22.0743479Z -DOMAIN
2023-06-13T06:34:22.0743612Z +DEBUG
2023-06-13T06:34:22.0743899Z -HOMESPOOL +USE_SETGID +USE_DOTLOCK +DL_STANDALONE +USE_FCNTL -USE_FLOCK
2023-06-13T06:34:22.0744106Z +USE_POP +USE_IMAP +USE_SMTP
2023-06-13T06:34:22.0744394Z -USE_SSL_OPENSSL +USE_SSL_GNUTLS +USE_SASL +USE_GSS +HAVE_GETADDRINFO
2023-06-13T06:34:22.0744658Z +HAVE_REGCOMP -USE_GNU_REGEX
2023-06-13T06:34:22.0744866Z +HAVE_COLOR +HAVE_START_COLOR +HAVE_TYPEAHEAD +HAVE_BKGDSET
2023-06-13T06:34:22.0745086Z +HAVE_CURS_SET +HAVE_META +HAVE_RESIZETERM +HAVE_FUTIMENS
2023-06-13T06:34:22.0745324Z +CRYPT_BACKEND_CLASSIC_PGP +CRYPT_BACKEND_CLASSIC_SMIME +CRYPT_BACKEND_GPGME
2023-06-13T06:34:22.0745584Z -EXACT_ADDRESS -SUN_ATTACHMENT
2023-06-13T06:34:22.0745903Z +ENABLE_NLS -LOCALES_HACK +HAVE_WC_FUNCS +HAVE_LANGINFO_CODESET +HAVE_LANGINFO_YESEXPR
2023-06-13T06:34:22.0746252Z +HAVE_ICONV -ICONV_NONTRANS +HAVE_LIBIDN -HAVE_LIBIDN2 +HAVE_GETSID +USE_HCACHE
2023-06-13T06:34:22.0746476Z +USE_SIDEBAR +USE_COMPRESSED +USE_INOTIFY
2023-06-13T06:34:22.0746674Z -ISPELL
2023-06-13T06:34:22.0746837Z SENDMAIL="/usr/sbin/sendmail"
2023-06-13T06:34:22.0746993Z MAILPATH="/var/mail"
2023-06-13T06:34:22.0747156Z PKGDATADIR="/usr/share/mutt"
2023-06-13T06:34:22.0747315Z SYSCONFDIR="/etc"
2023-06-13T06:34:22.0747487Z EXECSHELL="/bin/sh"
2023-06-13T06:34:22.0747643Z MIXMASTER="mixmaster"
2023-06-13T06:34:22.0747771Z
2023-06-13T06:34:22.0748027Z To contact the developers, please mail to <[email protected]>.
2023-06-13T06:34:22.0748255Z To report a bug, please contact the Mutt maintainers via gitlab:
2023-06-13T06:34:22.0748463Z https://gitlab.com/muttmua/mutt/issues
2023-06-13T06:34:22.0748544Z
2023-06-13T06:34:22.2419708Z ##[section]Finishing: Email with E2E
유틸리티 보고 및 로깅 사용
이유는 무엇입니까? Ubuntu 20.04에서 설정
답변1
귀하의 예에서는 mutt가 포함된 이메일을 보내지 않고 실행 중이며 mutt -v
(mutt의 버전 및 컴파일 세부 정보 표시) 를 실행하고 있습니다 echo
.
mutt를 사용하여 메시지를 보내려면 다음과 같이 하세요.
mutt -s "subject" [email protected] <<__EOF__
Hello All,
Please find inline as well as attached the elaborative test results which $(Agent.JobStatus) and generated
Regards
QA Team
Link to Azure DevOps Pipeline Build : $url
__EOF__
echo
또는 다른 방법을 사용하여 printf
메시지를 파이프 할 수 있지만 mutt
메시지에 여러 줄 바꿈이 포함되어 있으므로 heredoc을 사용하는 것이 더 쉽습니다.
man mutt
mutt 명령줄 옵션에 대한 자세한 내용은 참고자료를 참조하세요. 예를 들어 MIME을 사용하여 CC 및 BCC 에 대한 -a filename
파일을 첨부하고 -i filename
메시지 본문에 파일을 포함 할 수 있습니다.-c
-b