}
uri = "smtp://192.0.20.1/"
timeout = 5s
-# username_attribute = &User-Name
-# password_attribute = &User-Password
+ authenticate {
+# username = User-Name
+# password = User-Password
+ }
# username = "user"
# password = "secret"
template_directory = raddb/mods_config/smtp
- attachments = &SMTP-Attachments[*]
+ attachments = SMTP-Attachments[*]
envelope_address = "postmaster@localhost"
- sender_address = &SMTP-Sender-Address[*]
-# recipients = &SMTP-Recipients[*]
-# recipients = &SMTP-TO[*]
-# recipients = &SMTP-CC[*]
-# recipients = &SMTP-BCC[*]
-# to = &SMTP-TO[*]
-# cc = &SMTP-CC[*]
-# bcc = &SMTP-BCC[*]
+ sender_address = SMTP-Sender-Address[*]
+# recipients = SMTP-Recipients[*]
+# recipients = SMTP-TO[*]
+# recipients = SMTP-CC[*]
+# recipients = SMTP-BCC[*]
+# to = SMTP-TO[*]
+# cc = SMTP-CC[*]
+# bcc = SMTP-BCC[*]
# set_date = yes
header {
subject = "email subject"
timeout = 5s
#
- # username_attribute:: Which attribute in the request should be used as
- # the user's username when performing SMTP authentication.
+ # authenticate: Configuration for verifying a users name and clear-text password
+ # against an SMTP server.
#
-# username_attribute = &User-Name
+ # This is not generally recommended, but is supported for cases where an LDAP server
+ # is not available, and only an SMTP server is available.
+ #
+ authenticate {
+ #
+ # username:: The users name when performing SMTP authentication.
+ #
+# username = User-Name
+
+ #
+ # password_attribute:: The users password when performing SMTP authentication
+ #
+# password = User-Password
+ }
#
- # password_attribute:: Which attribute in the request should be used as
- # the user's password when performing SMTP authentication.
+ # In most cases, the SMTP module will be used to send email.
#
-# password_attribute = &User-Password
#
# username:: User name to use when sending emails. Can be a fixed
# Attachments:: attachments with their relative path from template_directory
# There can be no leading / or ..
#
- attachments = &SMTP-Attachments[*]
+ attachments = SMTP-Attachments[*]
#
# envelope_address:: This is the address used to send the mail,
envelope_address = "postmaster@localhost"
#
- # sender_address:: This are the addresses displayed in the FROM: element of the header
- # This can be different than the provided envelope_address,
- # If envelope_address is set, this can be formatted however you want it to appear to the receiver
- # If envelope_address is not set, the first element in sender_address will be used as the envelope address
+ # sender_address:: Set the body `FROM` address.
+ #
+ # This can be different than the provided envelope_address.
+ #
+ # If envelope_address is set, this can be formatted however
+ # you want it to appear to the receiver.
#
- sender_address = &SMTP-Sender-Address[*]
+ # If envelope_address is not set, the first element in
+ # sender_address will be used as the envelope address.
+ #
+ sender_address = SMTP-Sender-Address[*]
#
# recipients:: Email addresses to be set as recipients for the email
- # If recipients is set bcc, cc, and to will not be automatically added to the email
- # And so they must be included here.
#
-# recipients = &SMTP-Recipients[*]
-# recipients = &SMTP-TO[*]
-# recipients = &SMTP-CC[*]
-# recipients = &SMTP-BCC[*]
+ # If recipients is set, then `bcc`, `cc`, and `to` will not
+ # be automatically added to the email. Only the list of
+ # `recipients` will be used.
+ #
+# recipients = SMTP-Recipients[*]
+# recipients = SMTP-TO[*]
+# recipients = SMTP-CC[*]
+# recipients = SMTP-BCC[*]
#
- # to:: Email addresses to be set in the TO: header
- # These addresses will be added as envelope recipients only if recipients is not set
+ # to:: Set the body `TO` header.
+ #
+ # If `recepients` is not set, then messages will be sent to the `TO` address.
+ #
+# to = SMTP-TO[*]
+
#
-# to = &SMTP-TO[*]
+ # cc:: Set the body `CC` header.
#
- # cc:: Email addresses to be set in the CC: header
- # These addresses will be added as envelope recipients only if recipients is not set
+ # If `recepients` is not set, then messages will also be sent to the `CC` addresses.
#
-# cc = &SMTP-CC[*]
+# cc = SMTP-CC[*]
#
- # bcc:: Comma separated list of emails.
- # the local part may contain commas, the domain may not (RFC 2821)
- # Therefore, first comma after the @ represents a new address
- # not listed in the header of the email
- # if recipients is not set, these emails will be added to the envelope recipients
+ # bcc:: Set the `BCC` recipients.
+ #
+ # The local part may contain commas, the domain may not (RFC 2821)
+ #
+ # Therefore, the first comma after the @ represents a new
+ # address, and is not listed in the header of the email.
+ #
+ # If `recepients` is not set, then messages will also be sent to the `CCC` addresses.
#
-# bcc = &SMTP-BCC[*]
+# bcc = SMTP-BCC[*]
#
# set_date:: Adds a Date: to the header, set to the time the request is received
{ FR_CALL_ENV_PARSE_OFFSET("username", FR_TYPE_STRING, CALL_ENV_FLAG_NULLABLE | CALL_ENV_FLAG_CONCAT, rlm_smtp_env_t, username, username_tmpl),
.pair.dflt_quote = T_DOUBLE_QUOTED_STRING },
{ FR_CALL_ENV_OFFSET("password", FR_TYPE_STRING, CALL_ENV_FLAG_NULLABLE | CALL_ENV_FLAG_CONCAT, rlm_smtp_env_t, password), .pair.dflt_quote = T_DOUBLE_QUOTED_STRING },
- { FR_CALL_ENV_OFFSET("sender_address", FR_TYPE_STRING, CALL_ENV_FLAG_NONE, rlm_smtp_env_t, sender_address) },
- { FR_CALL_ENV_OFFSET("recipients", FR_TYPE_STRING, CALL_ENV_FLAG_NULLABLE, rlm_smtp_env_t, recipient_addrs),
- .pair.dflt = "&SMTP-Recipients[*]", .pair.dflt_quote = T_BARE_WORD },
- { FR_CALL_ENV_OFFSET("TO", FR_TYPE_STRING, CALL_ENV_FLAG_NULLABLE, rlm_smtp_env_t, to_addrs),
- .pair.dflt = "&SMTP-TO[*]", .pair.dflt_quote = T_BARE_WORD },
- { FR_CALL_ENV_OFFSET("CC", FR_TYPE_STRING, CALL_ENV_FLAG_NULLABLE, rlm_smtp_env_t, cc_addrs),
- .pair.dflt = "&SMTP-CC[*]", .pair.dflt_quote = T_BARE_WORD },
- { FR_CALL_ENV_OFFSET("BCC", FR_TYPE_STRING, CALL_ENV_FLAG_NULLABLE, rlm_smtp_env_t, bcc_addrs),
- .pair.dflt = "&SMTP-BCC[*]", .pair.dflt_quote = T_BARE_WORD },
- { FR_CALL_ENV_OFFSET("attachments", FR_TYPE_STRING, CALL_ENV_FLAG_NULLABLE, rlm_smtp_env_t, attachments),
- .pair.dflt = "&SMTP-Attachments[*]", .pair.dflt_quote = T_BARE_WORD },
+ { FR_CALL_ENV_OFFSET("sender_address", FR_TYPE_STRING, CALL_ENV_FLAG_BARE_WORD_ATTRIBUTE, rlm_smtp_env_t, sender_address) },
+ { FR_CALL_ENV_OFFSET("recipients", FR_TYPE_STRING, CALL_ENV_FLAG_NULLABLE | CALL_ENV_FLAG_BARE_WORD_ATTRIBUTE, rlm_smtp_env_t, recipient_addrs),
+ .pair.dflt = "SMTP-Recipients[*]", .pair.dflt_quote = T_BARE_WORD },
+ { FR_CALL_ENV_OFFSET("to", FR_TYPE_STRING, CALL_ENV_FLAG_NULLABLE | CALL_ENV_FLAG_BARE_WORD_ATTRIBUTE, rlm_smtp_env_t, to_addrs),
+ .pair.dflt = "SMTP-TO[*]", .pair.dflt_quote = T_BARE_WORD },
+ { FR_CALL_ENV_OFFSET("cc", FR_TYPE_STRING, CALL_ENV_FLAG_NULLABLE | CALL_ENV_FLAG_BARE_WORD_ATTRIBUTE, rlm_smtp_env_t, cc_addrs),
+ .pair.dflt = "SMTP-CC[*]", .pair.dflt_quote = T_BARE_WORD },
+ { FR_CALL_ENV_OFFSET("bcc", FR_TYPE_STRING, CALL_ENV_FLAG_NULLABLE | CALL_ENV_FLAG_BARE_WORD_ATTRIBUTE, rlm_smtp_env_t, bcc_addrs),
+ .pair.dflt = "SMTP-BCC[*]", .pair.dflt_quote = T_BARE_WORD },
+ { FR_CALL_ENV_OFFSET("attachments", FR_TYPE_STRING, CALL_ENV_FLAG_NULLABLE | CALL_ENV_FLAG_BARE_WORD_ATTRIBUTE, rlm_smtp_env_t, attachments),
+ .pair.dflt = "SMTP-Attachments[*]", .pair.dflt_quote = T_BARE_WORD },
{ FR_CALL_ENV_SUBSECTION_FUNC("header", CF_IDENT_ANY, CALL_ENV_FLAG_SUBSECTION, smtp_header_section_parse) },
CALL_ENV_TERMINATOR
static const call_env_method_t auth_env = {
FR_CALL_ENV_METHOD_OUT(rlm_smtp_auth_env_t),
.env = (call_env_parser_t[]) {
- { FR_CALL_ENV_PARSE_OFFSET("username_attribute", FR_TYPE_STRING,
- CALL_ENV_FLAG_ATTRIBUTE | CALL_ENV_FLAG_REQUIRED | CALL_ENV_FLAG_NULLABLE,
- rlm_smtp_auth_env_t, username, username_tmpl), .pair.dflt = "&User-Name", .pair.dflt_quote = T_BARE_WORD },
- { FR_CALL_ENV_PARSE_OFFSET("password_attribute", FR_TYPE_STRING,
- CALL_ENV_FLAG_ATTRIBUTE | CALL_ENV_FLAG_REQUIRED | CALL_ENV_FLAG_NULLABLE | CALL_ENV_FLAG_SECRET,
- rlm_smtp_auth_env_t, password, password_tmpl), .pair.dflt = "&User-Password", .pair.dflt_quote = T_BARE_WORD },
+ { FR_CALL_ENV_SUBSECTION("authenticate", NULL, CALL_ENV_FLAG_SUBSECTION | CALL_ENV_FLAG_PARSE_MISSING,
+ ((call_env_parser_t[]) {
+ { FR_CALL_ENV_PARSE_OFFSET("username", FR_TYPE_STRING,
+ CALL_ENV_FLAG_BARE_WORD_ATTRIBUTE | CALL_ENV_FLAG_REQUIRED | CALL_ENV_FLAG_NULLABLE,
+ rlm_smtp_auth_env_t, username, username_tmpl), .pair.dflt = "User-Name", .pair.dflt_quote = T_BARE_WORD },
+ { FR_CALL_ENV_PARSE_OFFSET("password", FR_TYPE_STRING,
+ CALL_ENV_FLAG_BARE_WORD_ATTRIBUTE | CALL_ENV_FLAG_REQUIRED | CALL_ENV_FLAG_NULLABLE | CALL_ENV_FLAG_SECRET,
+ rlm_smtp_auth_env_t, password, password_tmpl), .pair.dflt = "User-Password", .pair.dflt_quote = T_BARE_WORD },
+ CALL_ENV_TERMINATOR
+ }))},
CALL_ENV_TERMINATOR
}
};
template_directory = "$ENV{top_srcdir}build/ci/exim4"
envelope_address = "postmaster@localhost"
- attachments = &SMTP-Attachments[*]
+ attachments = SMTP-Attachments[*]
recipients = "conf_recipient_1@localhost"
recipients = "conf_recipient_2@localhost"
- recipients = &SMTP-Recipients[*]
- recipients = &SMTP-TO[*]
- recipients = &SMTP-CC[*]
+ recipients = SMTP-Recipients[*]
+ recipients = SMTP-TO[*]
+ recipients = SMTP-CC[*]
- TO = "conf_to@localhost"
- TO = &SMTP-TO[*]
+ to = "conf_to@localhost"
+ to = SMTP-TO[*]
- CC = &SMTP-CC[*]
+ cc = SMTP-CC[*]
set_date = no
}
recipients = "conf_recipient_1@localhost"
recipients = "conf_recipient_2@localhost"
- recipients = &SMTP-Recipients[*]
+ recipients = SMTP-Recipients[*]
- TO = "conf_to@localhost"
- TO = &SMTP-TO[*]
+ to = "conf_to@localhost"
+ to = SMTP-TO[*]
- CC = &SMTP-CC[*]
+ cc = SMTP-CC[*]
set_date = no
}
sender_address = "sender_email2@localhost"
envelope_address = "postmaster@localhost"
recipients = "crln_test_receiver@localhost"
- recipients = &SMTP-Recipients[*]
+ recipients = SMTP-Recipients[*]
set_date = no
}
message_id = "123456789@example.com"
}
- username = &User-Name
- password = &User-Password
+ username = "%{User-Name}"
+ password = "%{User-Password}"
uri = "$ENV{SMTP_TEST_SERVER}:$ENV{SMTP_TEST_SERVER_PORT}"
timeout = 5s
template_directory = "$ENV{top_srcdir}build/ci/exim4"
- sender_address = &SMTP-Sender-Address[*]
+ sender_address = SMTP-Sender-Address[*]
envelope_address = "postmaster@localhost"
recipients = "conf-stringparse-recipient@localhost"
- recipients = &SMTP-Recipients[*]
+ recipients = SMTP-Recipients[*]
set_date = no
}