- Documentation
- WuInstall
Email Options
WuInstall sends a notification email with the result of the run when /smtpServer is given; WuInstall 3.0.1 and later also need /smtpTo. The log file (/logfile) and the XML report (/xmlout) are attached. A failed email never changes the WuInstall exit code. WuInstall 3 sends the email before a reboot or shutdown starts; in WuInstall 2.9.x the countdown was already running, so with a slow mail server the machine could go down before the mail was sent.
/smtpServer [smtp|smtps|smtpTLS://]host:port
Specifies the SMTP server and port for sending the email. The default port is 25 for every prefix, so always add the port your mail server expects.
| Prefix | Connection |
|---|---|
smtp:// or none |
WuInstall 3: switches to TLS with STARTTLS whenever the server offers it, otherwise sends unencrypted. WuInstall 2.9.x: unencrypted. |
smtpTLS:// |
STARTTLS required — a server that refuses it does not get the mail. |
smtps:// |
TLS from the first byte (implicit TLS), e.g. smtps://mail.example.com:465. Without a port, smtps:// uses port 25 and behaves like smtp://. |
Port 465 always uses implicit TLS, whatever the prefix. WuInstall 3 also accepts host names with a hyphen (mail.my-company.com) and single-label names (exchange01). WuInstall 2.9.x silently disabled email for single-label names and cut hyphenated names short (mail.my-company.com became mail.my), so the mail did not arrive. WuInstall 3.0.1 and later report a value they cannot use at the start of the run (/smtpServer ... is not a valid [smtp|smtps|smtpTLS://]host[:port] - no notification email will be sent.); WuInstall 2.9.x and 3.0.0 disabled email without a message. A trailing slash (smtp://mail.example.com/) is accepted.
Example:
wuinstall /install /smtpServer smtpTLS://mail.example.com:587 /smtpUser wuinstall@example.com /smtpPassword "secret" /smtpFrom wuinstall@example.com /smtpTo admin@example.com /masksensitivedata
/smtpUser
Specifies the user for sending the email (SMTP authentication). WuInstall 3 logs in with AUTH LOGIN, or with AUTH PLAIN when the server offers only that.
/smtpPassword
Specifies the password for sending the email. Add /masksensitivedata to keep it out of the log and the XML report.
/smtpSubject
Specifies the subject for the email (default: Wuinstall Notification ($hostname$): $simpleerrorstring$). These tokens are replaced (WuInstall 3 matches them case-insensitively):
| Token | Replaced by | Since |
|---|---|---|
$hostname$ |
the computer name | 2.x |
$simpleerrorstring$ |
SUCCESS or ERROR |
2.x |
$computername$ |
the computer name (same as $hostname$) |
3.0 |
$returncode$ |
the return code, e.g. 10 |
3.0 |
$returntext$ |
its meaning, e.g. successful, reboot required |
3.0 |
$RCC$ |
reboot cycles still to come with /rebootcycle (0 = last run) |
3.0 |
$DATETIME$ |
date and time | 3.0 |
Example: /smtpSubject "$hostname$ [$RCC$ left] RC=$returncode$: $returntext$" → SRV01 [0 left] RC=10: successful, reboot required
/smtpFrom
Specifies the sender of the mail (default: noreply@wuinstall.com).
/smtpTo
Specifies the recipients of the email. Required: from WuInstall 3.0.1 on, no email is sent without /smtpTo, and the log says No /smtpTo specified - the notification email is not sent. WuInstall 2.9.x and 3.0.0 sent the email to the default recipient diagnose@wuinstall.com instead, with the log file and XML report attached, so always set /smtpTo with these versions. In WuInstall 3, separate several addresses with ; or ,, e.g. /smtpTo "admin@example.com;Patch Team <patch@example.com>"; a recipient the server rejects is logged and the mail still goes to all other recipients.
/smtpSendOnLastRebootCycleOnly
With /rebootcycle, skips the emails of the intermediate runs and sends only the email of the final run, with its result. In WuInstall 3, combine it with $RCC$ in the subject. WuInstall 2.9.x could skip this final mail when the cycle simply ran out; WuInstall 3 sends it reliably.
/smtpRequireValidCert
WuInstall 3 only. Does not send the mail if the server's TLS certificate does not validate, or if a server that offers STARTTLS refuses it or the TLS handshake fails — so neither the login nor the mail goes out unencrypted. Without this switch, WuInstall logs the certificate problem and sends the mail anyway, so internal mail servers with self-signed certificates keep working. To also refuse servers that offer no encryption at all, combine it with smtpTLS://.