Understanding Mail Relay

I have setup a MiaB with normal accounts and aliases.
One account destined for sending email from a couple of web apps using smtp.
I had to set the smtp configuration of the web app to use 587 port instead of 465 to be able so send something.

Why does an email client like Thunderbird is able to send with 465 and not the web app?
(Using Ruby + Pony, authentication: plain)
Why does the documentation recommends setting up postfix in the web app server too, instead of having a “normal” account?

I just would like to better understand what’s going on and the implications of each way of doing things.
I feel like I’m missing some very basic concepts.

Hi mecargo

Welcome to the Forum.

Let me start by saying all SMTP transactions can be classed as relaying mail from one machine to another. However it is important to class these in 2 ways.

Submission - where email is introduced into the system by submitting it to your Email provider.
Transport - where email is moved from sending email provider to receiving email provider.

Up until last year the ONLY approved port for email submission was port 587 with StartTLS
Email transport takes place to port 25 (with or without StartTLS - although the use of the latter to deliver mails to mail exchangers is increasing).

Part of the problem is the mail standards have evolved over the years, indeed although, port 465 SSL was declared obsolete for email submission back in 1998, the approved port for email submission was port 587 with explict SSL/TLS through use of the StartTLS command.

Whether a sending agent supports port 465 SSL/TLS very much depends on the code writers. Currently Ruby’s mail does not support implicit TLS connections - therefore the only port you can use in this instance is port 587 with StartTLS. It’s not alone in this instance. If you want to relay mail from a Microsoft Exchange server to a submission port, the only option is to use StartTLS.

Postfix can be set up to send outbound mail to a submission port using either port 465 SSL/TLS or port 587 StartTLS - However it should be stressed that this is really outside the scope of MIAB. We can try and help. Also Postfix includes it’s own take on Sendmail which uses postfix itself to send the mail. Where postfix is installed the native linux sendmail program should not be needed.


The answer here is that it is all in how the client was written. A web app may be written in a manner that it only can connect with one specific method while an email client may have more options, as an example.

Ok, so I have no idea which documentation you are referring to … and do not care to know. The simplest answer is that ‘there is more than one way to skin a cat’. It all depends on what options are available to you and I would venture to guess that the writer of the documentation did not elaborate on all of those ways.

Let me try to throw in something that may actually be helpful.

A web app may either have code written in to handle SMTP transport to another server, which will accept the mails and then pass it to the internet for delivery.


A web app may simply expect that the email will be handled by the server it is running on … this would explain the second question you asked. Oftentimes, the server would need to have sendmail or postfix installed as they are not pre-installed. At this point, I am just guessing as the specifics are not clear - just as they likely were not clear to the person writing the documentation.