"Fossies" - the Fresh Open Source Software Archive

Member "getmail-5.16/docs/getmailrc-examples" (6 Aug 2009, 6294 Bytes) of package /linux/misc/getmail-5.16.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #
    2 # This file contains various examples of configuration sections to use
    3 # in your getmail rc file.  You need one file for each mail account you
    4 # want to retrieve mail from.  These files should be placed in your
    5 # getmail configuration/data directory (default: $HOME/.getmail/).
    6 # If you only need one rc file, name it getmailrc in that directory,
    7 # and you won't need to supply any commandline options to run getmail.
    8 #
    9 
   10 #
   11 # Example 1:  simplest case of retrieving mail from one POP3 server and
   12 # storing all messages in a maildir.
   13 #
   14 
   15 [retriever]
   16 type = SimplePOP3Retriever
   17 server = pop.example.net
   18 username = jeff.plotzky
   19 password = mailpassword
   20 
   21 [destination]
   22 type = Maildir
   23 path = ~jeffp/Maildir/
   24 
   25 #
   26 # Example 2:  same as (1), but operate quietly, delete messages from
   27 # the server after retrieving them, and log getmail's actions (in detail)
   28 # to a file.
   29 #
   30 
   31 [options]
   32 verbose = 0
   33 delete = true
   34 message_log = ~/.getmail/log
   35 message_log_verbose = true
   36 
   37 [retriever]
   38 type = SimplePOP3Retriever
   39 server = pop.example.net
   40 username = jeff.plotzky
   41 password = mailpassword
   42 
   43 [destination]
   44 type = Maildir
   45 path = ~jeffp/Maildir/
   46 
   47 #
   48 # Example 3: same as (1), but the mail account is accessed via IMAP4 instead
   49 # of POP3.
   50 #
   51 
   52 [retriever]
   53 type = SimpleIMAPRetriever
   54 server = mail.example.net
   55 username = jeff.plotzky
   56 password = mailpassword
   57 
   58 [destination]
   59 type = Maildir
   60 path = ~jeffp/Maildir/
   61 
   62 #
   63 # Example 4: same as (3), but retrieve mail from the INBOX, INBOX.spam, and
   64 # mailing-lists.getmail-users mail folders.
   65 #
   66 
   67 [retriever]
   68 type = SimpleIMAPRetriever
   69 server = mail.example.net
   70 username = jeff.plotzky
   71 password = mailpassword
   72 mailboxes = ("INBOX", "INBOX.spam", "mailing-lists.getmail-users")
   73 
   74 [destination]
   75 type = Maildir
   76 path = ~jeffp/Maildir/
   77 
   78 #
   79 # Example 5: same as (3), but move messages to the mail folder "sent-mail"
   80 # after retrieving them.  Note that you do this by setting delete and
   81 # move_on_delete options.
   82 #
   83 
   84 [options]
   85 delete = true
   86 
   87 [retriever]
   88 type = SimpleIMAPRetriever
   89 server = mail.example.net
   90 username = jeff.plotzky
   91 password = mailpassword
   92 move_on_delete = sent-mail
   93 
   94 [destination]
   95 type = Maildir
   96 path = ~jeffp/Maildir/
   97 
   98 #
   99 # Example 6:  same as (1), but deliver the messages to an mboxrd-format mbox
  100 # file as user "jeffp".
  101 #
  102 
  103 [retriever]
  104 type = SimplePOP3Retriever
  105 server = pop.example.net
  106 username = jeff.plotzky
  107 password = mailpassword
  108 
  109 [destination]
  110 type = Mboxrd
  111 path = ~jeffp/Mail/inbox
  112 user = jeffp
  113 
  114 #
  115 # Example 7:  same as (1), but deliver the messages through an external MDA
  116 # which takes several arguments.
  117 #
  118 
  119 [retriever]
  120 type = SimplePOP3Retriever
  121 server = pop.example.net
  122 username = jeff.plotzky
  123 password = mailpassword
  124 
  125 [destination]
  126 type = MDA_external
  127 path = /usr/local/bin/my-mda
  128 arguments = ("--message-from-stdin", "--scan-message", "--to-maildir",
  129   "~jeffp/Maildir/")
  130 
  131 #
  132 # Example 8:  retrieve mail from a corporate POP3-SSL domain mailbox,
  133 # sort messages for several local users and deliver to maildirs in their
  134 # home directories (except Sam, who likes mbox files, and Christina, who
  135 # uses procmail for further sorting), and deliver all other mail to
  136 # Joe, who serves as postmaster for the company.  Sam also needs
  137 # to receive mail for "sam1", "sam23", etc, so we use a regular expression
  138 # matching "sam" plus zero or more decimal digits.
  139 #
  140 
  141 [retriever]
  142 type = MultidropPOP3SSLRetriever
  143 server = pop.example.net
  144 username = companylogin
  145 password = mailpassword
  146 # Our domain mailbox mailhost records the envelope recipient address in a
  147 # new Delivered-To: header field at the top of the message.
  148 envelope_recipient = delivered-to:1
  149 
  150 [destination]
  151 type = MultiSorter
  152 default = [postmaster]
  153 locals = (
  154   ("jeffk@company.example.net",      "[jeff]"),
  155   ("martinh@company.example.net",    "[martin]"),
  156   (r"sam\D*@company.example.net",    "[sam]"),
  157   ("c.fellowes@company.example.net", "[christina-procmail]")
  158   )
  159 
  160 [postmaster]
  161 type = Maildir
  162 path = ~joe/Mail/postmaster/
  163 user = joe
  164 
  165 [jeff]
  166 type = Maildir
  167 path = ~jeffp/Maildir/
  168 user = jeffp
  169 
  170 [martin]
  171 type = Maildir
  172 path = ~martinh/Maildir/
  173 user = martinh
  174 
  175 [sam]
  176 type = Mboxrd
  177 path = ~sam/Mail/inbox
  178 user = sam
  179 
  180 [christina-procmail]
  181 type = MDA_external
  182 path = /usr/local/bin/procmail
  183 # procmail requires either that the message starts with an mboxrd-style
  184 # "From " line (which getmail can generate by setting "unixfrom" to True), or
  185 # that the -f option is provided as below.
  186 arguments = ("-f", "%(sender)", "-m", "/home/christina/.procmailrc")
  187 user = christina
  188 
  189 #
  190 # Example 9: same as (3), but use SpamAssassin to filter out spam,
  191 # and ClamAV to filter out MS worms.
  192 #
  193 
  194 [retriever]
  195 type = SimpleIMAPRetriever
  196 server = mail.example.net
  197 username = jeff.plotzky
  198 password = mailpassword
  199 
  200 [filter-1]
  201 type = Filter_external
  202 path = /usr/local/bin/spamc
  203 
  204 [filter-2]
  205 type = Filter_classifier
  206 path = /usr/local/bin/clamscan
  207 arguments = ("--stdout", "--no-summary",
  208     "--mbox", "--infected", "-")
  209 exitcodes_drop = (1,)
  210 
  211 [destination]
  212 type = Maildir
  213 path = ~jeffp/Maildir/
  214 
  215 #
  216 # Example 10: same as (3), but deliver all mail to two different local
  217 # mailboxes.
  218 #
  219 
  220 [retriever]
  221 type = SimpleIMAPRetriever
  222 server = mail.example.net
  223 username = jeff.plotzky
  224 password = mailpassword
  225 
  226 [destination]
  227 type = MultiDestination
  228 destinations = (
  229     "~jeff/Maildir/",
  230     "/var/log/mail-archive/current",
  231     )
  232 
  233 #
  234 # Example 11:  retrieve mail from a simple (non-multidrop) POP3 mailbox.
  235 # Then extract addresses from the message header (see documentation for which
  236 # fields are examined), and deliver mail containing the address
  237 # <list1@domain.example.net> to ~/Mail/lists/list1/, mail containing the
  238 # address <list2@otherdomain.example.com> to ~/Mail/lists/list2/,
  239 # mail containing the address <othername@example.org> to ~/Mail/other/,
  240 # and all other mail gets delivered through the external MDA program
  241 # "my-mda" with some default arguments.
  242 #
  243 
  244 [retriever]
  245 type = SimplePOP3Retriever
  246 server = pop.example.net
  247 username = jeff.plotzky
  248 password = mailpassword
  249 
  250 [destination]
  251 type = MultiGuesser
  252 default = [my-mda]
  253 locals = (
  254     ("list1@domain.example.net",        "~/Mail/lists/list1/"),
  255     ("list2@otherdomain.example.com",   "~/Mail/lists/list2/"),
  256     ("othername@example.org",           "~/Mail/other/"),
  257     )
  258 
  259 [my-mda]
  260 type = MDA_external
  261 path = /path/to/my-mda
  262 arguments = ("-f", "%(sender)", "${HOME}/.mymdarc")