Using Mailsend for Sending Alerts

Email Alerts

In our article Email Alerts! In Cradle  we discussed using Mailsend utility so you can use SMTP rather than MAPI to send emails alerts. We touched briefly on the configuration within Cradle of using the utility. In this post, we’ll be expanding on that. Providing an example of a Mail Relay within the Cradle environment rather than talking directly to a company SMTP server.

Why use a relay?

sending and receiving email based on rawpixel.com on Pexels
Mailsend

So why shouldn’t we configure all the Cradle clients to talk directly through Mailsend to a company mail server?
For starters, the company mail server may be locked down to only accept SMTP emails from specific hosts, and so wouldn’t accept SMTP connections from every Cradle desktop client.

Using a relay means that the company mail server only needs to accept SMTP connections from a single host, the mail relay, as all the Cradle Mailsend desktop clients talk via the relay.

So, how do we setup a relay

Its as simple as installing the relay software and configure it. Currently we use Postfix in installations where we need a relay as we’re usually using Linux as a Cradle Database Server. Postfix is a package available on most/all Linux distributions.

Then its just a case of configuring it to accept incoming connections from the Cradle desktop clients. We lock this down to a subnet of IP addresses. Then set the relay host to being the company mail server which will deliver the email alerts. In this example we’re using Postfix to Cradle clients on 2 subnets, and the localhost. The cradle.ini/cradle.rc files then points to the relay host and not the company mail server.

eg.

# cradle.rc
MAIL_HOST = cradle.example.com
MAIL_PORT = 25


# Postfix main.cf
myhostname = cradle.example.com
inet_interfaces = all
inet_protocols = all
mynetworks = 192.168.0.0/24, 192.168.1.0/24, 127.0.0.1
relayhost = [mail.example.com]:25