# Example configuration. Each configuration option presented shows its default, so sensible.
# NB: THIS FILE *WILL* INCLUDE IMAP CREDENTIALS. ENSURE SENSIBLE ACCESS RIGHTS!

## Target
target:
  # scheme: either imap or imaps; if omitted, it is deduced from the port
  scheme: imap
  # user
  user: test@example.com
  # password
  password: passw0rd
  # host, without the port
  host: mail.example.com
  # port; optional if scheme is given
  port: 143
  # root denotes the root of the hierarchy for all feeds. Probably should start with INBOX, but may also be empty.
  # The allowed delimiter in the path is either '/' as a default, or the one used by your mailserver, if so known (for
  # example: '.').
  root: INBOX/Feeds
# Instead of the verbose target, specifiying a URI is also legitimate. Be sure to properly url-encode user and password.
# The example from above would read:
# target: imap://test%40example.com:passw0rd@mail.example.com:143/INBOX/Feeds

# NB: Instead of specifying the target on the global level, for compatibility with old configurations, it is also allowed
# to specify the full URL string for each feed.
# When doing so, _all_ target strings must point to the same server, else an error will be thrown.
# See https://github.com/Necoro/feed2imap-go/issues/6 for more details.

## Global Options
# Location of the cache. Can also be overwritten on the command line.
cache: "/data/data/com.termux/cache/feed2imap-go/feed"
# Timeout in seconds for fetching feeds.
timeout: 30
# Maximum number of failures allowed before they are reported in normal mode.
# By default, failures are only visible in verbose mode. Most feeds tend to suffer from temporary failures.
max-failures:  10
# Maximum number of concurrent IMAP connections opened.
max-imap-connections: 5
# Parts to generate in the resulting emails.
# Valid parts are "text" and "html"
parts: ["text", "html"]
# Overwrite the default template for text/html.
# See https://github.com/Necoro/feed2imap-go/wiki/Detailed-Options for more information.
html-template: html.tpl
text-template: text.tpl
# Email-Address to use in 'From' and 'To' when not specified in feed.
# Default uses 'current user'@hostname
default-email: username@hostname
# Whether the target folder determination for each feed shall fallback on the feed's/group's name.
# When `true`, omitting a target is identical to specifying the name as the target.
# When `false`, omitting a target is identical to specifying `null` or `""` as the target.
auto-target: true

## Per-Feed Options
# Defaults for options per feed, overridable in each feed and group
# NB: For compatibility with old feed2imap, options existing in feed2imap can also be specified at the toplevel,
# i.e. not beneath 'options'. Triggers a warning though :)
options:
  # Frequency in hours for checking. 0 = on each run.
  min-frequency: 0
  # Include images referenced in the item per URL in the mail.
  # For instance, when a feed item includes <img src="https://some.example/foo.png">, this image is fetched
  # and included in the mail.
  include-images: true
  # By default, images are added as an additional part to the email and referred to in the HTML part.
  # If you, for some reason, prefer the images to be directly encoded in the HTML part, set this option to true.
  # Without function when `include-images` is false.
  embed-images: false
  # Specify what type of a feed item determines the message's body.
  # Values:
  #  - default: default heuristics
  #  - content: Use the 'content' tag
  #  - description: Use the 'description' tag
  #  - both: Use both
  #  - fetch: Ignore the body delivered by the feed and instead fetch the linked website.
  #           It may be advisable to set `include-images` to false in that mode to avoid unexpected large mails.
  body: default
  # Disable a feed. Beats commenting ;)
  disable: false
  # Disable certificate verification for HTTPS connections.
  # This is sometimes needed, when a site delivers broken certificate (chains).
  tls-no-verify: false
  # Some feeds change the content of their items all the time, so we detect that they have been updated at each run.
  # When this option is enabled, the content of an item is ignored when determining whether this item is already known.
  ignore-hash: false
  # We employ a clever algorithm to determine whether an item is new or has been updated. This does not always work
  # perfectly. When this flag is enabled, all items which don't match exactly any previously downloaded item are
  # considered as new items.
  always-new: false
  # If an item is updated, but has been deleted on the server already, it is re-uploaded when this option is true.
  # Else it is ignored.
  reupload-if-updated: false
  # Items of a feed may be filtered. In general there is no real use in specifying this globally.
  # For full information about this feature, visit https://github.com/Necoro/feed2imap-go/wiki/Detailed-Options.
  item-filter: 'Author.Name != "Weirdo"'

## Feeds
# Each feed must have a name, and a URL or Exec argument. The name must be unique.
# The name also determines the folder to use for that feed, which can be overwritten with an explicit target.
# This behavior can be changed by toggling the global option `auto-target` (see above).
# Groups can be used to build a hierarchy, with arbitrary nesting.
feeds:
  - name: XKCD
    url: http://xkcd.com/rss.xml
    # specify any per feed option to overwrite it for this feed
    min-frequency: 12
    # No target has been defined, so it falls back onto the feed's name.
    # Combined with the global `target`, the final folder will be:
    #   INBOX/Feeds/XKCD
    # Would the global option `auto-target` been set to `false`, this fallback would not occur,
    # and the final folder would be:
    #   INBOX/Feeds
  # Groups can be used for, well, grouping.
  - group: Linux
    # You can specify options on group level that are then used for all feeds contained
    min-frequency: 6
    feeds:
      - name: Arch Linux
        # Use `target` to specify the folder name.
        # Together with the group folder this now spells 'Linux/Arch'.
        # Considering the global `target` the final folder will be:
        #  INBOX/Feeds/Linux/Arch
        target: Arch
        # Use `exec` instead of `url` when fetching is not enough and script magic is needed.
        # See https://github.com/Necoro/feed2imap-go/wiki/Detailed-Options for details.
        exec: ["wget", "https://www.archlinux.org/feeds/news/", "-O", "-"]
        # Groups can be nested...
      - group: Gentoo
        # and also specify a target (which is superfluous here, because it is identical to the group name)
        target: Gentoo
        feeds:
            - name: Planet Gentoo
              # An empty target omits the creation of a folder for this feed and uses the one from the level above.
              # Thus "Planet Gentoo" and "Gentoo News" will finally reside in 'Linux/Gentoo'
              target:
              url: https://planet.gentoo.org/atom.xml
              min-frequency: 24
            - name: Gentoo News
              target:
              url: https://gentoo.org/feeds/news.xml
              min-frequency: 24
  - group: News
    feeds:
      - name: Heise
        url: http://www.heise.de/newsticker/heise-atom.xml
        ignore-hash: true
      - name: Spiegel
        url: http://www.spiegel.de/schlagzeilen/index.rss
      - group: Süddeutsche
        target: SZ
        feeds:
          - name: Bayern
            url: http://rssfeed.sueddeutsche.de/c/795/f/448243/index.rss
            target:
          - name: München
            url: http://rssfeed.sueddeutsche.de/c/795/f/448324/index.rss
            target:
      - group: ZEIT Online
        target: Zeit
        feeds:
          - name: Digital
            url: http://newsfeed.zeit.de/digital/index
            target:

# vim: ft=yaml:sts=2:expandtab
