fetchmailrc をサーバーに合わせて書き、”mda /path/mda.sh” を追加する
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
set postmaster root set nobouncemail # uidl set logfile /path/fetchmail.log # delay second auto recieve # set daemon 300 # set daemon 600 defaults bad-header accept protocol pop3 no fetchall ssl keep # flush no mimedecode smtphost localhost # user poll mail.example.com user "USERNAME@example.com" password "*****" is USERNAME here mda /path/mda.sh # |
/path/mda.sh
1 2 3 4 5 6 7 |
#!/bin/bash export LANG=C fname=/path/mailbox/mail_`date +"%Y%m%d_%H%M%S"`_${RANDOM}.txt cat > ${fname} |
実行
1 |
$ fetchmail -f /path/fetchmailrc |