Bulk / Automatic Email Configuration

Best practices for sending emails (individually or in bulk) from your software.

This guide is for writing software applications that need to send mail – if you need to send large amounts of mail as a normal staff member, check out the IST https://uwaterloo.atlassian.net/wiki/x/9QAs6gk article.

Sending from Applications

For the purposes of sending general purpose emails to users / students / external contacts, you should use bulkmail.uwaterloo.ca.

The service allows for large amounts of email to be sent, and you can request to have your account allowed for custom FROM addresses, which is useful if you need to send email from your service on behalf of your users or noreply@uwaterloo.ca.

To get an account submit a ticket through Jira. More information can be found in the Bulk Mailing article.

A simple SMTP connection with username / password is all that is required for this service.

Sending from Servers (cron / errors / etc)

This should be mostly for cron/automated server information. bulkmail should be used for application email sending, etc.

Postfix

Postfix for @uwaterloo.ca relay

/etc/postfix/main.cf

# INTERNET OR INTRANET relayhost = [sas-relay.private.uwaterloo.ca]

If you will be relaying to ONLY @uwaterloo.ca e-mail addresses, then you can leave it at that. If you wish to relay to external users as well, you will need to use authentication

Postfix for relaying to non @uwaterloo.ca as well

You will

/etc/postfix/main.cf

relayhost = [sas-relay.private.uwaterloo.ca]:465 smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/relay_passwd smtp_sasl_security_options = smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt smtp_use_tls = yes
touch /etc/postfix/relay_passwd chmod 0600 /etc/postfix/relay_passwd

/etc/postfix/relay_passwd

Create hash file

DragonFly Mail (dma)

DMA for @uwaterloo.ca relay

/etc/dma/dma.conf

DMA for relaying to non @uwaterloo.ca as well (needs to be validated)

/etc/dma/auth.conf

Exim

Needs to be filled in