トップ > Ubuntu 8.04 によるサーバーの構築 >

Fetchmail の利用設定

Fetchmail のインストールと設定

 Fetchmail を導入することにより,他の POP サーバーのメールをこちらのメールサーバーに転送することができます。

  1. root でログインする。
  2. 以下のコマンドを実行して, Fetchmail をインストールする。
    # apt-get install fetchmail
  3. /root/.fetchmailrc を以下のように作成する。
    # エラーメールの送信先を root に指定
    set postmaster root
    # エラーメールを送信者に返さない指定
    set nobouncemail
    # ステータスログファイルの指定
    set logfile /var/log/fetchmail.log
    defaults
    protocol pop3
    # メール受信後にサーバーからメールを削除
    flush
    no mimedecode
    # 受信メールを渡すサーバーを指定
    smtphost mail.shitomi.jp
    # POPサーバーを指定
    poll pop.mail.yahoo.co.jp

    # 以下,ユーザ情報(アカウント abc や xyz に転送)
    user "test1-gxfdow" password "test1-passwd" is "abc" here
    user "test2-gdrdls" password "passwdtest2" is "xyz" here
    user "test3-dsfalr5w" password "test3password" is "abc" here
    user "test4-fdsawldrj1" password "test4pass" is "abc" here
  4. 以下のコマンドを実行して, /root/.fetchmailrc のパーミッションを変更する。
    # chmod 600 /root/.fetchmailrc
  5. 以下のコマンドを実行して, Fetchmail のログファイルを作成する。
    # touch /var/log/fetchmail.log
  6. 以下のコマンドを実行することにより, Fetchmail を実行することができる。
    # fetchmail
  7. 10 分毎に Fetchmail を自動実行するため,「crontab -e」コマンドを実行して,以下のような行を追加する。
    0,10,20,30,40,50 * * * * fetchmail -f /root/.fetchmailrc 1> /dev/null 2>&1

 このサイトに書かれていることが原因でトラブルが発生しても,私は責任を取ることができません。したがいまして,ここで述べられていることに関する実行は,自己責任でお願いいたします。なお,このサイトはリンクフリーで,リンク時の連絡も不要です。

サイト内関連リンク:Postfix