メール設定 · 3 min read · Dec 31, 2025
リモートサーバーからのメールの取得 (getmail) - Debian Etch - ページ 3
6 サンプル設定ファイル
これは私の ~/.getmail/getmailrc ファイルの最終的な見た目です:
vi ~/.getmail/getmailrc| [retriever] type = SimplePOP3Retriever server = pop.someprovider.tld username = [email protected] password = secret [destination] type = Maildir path = ~/Maildir/ [options] verbose = 1 read_all = false delete = true message_log_syslog = true [filter-1] type = Filter_classifier path = /usr/bin/clamdscan arguments = ("--stdout", "--no-summary", "-") exitcodes_keep = (1, ) [filter-2] type = Filter_external path = /usr/bin/spamc arguments = ("-s 250000", ) |
7 さらなる設定例
さらなる設定例は http://pyropus.ca/software/getmail/configuration.html で見つけることができ、また getmail.tar.gz ファイルに付属する getmailrc-examples ファイルにもあります。以下はそのファイルの内容です:
#
#
[retriever]
type = SimplePOP3Retriever
server = pop.example.net
username = jeff.plotzky
password = mailpassword
[destination]
type = Maildir
path = ~jeffp/Maildir/
#
[options]
verbose = 0
delete = true
message_log = ~/.getmail/log
[retriever]
type = SimplePOP3Retriever
server = pop.example.net
username = jeff.plotzky
password = mailpassword
[destination]
type = Maildir
path = ~jeffp/Maildir/
#
[retriever]
type = SimpleIMAPRetriever
server = mail.example.net
username = jeff.plotzky
password = mailpassword
[destination]
type = Maildir
path = ~jeffp/Maildir/
#
[retriever]
type = SimpleIMAPRetriever
server = mail.example.net
username = jeff.plotzky
password = mailpassword
mailboxes = (“INBOX”, “INBOX.spam”, “mailing-lists.getmail-users”)
[destination]
type = Maildir
path = ~jeffp/Maildir/
#
[options]
delete = true
[retriever]
type = SimpleIMAPRetriever
server = mail.example.net
username = jeff.plotzky
password = mailpassword
move_on_delete = sent-mail
[destination]
type = Maildir
path = ~jeffp/Maildir/
#
[retriever]
type = SimplePOP3Retriever
server = pop.example.net
username = jeff.plotzky
password = mailpassword
[destination]
type = Mboxrd
path = ~jeffp/Mail/inbox
user = jeffp
#
[retriever]
type = SimplePOP3Retriever
server = pop.example.net
username = jeff.plotzky
password = mailpassword
[destination]
type = MDA_external
path = /usr/local/bin/my-mda
arguments = (“–message-from-stdin”, “–scan-message”, “–to-maildir”,
“~jeffp/Maildir/“)
#
[retriever]
type = MultidropPOP3SSLRetriever
server = pop.example.net
username = companylogin
password = mailpassword
envelope_recipient = delivered-to:1
[destination]
type = MultiSorter
default = [postmaster]
locals = (
(“ [email protected] “, “[jeff]”),
(“ [email protected] “, “[martin]”),
(r”sam\D*@company.example.net”, “[sam]”),
(“ [email protected] “, “[christina-procmail]”)
)
[postmaster]
type = Maildir
path = ~joe/Mail/postmaster/
user = joe
[jeff]
type = Maildir
path = ~jeffp/Maildir/
user = jeffp
[martin]
type = Maildir
path = ~martinh/Maildir/
user = martinh
[sam]
type = Mboxrd
path = ~sam/Mail/inbox
user = sam
[christina-procmail]
type = MDA_external
path = /usr/local/bin/procmail
arguments = (“-f”, “%(sender)”, “-m”, “/home/christina/.procmailrc”)
user = christina
#
[retriever]
type = SimpleIMAPRetriever
server = mail.example.net
username = jeff.plotzky
password = mailpassword
[filter-1]
type = Filter_external
path = /usr/local/bin/spamc
[filter-2]
type = Filter_classifier
path = /usr/local/bin/clamscan
arguments = (“–stdout”, “–no-summary”,
“–mbox”, “–infected”, “-“)
exitcodes_drop = (1,)
[destination]
type = Maildir
path = ~jeffp/Maildir/
#
[retriever]
type = SimpleIMAPRetriever
server = mail.example.net
username = jeff.plotzky
password = mailpassword
[destination]
type = MultiDestination
destinations = (
“~jeff/Maildir/“,
“/var/log/mail-archive/current”,
)
#
[retriever]
type = SimplePOP3Retriever
server = pop.example.net
username = jeff.plotzky
password = mailpassword
[destination]
type = MultiGuesser
default = [my-mda]
locals = (
(“ [email protected] “, “~/Mail/lists/list1/“),
(“ [email protected] “, “~/Mail/lists/list2/“),
(“ [email protected] “, “~/Mail/other/“),
)
[my-mda]
type = MDA_external
path = /path/to/my-mda
arguments = (“-f”, “%(sender)”, “${HOME}/.mymdarc”)
また、getmail マンページもご覧ください:
man getmail getmail に渡すことができる利用可能なコマンドラインパラメータについて詳しく学ぶことができます。
8 リンク
- Getmail: http://pyropus.ca/software/getmail
- SpamAssassin: http://spamassassin.apache.org
- ClamAV: http://www.clamav.net
- Debian: http://www.debian.org
新しい投稿を受信箱で受け取る
スパムはありません。いつでも購読を解除できます。