2 # This is a configuration file of imapami.
3 # It is written in YAML.
4 # The full documentation of this configuration file is displayed
6 # imapami --config-help
10 # Hostname or IP address of the IMAP server to connect to.
11 server: imap.example.com
14 # The TCP port to connect to. If not specified, use the default,
15 # depending on whether SSL is enabled or disabled.
19 # Enable or disable SSL (True or False).
23 # IMAP login name. If not specified, the login is asked on stdin.
27 # IMAP password. If not specified, the password is asked on stdin.
28 password: cocolasticot
31 # File where messages are logged. If not specified, no logs are
36 # Level of logs written in logfile. Possible value are from 0 (no log)
37 # to 4 (debug). Default value is 3 (info).
41 # Default mailbox directory to get message from. If not specified,
45 # Any field that is not a reserved keyword is saved as a variable,
46 # and can be reused in rules with {var_name}.
49 # List of rules. Each rule is composed of several fields:
50 # - the directory where the rule apply ("inbox"). If not specified,
51 # the default mailbox directory is used.
52 # - a list condition ("if"). All of them must be true to match
53 # the rule. They are all evaluated in the order they appear.
54 # - a list of action ("do"). They are all executed in the order
56 # - a list of actions executed when condition does not match
58 # - a list of actions executed on error when processing an
59 # action list ("on-error-do").
62 # move some spam in another directory and mark as seen
66 - regexp: {field: X-Spam-Status, pattern: 'Yes'}
67 - regexp: {field: Subject, pattern: '[Vv]iagra'}
69 - log: {msg: 'spam:\n Subject: {Subject}\n From: {From}\n To: {To}', level: 4}
73 # move mailing list mails in a directory
74 - name: mailing list foo
76 - regexp: {field: Subject, pattern: '\[foo\]'}
81 # log if at least one ml message was processed
82 - name: log if some mailing list messages
86 - log: {msg: 'some messages for mailing list'}
88 # pipe automation tasks to a script and mark as seen
91 - regexp: {field: Subject, pattern: '\[auto\]'}
93 - pipe: {command: '/usr/bin/my-prog'}
96 # move mail whose To or Cc is me into another directory
100 - to: {substr: '{me}'}
101 - cc: {substr: '{me}'}
103 - move: {dest: urgent}