# salt.modules.postfix

Support for Postfix

This module is currently little more than a config file viewer and editor. It is able to read the master.cf file (which is one style) and files in the style of main.cf (which is a different style, that is used in multiple postfix configuration files).

The design of this module is such that when files are edited, a minimum of changes are made to them. Each file should look as if it has been edited by hand; order, comments and whitespace are all preserved.

salt.modules.postfix.delete(queue_id)

  Delete message(s) from the mail queue

  CLI Example:

      salt '*' postfix.delete 5C33CA0DEA

      salt '*' postfix.delete ALL

salt.modules.postfix.hold(queue_id)

  Put message(s) on hold from the mail queue

  CLI Example:

      salt '*' postfix.hold 5C33CA0DEA

      salt '*' postfix.hold ALL

salt.modules.postfix.requeue(queue_id)

  Requeue message(s) in the mail queue

  CLI Example:

      salt '*' postfix.requeue 5C33CA0DEA

      salt '*' postfix.requeue ALL

salt.modules.postfix.set_main(key, value, path='/etc/postfix/main.cf')

  Set a single config value in the main.cf file. If the value does not already exist, it will be appended to the end.

  CLI Example:

      salt <minion> postfix.set_main mailq_path /usr/bin/mailq

salt.modules.postfix.set_master(service, conn_type, private='y', unpriv='y', chroot='y', wakeup='n', maxproc='100', command='', write_conf=True, path='/etc/postfix/master.cf')

  Set a single config value in the master.cf file. If the value does not already exist, it will be appended to the end.

  Because of shell parsing issues, '-' cannot be set as a value, as is normal in the master.cf file; either 'y', 'n' or a number should be used when calling this function from the command line. If the value used matches the default, it will internally be converted to a '-'. Calling this function from the Python API is not affected by this limitation

  The settings and their default values, in order, are: service (required), conn_type (required), private (y), unpriv (y), chroot (y), wakeup (n), maxproc (100), command (required).

  By default, this function will write out the changes to the master.cf file, and then returns the full contents of the file. By setting the `write_conf` option to `False`, it will skip writing the file.

  CLI Example:

      salt <minion> postfix.set_master smtp inet n y n n 100 smtpd

salt.modules.postfix.show_main(path='/etc/postfix/main.cf')

  Return a dict of active config values. This does not include comments, spacing or order. Bear in mind that order is functionally important in the main.cf file, since keys can be referred to as variables. This means that the data returned from this function should not be used for direct modification of the main.cf file; other functions are available for that.

  CLI Examples:

      salt <minion> postfix.show_main
      salt <minion> postfix.show_main path=/path/to/main.cf

salt.modules.postfix.show_master(path='/etc/postfix/master.cf')

  Return a dict of active config values. This does not include comments, spacing or order.

  The data returned from this function should not be used for direct modification of the main.cf file; other functions are available for that.

  CLI Examples:

      salt <minion> postfix.show_master
      salt <minion> postfix.show_master path=/path/to/master.cf

salt.modules.postfix.show_queue()

  Show contents of the mail queue

  CLI Example:

      salt '*' postfix.show_queue

salt.modules.postfix.unhold(queue_id)

  Set held message(s) in the mail queue to unheld

  CLI Example:

      salt '*' postfix.unhold 5C33CA0DEA

      salt '*' postfix.unhold ALL