| # apt-get install
fetchmail |
| # /etc/fetchmailrc
for system-wide daemon mode # This file must be chmod 0600, owner fetchmail # Daemon configuration # These two are set in /etc/default/fetchmail set daemon 300 #<-------メールの取得間隔(秒) #set syslog # log through syslog facility set no bouncemail #<---メールを送信者に転送しない ########################################################################## # Hosts to pool ########################################################################## # Defaults =============================================================== # Set antispam to -1, since it is far safer to use that together with # no bouncemail defaults: antispam -1 batchlimit 100 #poll [サーバ名] with protocol pop3 user [ユーザ名] poll karappi.minidns.net with protocol pop3 user hogehoge |
| $ chmod 600 .fetchmailrc |
| $ fetchmail & |
| # cp /home/hogehoge/.fetchmailrc
/etc/fetchmailrc # chmod 600 fetchmailrc (念のため) # cd /etc/init.d # update-rc.d -f fetchmail remove (自動起動登録の削除) # update-rc.d fetchmail defaults (自動起動スクリプト登録) |
| # apt-get install procmail |
| # see /usr/share/postfix/main.cf.dist
for a commented, fuller # version of this file. # Do not change these directory settings - they are critical to Postfix # operation. command_directory = /usr/sbin daemon_directory = /usr/lib/postfix program_directory = /usr/lib/postfix smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU) setgid_group = postdrop biff = no # appending .domain is the MUA's job. append_dot_mydomain = no myhostname = karappi.minidns.net mydomain = karappi.minidns.net alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = $mydomain mydestination = $myhostname, localhost.$mydomain, $mydomain, localhost relayhost = mynetworks = 127.0.0.0/8, 192.168.0.0/24 mailbox_command = procmail -a "$EXTENSION" #home_mailbox=Maildir/ Maildirは使わない。複数のメールサーバに対応しないから mailbox_size_limit = 0 recipient_delimiter = + allow_mail_to_commands=alias,forward,include smtpd_sasl_auth_enable = yes smtpd_sasl_security_options = noanonymous,noplaintext smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,permit_auth_destination,reject broken_sasl_auth_clients = yes |
| PATH=/bin:/usr/bin:/usr/local/bin
<--環境変数の設定 MAILDIR=$HOME/Maildir <--メールディレクトリへのパス DEFAULT=$MAILDIR/ <---デフォルト(下の振り分け以外のメールの格納先 LOGFILE=$MAILDIR/procmail.log <-- ログの保存場所 LOCKFILE=$HOME/.lockmail <-- ロックファイルのパス :0 <-----メールヘッダがhogezouからのメールの振り分け * ^X-ML-Name: hogezou .ML.test/ :0 <-----From行がhoge@hogesearver.jpからのメールの振り分け * ^From: hoge@hogeserver.jp .hoge-mail/ |
| procmail & |
| # chmod 755 procmail.sh # update-rc.d procmail.sh defaults 99 |
| # apt-get install
courier-imap |
| # /etc/init.d/courier-imap
restart # /etc/init.d/courier-authdaemon restart |
| #authmodulelist="authpam" authmodulelist="authcram authpam" |
| AUTHMODULES="authdaemon" |
| # IMAP_CAPABILITY="IMAP4rev1
CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT" |
| IMAP_CAPABILITY="IMAP4rev1
CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT AUTH=CRAM-MD5
AUTH=CRAM-SHA1" IMAP_CAPABILITY_ORIG="IMAP4rev1 CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT AUTH=CRAM-MD5 AUTH=CRAM-SHA1 IDLE" |
| # pw2userdb | grep hogehoge
> /etc/courier/userdb |
| # chmod 700 /etc/courier/userdb |
| # userdbpw -hmac-md5 |
userdb hogehoge set imap-hmac-md5pw Password: (パスワード) Reenter password (パスワード) # makeuserdb |
| $ maildirmake Maildir |