/
Configuring Mail server to use with a REDCap VM
Configuring Mail server to use with a REDCap VM
This guide is helpful to configure a REDCap application running on a Linux host to use an external SMTP/mail server for handling email exchange. This guide is using the myARCH REDCap VM as a guide, which is running CentOS 7 with the normal AMP stack on top of it. We will use the onboard Postfix mail server as a null email client, relaying all requests from the php mail() function to the email server. The following will be performed as 'root' from the command line of the REDCap server.
(Optional) Create a file that has the SMTP server credentials (if authentication is required)
- Create a file /etc/postfix/sasl_password and add the following line:
<smtp-server> <username>:<password>
where
– <smtp-server> is the hostname/domain of the server (e.g. smtp.sendgrid.net)
– <username> is the login user to the server
– <password> is the user's password - Restrict permissions of the above file to root by typing the following:
chown root:root /etc/postfix/sasl_passwd && chmod 600 /etc/postfix/sasl_passwd
- Create a DB file for the password file:
postmap hash:/etc/postfix/sasl_passwd
Configure Postfix
- Open the file /etc/postfix/main.cf and add/edit the following lines to look like the following:
smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options =
- Also in /etc/postfix/main.cf, edit the following:
myhostname = <hostname-of-redcap-vm>
#$mydomain (commented out - this will revert to the domain portion of myhostname if specified)
myorigin = $mydomain
inet_interfaces = loopback-only
mydestination =
relayhost = <SMTP-server>:<SMTP-port>
- Reload Postfix with the new configuration:
postfix reload
Reference: Postfix configuration Parameters
Related articles
, multiple selections available,
Related content
MyARCH REDCap Virtual Machine
MyARCH REDCap Virtual Machine
More like this
Connecting REDCap to myARCH
Connecting REDCap to myARCH
More like this
Preparing a Dockerized REDCap container
Preparing a Dockerized REDCap container
More like this
Project setup
Project setup
More like this
Web Services Overview
Web Services Overview
More like this
Automated Survey Invitation Setup
Automated Survey Invitation Setup
More like this