Mailhandler uses commands to set/change some settings on the nodes and comments that are created when a mailhandler mailbox is processed. The available commands, and the process for configuring them, will vary depending on what modules you have installed and which branch of Mailhandler you are using.

Overview of commands and syntax

Commands can be defined in two places: as default commands on a mailbox and in an email body itself. Default commands are defined when configuring a mailbox (in 1.x) or Feeds Importer using the Mailhandler Parser (2.x). Per-message commands can be specified in the body of an email which is then sent to a mailhandler mailbox address. Commands in an incoming email will take precedence over default commands in the case that the same command is used in the default settings as well as in the message body (but with different values).

Command syntax should be one command per line, starting with the name of the command, followed by a colon (:), then one space, then the value for that command. For example:

type: blog
status: 0
taxonomy: [term1, term2]

... would, assuming everything else is configured correctly, produce a node with content type 'blog', unpublished status, and tagged with 'term1' and 'term2'.

If you are entering commands directly in an email body, the commands must be at the top of the message body. The first line found where there is no line like "key: value" the commands will stop getting collected. For example, if you enter:

type: blog
status: 0
some random text here
taxonomy: [term1, term2]

... this will produce an unpublished 'blog' post with no taxonomy terms (since the line "some random text here" will end the scanning for commands).

Detailed instructions

Beyond this, commands are handled quite differently in the 1.x and 2.x branches of Mailhandler. Refer to the child book page for the appropriate version for more information.