Конфигурация · 5 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 и в файле getmailrc-examples, который идет в комплекте с файлом getmail.tar.gz, который вы можете скачать с http://pyropus.ca/software/getmail. Вот содержимое этого файла:

#

#

[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”)

Также посмотрите страницу man getmail:

man getmail 

чтобы узнать больше о доступных параметрах командной строки, которые вы можете передать getmail.

8 Ссылки

Share: X/Twitter LinkedIn

Get new posts in your inbox

No spam. Unsubscribe anytime.