Enable Remote SMTP For Local Development


When you are working on web development using PHP or other language, you may need to provide mailing feature, and you may already have a server with Postfix or similar mail program running, and then you want to enable that server to be able to send email with your local computer, because the default emailing port (25) isn't open for public.

Without further ado, let's start to make your server to send email from your local computer, We assume that you already have Post-fix or similar software, if you don't just do quick installation, it won't took long.

1. Add new port for SMTP (simple mail transfer protocol) services, the default port is 25, we are gonna add one more port which we will use port 2525. It's up to you whatever port you choose as long as it is not already been used by another services.

2. To add more SMTP port, you can use simple editor like vim or nano and with sudo privileges, now using vim:

sudo vim  /etc/postfix/master.cf

3. Then add new line, after line :

smtp inet n - y - - smtpd -o smtpd_sasl_auth_enable=yes

Add our new configuration:

2525 inet n - y - - smtpd -o smtpd_sasl_auth_enable=yes

3. Save it than reload Postfix

sudo postfix stop && sudo postfix start

Now you have SMTP that could be use by your local computer, you can start developing your app by using that port, which we created earlier.



Popular posts from this blog

ERROR 1348 Column Password Is Not Updatable When Updating MySQL Root Password

Spring Kafka - how to use ReplyingKafkaTemplate send and reply synchronously

How To Create Spring Boot Project Using Netbeans

Upload and Download Rest API using Spring Boot Reactive WebFlux

MIME Types - Complete List