in certain circumstances, you want to create a machine that can send emails, but you do not have control over the DNS records. Here's how use postfix with an email account hosted by someone else.

body common control {
  bundlesequence => {
    "postfix",
  };
  inputs => {
    "cfengine_stdlib.cf",
  };
}

bundle agent postfix
{
vars:
  "prefix" string => "$(this.bundle)";
  "postfix_pkgs"     slist => {
              "postfix",
              "sasl2-bin",
              "libsasl2-2",
              "libsasl2-modules",
  };
# here the custom part
  "smtp_server" string => "auth.smtp.example.org";
  "mail_domain" string => "example.org";
  "mail_error_addr" string => "user@example.org";
  "remote_user[name]" string => "user";
  "remote_user[pass]" string => "pass";
  "postfix_aliases" string =>
    "root : admin
    admin : $(mail_error_addr)",
          comment => "full flat config file in a string";
  "postfix_canonical" string =>
    "root $(mail_error_addr)
    admin $(mail_error_addr) 
    cron $(mail_error_addr)",
         comment => "full flat config file in a string";
 
# now the autonomous part

  "postfix_main_cf"
    string =>"
    delay_warning_time = 15m
    bounce_notice_recipient = $(mail_error_addr)
    delay_notice_recipient  = $(mail_error_addr)
    error_notice_recipient  = $(mail_error_addr)
    myhostname = $(sys.uqhost).$(mail_domain)
    alias_maps = hash:/etc/postfix/aliases
    alias_database = hash:/etc/postfix/aliases
    canonical_maps = hash:/etc/postfix/canonical
    mydomain = $(mail_domain)
    myorigin = $(mail_domain)
    mydestination =>
    mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = 127.0.0.1
    inet_protocols = ipv4
    smtp_use_tls=yes
    smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
    smtp_sasl_tls_security_options = noanonymous
    tls_random_source = dev:/dev/urandom
    smtp_sasl_auth_enable = yes
    relayhost=[$(smtp_server)]:587
    smtp_sasl_password_maps=hash:/etc/postfix/sasl_passwd
    smtp_sasl_security_options = noanonymous
    biff = no
    #append_dot_mydomain = no
    ",
    comment => "entire main.cf file to be expanded";
classes:
  "reload_postfix" or => {"postfix_aliases_changed","postfix_sasl_passwd_changed", "postfix_canonical_changed"};
  "restart_postfix" or => {"postfix_main_changed"};
files:
  "/etc/postfix/main.cf"
    create => "true",
           perms => mog("644", "root", "root"),
           edit_defaults => empty,
           edit_line => expand_block_line($(postfix_main_cf)),
           classes => if_repaired(postfix_main_changed);
  "/etc/postfix/aliases"
    create => "true",
           perms => mog("644", "root", "root"),
           edit_defaults => empty,
           edit_line => expand_block_line($(postfix_aliases)),
           classes => if_repaired(postfix_aliases_changed);
  "/etc/postfix/canonical"
    create => "true",
           perms => mog("644", "root", "root"),
           edit_defaults => empty,
           edit_line => expand_block_line($(postfix_canonical)),
           classes => if_repaired(postfix_canonical_changed);
  "/etc/postfix/sasl_passwd"
    create => "true",
           edit_defaults => empty,
           perms => mog("600", "root", "root"),
           edit_line => append_if_no_line("[$(smtp_server)]:587 $(remote_user[name])@$(mail_domain):$(remote_user[pass])"),
           classes => if_repaired(postfix_sasl_passwd_changed);
packages:
  "$(postfix_pkgs)"
    handle => "postfix_packages_add",
           comment => "install needed system packages",
           package_policy => "add",
           package_method => generic,
           classes => if_repaired("packages_added");
commands:
  postfix_sasl_passwd_changed::
    "/usr/sbin/postmap /etc/postfix/sasl_passwd";
  postfix_aliases_changed::
    "/usr/sbin/postalias /etc/postfix/aliases";
  postfix_canonical_changed::
    "/usr/sbin/postmap /etc/postfix/canonical";
  reload_postfix.!restart_postfix::
    "/etc/init.d/postfix reload";
  restart_postfix::
    "/etc/init.d/postfix restart";
}
bundle edit_line expand_block_line(line)
{
insert_lines:
  "$(line)"
    insert_type => "preserve_block",
                comment => "Expand variables in the template string",
                expand_scalars => "true";
}