Skip to content

Commit e4d03a3

Browse files
committed
Tidy comments for sample rlm_smtp config
1 parent 0e9c897 commit e4d03a3

File tree

2 files changed

+114
-72
lines changed
  • doc/antora/modules/reference/pages/raddb/mods-available
  • raddb/mods-available

2 files changed

+114
-72
lines changed

doc/antora/modules/reference/pages/raddb/mods-available/smtp.adoc

Lines changed: 77 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -158,91 +158,115 @@ the underlying mail protocols. The URI should be in the form of:
158158
`SCHEME://IP:PORT/`
159159

160160

161-
`SCHEME` can be one of the SMTP protocols supported by Curl.
162-
i.e. smtp, smtps.
163-
If no `SCHEME` is given, it defaults to `smtp`.
161+
* `SCHEME` can be one of the SMTP protocols supported by Curl.
162+
i.e. smtp, smtps.
163+
If no `SCHEME` is given, it defaults to `smtp`.
164164

165-
`IP` is the IP address of the server. It can be an IPv4 address,
166-
IPv6 address, hostname, etc.
165+
* `IP` is the IP address of the server. It can be an IPv4 address,
166+
IPv6 address, hostname, etc.
167167

168-
`PORT` is optional, and will normally be chosen to be correct
169-
for the given `SCHEME`.
168+
* `PORT` is optional, and will normally be chosen to be correct
169+
for the given `SCHEME`.
170170

171-
For more information, see the CURL documentation at
171+
For more information, see the CURL documentation at:
172172

173173
https://ec.haxx.se/cmdline/cmdline-urls
174174

175175

176176

177-
timeout:: How long the module will wait before giving up on the response
177+
timeout:: How long the module will wait, before giving up on the response
178178
from the SMTP server.
179179

180180

181181

182-
username_attribute:: Which attribute in the request should be used as
183-
the user's username when performing SMTP authentication.
182+
authenticate: Configuration for verifying a users name and clear-text password
183+
against an SMTP server.
184184

185+
This is not generally recommended, but is supported for cases where an LDAP server
186+
is not available, and only an SMTP server is available.
185187

186188

187-
password_attribute:: Which attribute in the request should be used as
188-
the user's password when performing SMTP authentication.
189+
username:: The users name when performing SMTP authentication.
189190

190191

191192

192-
username:: User name to use when sending emails. Can be a fixed
193-
string or an attribute. Leave unset if authentication is not
194-
required to send emails.
193+
password_attribute:: The users password when performing SMTP authentication
195194

196195

197196

198-
password:: Password to use in conjunction with the above user name
199-
for SMTP authentication.
197+
In most cases, the SMTP module will be used to send email.
200198

201199

202200

203-
template_directory:: The source directory where all file attachments are pulled from
204-
All file attachments should be their relative path from this location, without a leading /
201+
username:: The name or login identifier to use when sending email.
205202

203+
If authentication is not required, it can be commented out/
206204

207205

208-
Attachments:: attachments with their relative path from template_directory
209-
There can be no leading / or ..
210206

207+
password:: Password to use when sending email.
211208

212209

213-
envelope_address:: This is the address used to send the mail,
214-
Sent to the receiving server as MAIL FROM:<envelope_address>
215-
sender_address will be defaulted to if this is not set
216210

211+
template_directory:: Directory where email templates are stored.
217212

213+
All file attachments should be given as a relative path
214+
from this location. i.e. without a leading '/'.
218215

219-
sender_address:: This are the addresses displayed in the FROM: element of the header
220-
This can be different than the provided envelope_address,
221-
If envelope_address is set, this can be formatted however you want it to appear to the receiver
222-
If envelope_address is not set, the first element in sender_address will be used as the envelope address
216+
217+
218+
Attachments:: File names to attach to the templates.
219+
220+
The filenames are relative to `template_directory`
221+
222+
223+
224+
envelope_address:: Set the `MAIL FROM:<envelope_address>`
225+
226+
If this is not set, `MAIL FROM` will be set from `sender_address`.
227+
228+
229+
230+
sender_address:: Set the body `FROM` address.
231+
232+
This can be different than the provided envelope_address.
233+
234+
If envelope_address is set, this can be formatted however
235+
you want it to appear to the receiver.
236+
237+
If envelope_address is not set, the first element in
238+
sender_address will be used as the envelope address.
223239

224240

225241

226242
recipients:: Email addresses to be set as recipients for the email
227-
If recipients is set bcc, cc, and to will not be automatically added to the email
228-
And so they must be included here.
229243

244+
If recipients is set, then `bcc`, `cc`, and `to` will not
245+
be automatically added to the email. Only the list of
246+
`recipients` will be used.
230247

231248

232-
to:: Email addresses to be set in the TO: header
233-
These addresses will be added as envelope recipients only if recipients is not set
234249

250+
to:: Set the body `TO` header.
235251

236-
cc:: Email addresses to be set in the CC: header
237-
These addresses will be added as envelope recipients only if recipients is not set
252+
If `recepients` is not set, then messages will be sent to the `TO` address.
238253

239254

240255

241-
bcc:: Comma separated list of emails.
242-
the local part may contain commas, the domain may not (https://tools.ietf.org/html/rfc2821[RFC 2821])
243-
Therefore, first comma after the @ represents a new address
244-
not listed in the header of the email
245-
if recipients is not set, these emails will be added to the envelope recipients
256+
cc:: Set the body `CC` header.
257+
258+
If `recepients` is not set, then messages will also be sent to the `CC` addresses.
259+
260+
261+
262+
bcc:: Set the `BCC` recipients.
263+
264+
The local part may contain commas, the domain may not (https://tools.ietf.org/html/rfc2821[RFC 2821])
265+
266+
Therefore, the first comma after the @ represents a new
267+
address, and is not listed in the header of the email.
268+
269+
If `recepients` is not set, then messages will also be sent to the `CCC` addresses.
246270

247271

248272

@@ -261,10 +285,18 @@ Default is `yes`
261285

262286

263287

264-
header:: This is where any other headers can be added to the email
265-
FROM, TO, and CC, should not be added here if their respective elements were set in the config
266-
If no DATE header is provided, one will be added showing time that the request was received(recommended)
267-
Non-standard mail headers may be set. Adhere to your MTA's documentation
288+
header:: Additional headers to add to the messages.
289+
290+
Any `FROM`, `TO`, and `CC` should not be added here. They are set in the configuration items above.
291+
292+
If no `DATE` header is provided, one will be added which
293+
shows the time that the request was sent.
294+
295+
Non-standard mail headers may be set. Adhere to your MTA's
296+
documentation
297+
298+
299+
Headers are added with the given names and values, in the order listed here.
268300

269301

270302

@@ -329,7 +361,7 @@ smtp {
329361
}
330362
# username = "user"
331363
# password = "secret"
332-
template_directory = raddb/mods_config/smtp
364+
template_directory = ${confdir}/mods_config/smtp/
333365
attachments = SMTP-Attachments[*]
334366
envelope_address = "postmaster@localhost"
335367
sender_address = SMTP-Sender-Address[*]

raddb/mods-available/smtp

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -174,25 +174,25 @@ smtp {
174174
#
175175
# `SCHEME://IP:PORT/`
176176
#
177-
178-
# `SCHEME` can be one of the SMTP protocols supported by Curl.
179-
# i.e. smtp, smtps.
180-
# If no `SCHEME` is given, it defaults to `smtp`.
181177
#
182-
# `IP` is the IP address of the server. It can be an IPv4 address,
183-
# IPv6 address, hostname, etc.
178+
# * `SCHEME` can be one of the SMTP protocols supported by Curl.
179+
# i.e. smtp, smtps.
180+
# If no `SCHEME` is given, it defaults to `smtp`.
181+
#
182+
# * `IP` is the IP address of the server. It can be an IPv4 address,
183+
# IPv6 address, hostname, etc.
184184
#
185-
# `PORT` is optional, and will normally be chosen to be correct
186-
# for the given `SCHEME`.
185+
# * `PORT` is optional, and will normally be chosen to be correct
186+
# for the given `SCHEME`.
187187
#
188-
# For more information, see the CURL documentation at
188+
# For more information, see the CURL documentation at:
189189
#
190190
# https://ec.haxx.se/cmdline/cmdline-urls
191191
#
192192
uri = "smtp://192.0.20.1/"
193193

194194
#
195-
# timeout:: How long the module will wait before giving up on the response
195+
# timeout:: How long the module will wait, before giving up on the response
196196
# from the SMTP server.
197197
#
198198
timeout = 5s
@@ -221,34 +221,36 @@ smtp {
221221
#
222222

223223
#
224-
# username:: User name to use when sending emails. Can be a fixed
225-
# string or an attribute. Leave unset if authentication is not
226-
# required to send emails.
224+
# username:: The name or login identifier to use when sending email.
225+
#
226+
# If authentication is not required, it can be commented out/
227227
#
228228
# username = "user"
229229

230230
#
231-
# password:: Password to use in conjunction with the above user name
232-
# for SMTP authentication.
231+
# password:: Password to use when sending email.
233232
#
234233
# password = "secret"
235234

236235
#
237-
# template_directory:: The source directory where all file attachments are pulled from
238-
# All file attachments should be their relative path from this location, without a leading /
236+
# template_directory:: Directory where email templates are stored.
239237
#
240-
template_directory = raddb/mods_config/smtp
238+
# All file attachments should be given as a relative path
239+
# from this location. i.e. without a leading '/'.
240+
#
241+
template_directory = ${confdir}/mods_config/smtp/
241242

242243
#
243-
# Attachments:: attachments with their relative path from template_directory
244-
# There can be no leading / or ..
244+
# Attachments:: File names to attach to the templates.
245+
#
246+
# The filenames are relative to `template_directory`
245247
#
246248
attachments = SMTP-Attachments[*]
247249

248250
#
249-
# envelope_address:: This is the address used to send the mail,
250-
# Sent to the receiving server as MAIL FROM:<envelope_address>
251-
# sender_address will be defaulted to if this is not set
251+
# envelope_address:: Set the `MAIL FROM:<envelope_address>`
252+
#
253+
# If this is not set, `MAIL FROM` will be set from `sender_address`.
252254
#
253255
envelope_address = "postmaster@localhost"
254256

@@ -320,12 +322,20 @@ smtp {
320322
# set_date = yes
321323

322324
#
323-
# header:: This is where any other headers can be added to the email
324-
# FROM, TO, and CC, should not be added here if their respective elements were set in the config
325-
# If no DATE header is provided, one will be added showing time that the request was received(recommended)
326-
# Non-standard mail headers may be set. Adhere to your MTA's documentation
325+
# header:: Additional headers to add to the messages.
326+
#
327+
# Any `FROM`, `TO`, and `CC` should not be added here. They are set in the configuration items above.
328+
#
329+
# If no `DATE` header is provided, one will be added which
330+
# shows the time that the request was sent.
331+
#
332+
# Non-standard mail headers may be set. Adhere to your MTA's
333+
# documentation
327334
#
328335
header {
336+
#
337+
# Headers are added with the given names and values, in the order listed here.
338+
#
329339
subject = "email subject"
330340
Message-ID = "950124.162336@example.com"
331341
# X-Originating-IP = "192.0.20.1"

0 commit comments

Comments
 (0)