gromet
2018. 3. 8. 11:09
서버나 아웃룩에서 저장한 메일을 원본 그대로 전달할 때.
$ formail -s /usr/sbin/sendmail -v -t -oiee < saved.eml
참고사이트 : http://www.anhalter.net/blog/?page_id=825
Some
days ago I had to challenge a 350MB dead.letter file. The problem was,
howto resend all the messages from dead.letter file. I discovered a good
solution on lists.freebsd.org.
One solution is to install the procmail port (ports: mail/procmail) which contains a stunningly useful utility called formail(1). Amongst formail’s many talents is the ability to split up a mbox format mailbox into individual messages and pipe each into a program.
So in order to resend all of the messages in your dead.letter you could try:
$ formail -s /usr/sbin/sendmail -v -t -oiee < dead.letter
Or to split up the dead.letter mailbox into individual numbered messages:
$ formail -s /bin/sh -c 'cat > msg.$FILENO' < dead.letter
and you can pipe each message into sendmail as above to re-send it:
$ /usr/sbin/sendmail -v -t -oiee < msg.999
|