mutt를 이용한 첨부파일 메일 발송

주기적으로 스케줄러를 통해 생성되는 결과물을 받아다가 담당자들에게 보내줘야 하는
경우가 종종 있다.
매우 귀찮은 일이 아닐수 없다 ㅋ…  담당자에게 ftp를 열어 주기도 그렇고..  매번 서버에들어가서.. 데이타를 받고,  또 다시 해당 담당자에게 메일을 보내고..  참 비효율적이다.. ㅠㅠ

귀차니즘에서 벗어나는 방법은 나를 거치지 않고  해당 결과물을  담당자에게 보내는 방법이다 ㅋㅋ..  email을 이용하는 방법 ㅎ.

아래의 스크립트는 단순히 첨부파일을 첨부하여, 메일을 발송하는 스크립트다.

쪼금 더 응용하여 각자 환경에 맞게..  귀차니즘에서 벗어나보자 ㅎ.

필요한건
                 mutt에서 필요한건 mutt, mutt_dotlock 바이너리 파일
                 relay 허용된 smtp서버

#########################################################################

#!/bin/bash
#  by netggio.pe.kr

from_name=”Admin”
from=”test@netggio.pe.kr
to=”test@netggio.pe.kr
subject=”TEST MAIL”
smtp_server=”localhost”
File=”test.zip”
mesg=”test mesg”
tools=”mutt_dotlock” 

./mutt -nx -e ‘set from=’$from’; set realname=’$from_name’; set dotlock_program=’$tools’ ;set smtp_url=”smtp://’$smtp_server'”‘ -s “
$subject” “$to” -a $File  << EOF
$mesg
EOF

- to blog -

blog built using the cayman-theme by Jason Long. LICENSE