I have a CakePHP web app running on a ubuntu 12.04 LTS server. The server is hosted on a machine within a intranet of a corporation.
The web app needs to send out transactional emails a few times a day.
According to SendGrid, emails are largely divided into 2 types: marketing and transactional.
Transactional emails are those that notify you something has happened/ is about to happen.
Recipients of this email are usually advised not to reply back.
Because this web app I am doing is mainly for internal usage and therefore the emails sent to internal corporate users, I do not envisage the need to set up SPF for emails and so on.
However, I am not sure how to install an email server in ubuntu 12.04 that will work with my CakePHP web app.
I do know that my web app works with GMAIL SMTP settings.
All I need to do is to use the following in my CakePHP email settings:
public $gmail = array(
'host' => 'ssl://smtp.gmail.com',
'port' => 465,
'username' => '[email protected]',
'password' => 'secret_password',
'transport' => 'Smtp'
);
I believe I can use postfix, but I have never installed it before. Need advice on exactly what steps I need to undertake to achieve the above.
Off the top of my head I think I at least need to know:
- how to install email server
- configuration for the email server
- how to create an account on the email server (e.g. noreply@IP_ADDRESS?? )
- SMTP configuration for my web app to send out the email
Both the web app and the email server are on the same machine.
Another key point to add is that the machine has no direct access to the internet. It is purely on the corporate intranet.
I would install sendmail, if you need just the basic functionality.
But if you don't need MTA, why would install one? Production server bloating with vulnerable software is really hitting your own leg at the end.
But if you like, just install sendmail and voilá, your mail is delivered with php mail function. You don't need to create user for it, just use address you want.