Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
36 views16 pages

How To Setup Your Own SMTP Server

This tutorial provides a step-by-step guide on how to set up your own SMTP server using a free domain and an OpenVZ VPS. It covers essential steps including domain registration, VPS purchase, DNS configuration, installation of VestaCP and PowerMTA, and creating DKIM keys. The tutorial emphasizes careful reading and following instructions to successfully build and manage your SMTP server.

Uploaded by

Jenifer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views16 pages

How To Setup Your Own SMTP Server

This tutorial provides a step-by-step guide on how to set up your own SMTP server using a free domain and an OpenVZ VPS. It covers essential steps including domain registration, VPS purchase, DNS configuration, installation of VestaCP and PowerMTA, and creating DKIM keys. The tutorial emphasizes careful reading and following instructions to successfully build and manage your SMTP server.

Uploaded by

Jenifer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

SMTP TUTORIAL

*******************************************
Hey guys, finally the moment you’ve been waiting for, not having to
waste money on shitty SMTP and own the limits of your mailing. You can
say bye bye to being a script kiddie in this area. Time to learn how to
build your very own SMTP.
WHAT YOU WILL NEED:
1. Common fucking sense.
2. Don’t act like you’re smarter than the teacher.
3. A free domain.
4. An OpenVZ VPS.
5. The tools I provide you.
6. Calm nerves.
This tutorial is to be read from the beginning to the end, if possible read
twice line by line as you follow the guide for the first timers. If you can’t
read without skipping some parts this tutorial is not for you and just opt
to get a refund. Lol, just kidding. Don’t expect a refund once I have sent
this package to you. GL.

STEP 1: Get domain name:


1. Go to freenom.com and create a free account,
1|Page
2. Click the "Services" option on the top navbar after you have
successfully logged in.

3. Click the "Register a new domain" option.

4. Check availability of preferred domain name by entering the name


(in my case “boston”) in the “Find a new FREE domain” text space,
then click the “check availability” button and wait for freenom to
display available free TLDs for that domain name, e.g, check for
"boston"; available free tld's: boston.ml,boston.cf,etc...
NOTE:TLD stands for the last part of a domain name e.g, the TLD of
"boston.com" is ".com" likewise "boston.ml" is ".ml"

*Select your preferred TLD e.g. “boston.ml”. Proceed to checkout


complete the requirements and successfully register the domain name.

STEP 2: Buy VPS:


1. Buy OpenVZ linux VPS with the "CENTOS 6 64-BIT" OS,
preferably the minimal version.
*Minimum specifications of the VPS:
-1 Core
-512MB RAM
-10GB Storage capacity
-1 IP

2|Page
*Some VPS providers ask for hostname when purchasing you can use
your free registered domain with the subdomain "vps" in front of it e.g.
"vps.boston.ml" or you can input any random thing e.g. "abc.123.com"

STEP 3: Setting DNS records with cloudflare:


1. In this step you can chose to setup your DNS records in the
freenom website by going “My domains” under the “Services”
option on the top navbar then select “Manage domain” on the
row of the domain you just purchased freely, in my case
“boston.ml” then click “Manage freenom DNS” and input the
records I put below in number 6. But I recommend using
cloudflare so to do that continue to number 2 or skip to number 6
to input the DNS records

2. Go to cloudflare.com and create a free account, confirm email and


login.

3. Add your domain name e.g. boston.ml by clicking the "Add site"
option, select the free website security option and proceed to the
DNS record part.
NB: it will tell you your site could not be scanned so click “continue”
and it should provide you with two nameservers you should input in
the freenom website.

4. Go to your freenom account and select the "Services" option on


the top navbar, then click the "My domains" option, select
"manage domain" on the row of the domain you just purchased

3|Page
freely, go to the "management tools" option and select
“nameservers”.

5. Select "use custom nameservers" and input the nameservers


provided to you by cloudflare:
Usually –
NS1:bonnie.ns.cloudflare.com | NS2:chad.ns.cloudflare.com, unless
specified otherwise by cloudflare.

6. Here you are going to input these records accordingly in the DNS
section of your domain account in cloudflare:
TYPE NAME VALUE
A @ MAIN_SERVER_IPv4
A HOSTNAME MAIN_SERVER_IPv4
A slot0 MAIN_SERVER_IPv4
AAAA @ MAIN_SERVER_IPv6
AAAA HOSTNAME MAIN_SERVER_IPv6
AAAA slot0 MAIN_SERVER_IPv6
CNAME www @
MX @ HOSTNAME.EXAMPLE.COM
TXT @ @
TXT @ v=spf1 mx a a:domain.com ip4:198.46.150.192 ~all

TXT _dmarc v=DMARC1; p=none


TXT slot0 @
4|Page
NOTE:
Replace the current IP in the above DNS records "198.46.150.192" to your
vps IP, and the “domain.com” to your freely registered domain, in my
case “boston.ml”
MAIN_SERVER_IPv4 stands for your VPS IP,
“HOSTNAME” in this instance would be "vps" as in "vps.boston.ml"
“@” is your freely acquired domain, in my case “boston.ml”,
Not all providers will give you your VPS IPv6 address,
HOSTNAME.EXAMPLE.COM here would be vps.yourdomain.tld e.g.
"vps.boston.ml"
ONE last record will be added later in this tutorial so do not close your
cloudflare page.

STEP 4: Installing VestaCP and PowerMTA:


1. Connect to your VPS through SSH, you can use either putty or
bitvise SSH client (I personally recommend bitvise ssh client
because of its SFTP functionality we would be using later).
Open the command line terminal (also known as Terminal
console).

2. Input this command lines into your terminal accordingly: Do not


run the COMMENTS that start with #

# Download installation script:


curl -O http://vestacp.com/pub/vst-install.sh
5|Page
# Run it:
bash vst-install.sh

# If the above command doesn’t work, then use:


bash vst-install.sh --force

3. Once installation has started it prompt for an email address to


send your information to, input your email address. It will then
ask for your hostname, input "vps.yourdomain.tld" in my case
"vps.boston.ml"
NOTE: The installation process of VestaCP will take about 15
minutes. After it's done installing your VestaCP login
information you'll need will be displayed in the terminal console.
Be sure to save them in a notepad file!!!

4. When the installation is done, and you have saved your login
details, input these commands accordingly:
# Install nano text editor
yum -y install nano

# Install gdb (debugger)


yum -y install gdb

6|Page
5. Now we are going to raise the email sending limits of the smtp,
follow these instructions, input these commands accordingly:
# Open the file limits.conf
nano /etc/security/limits.conf

# Input the text below at the bottom of the file before "#End of
file" (please include the *)
* soft nofile 65535
* hard nofile 65535

6. press "Ctrl+X" to exit and press "Y" to save, then press enter to
proceed to the command line terminal.

7. Type "reboot" and press enter to reboot.

8. Log into the VestaCP with the login details you saved after your
VPS has been restarted, go to the VestaCP URL which is
"your.vps.ip.addy:8083/"

9. Click on "WEB",

7|Page
Select “add web domain” located on the “+” symbol and add
your freely acquired domain name, untick "DNS Support" e.g.
"boston.ml" and not your hostname "vps.boston.ml" take note.

10. Click on "MAIL",

Hover over your domain and not your hostname and select
“add new account” under the navbar that appears, e.g. In my
case I will select "add account" under "boston.ml".

11. Create an account with the name "postmaster" with a password


of your choice.

12. You will need Bitvise SSH Client for this. In the attached zip file I
sent you, extract the file and then connect to your VPS and
open your SFTP window (with Bitvise SSH Client), copy the
8|Page
PowerMTA4.5r1.rpm in the “pmta” folder” to your “root” folder
in your VPS, then type these commands in your command line
terminal:
# Install PowerMTA

rpm -ivh PowerMTA-4.5r1.rpm

# You Will see an Output


Like this:

Preparing...
########################################### [100%]
1:PowerMTA
########################################### [100%]

PowerMTA has been installed. Please review the configuration


(in /etc/pmta/config) to ensure it fits your needs.

The PowerMTA User's Guide is available on


file:/usr/share/doc/pmta/UsersGuide.pdf.

*** WARNING ***


The SMTP TCP port is already in use by other software on this

9|Page
system. Installation will continue, but in order to be able
to
start up PowerMTA you will need to stop the other software
or reconfigure PowerMTA to use an alternative port. See the
manual section about startup problems for more information.
*** WARNING ***

Thank you for choosing PowerMTA.

This software requires a license to run. To obtain a license


key,
please contact Port25 at <[email protected]> or call
+1.410.750.7687
during office hours, U.S. Eastern Time.

If you already received a license key from Port25, please save


it
as /etc/pmta/license before starting PowerMTA.

Starting PowerMTA web monitor: [FAILED]

10 | P a g e
13. Make some directories on the VPS using these commands in the
command line terminal accordingly:
mkdir /etc/pmta/dkim
mkdir /etc/pmta/files
mkdir /etc/pmta/log

14. Rename the "license.dat" file in the zip I gave you to "license"
(basically remove the ".dat" extension).

15. Open the SFTP window and navigate your way to the
"/etc/pmta" directory {use the button with a folder icon and a
green arrow in it to navigate to the parent folder}.
NOTE: Navigate to the drive’s parent directory and find your
way to the giving directory. Just keep pressing the folder with
the green arrow button till it doesn’t go back anymore.

16. Transfer the "license" file to the "/etc/pmta" folder using the
SFTP. (If you did everything right you should have a working
license to power up your PowerMTA)

17. Run these commands accordingly on your command line


terminal:
chmod 755 /etc/roundcubemail/config.inc.php
chmod 755 /usr/sbin/pmtahttpd

11 | P a g e
18. Navigate to the "/usr/sbin" in your VPS using the SFTP window
(using the same method you used to navigate to "/etc/pmta"),
copy and paste {drag & drop} the "pmta" & "pmtad" file in the
"/usr/sbin" folder in the .zip I sent you to your VPS.

19. Configuring your Iptables:

a. Navigate to "/etc/sysconfig" in your VPS, copy the "iptables" file


to your computer, open with with a text editor preferabely atom,
sublime text or Notepad++

b. add these lines under the line where you see ....53 -j ACCEPT

-A INPUT -p tcp -m tcp --dport 3187 -j ACCEPT


-A INPUT -p tcp -m tcp --dport 2526 -j ACCEPT

c. Go to your command line terminal and run these commands


accordingly:
service iptables reload
service iptables restart

STEP 5: Create DKIM key:


1. Go to https://www.port25.com/dkim-wizard/.

12 | P a g e
2. In the first text area type your freely acquired domain name, then
type “dkim” in the second text area. Select 2048 key size, then click
on “Generate Keys”.

3. You should have your Public and Private Keys generated. Now open
Notepad (not Notepad++), copy the RSA PRIVATE KEY into a fresh
Notepad and save as “dkim.example.com.pem” (In my case
"dkim.boston.ml.pem"). Do not save it as a .txt file, just select All
files then put the file name I just stipulated above and then save.

4. Go back to your VPS and navigate to “/etc/pmta/dkim/" folder then


drag/copy the dkim.example.com.pem there.

5. Go back to Port25.com and then copy the dkim selector that looks
like this:

“k=rsa\;
p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAj045Ut
0x+d2gFdS6vnWETT+7QbinYfy1DxUu8OdO5wrMm1St/UuXXSm7FH
XlShgGQnj9axZa+0c2WY4MzUTMgWU8
XWtumaGLTDyI6nlH2r9OiasKU/mhiWx7O3RrCHErksBKKfqCaPwZK
/B/ed988jwd5iDFUB0
Q1i3njpspI+vAZUa7vGtPHVUeS63aRv+ic/k3jBWJKHyjw0caxBXGqC
vRHyoR8P/SQl23AqIIL605vpfnx0Gmo2b7Ic+EujXN+dIACscHSRTcL
KaIIOGnG9uo4nsvoU5aCXqZbRA72Bb9bZka/62YOte1gL6eM9gDYb
y1imwiLOm5rssbMy/VHxwIDAQAB”

6. Create a TXT record with it in your DNS management system {back


to cloudflare}. Name should be “dkim._domainkey.yourdomain.tld”,
13 | P a g e
the value would be the dkim selector like the one above, remember
to remove the quotes!!

7. In the .zip file I sent you {that you already extracted}, you should
find the "config" file, open it with Notepad++ or atom and then
change the settings:

8. Replace the text "yourdomain.tld" everywhere you see it to


"yourdomain.tld"{in my case boston.ml}. Make sure you do not alter
any other text

9. Replace the text "your.vps.ip.addy" everywhere you see it to


"your.vps.ip" which should look like this >> “106.90.69.47”. Make
sure you do not alter any other text

10. Now save it and then copy it to the "/etc/pmta/" folder in your
VPS, overwrite the existing one.

STEP 6: Creating your rDNS:


1. Most VPS providers do not allow you to use rDNS, however, you can
contact them to set your rDNS with: slot0.domain.com (change the
domain.com to your freely purchased domain where you installed
PowerMTA and vesta). {Not required for your SMTP to function but
reduces your inbox rate by 10%}

14 | P a g e
2. In other cases, you can freely set your rDNS in your VPS control
panel locate the rDNS option and set it to slot0.domain.com on both
IPv4 & IPv6(if applicable)

STEP 7: Testing your SMTP Sever:


1. Go to your command line terminal and run these commands
accordingly:
service pmta reload
service pmta restart
service pmtahttp restart

*If you did everything right, then all status should report “OK”.
Excluding the first command

2. Now you can use the smtp in this format on any Mailer Software
(SendBlaster, AMS, etc):

Host: SMTP_IP(where VestaCp and PMTA are installed){your vps IP}


Port: 2526
User: admin
Password: admin
Email: [email protected] (the postmaster email you
created) {this is where all smtp failed responses and automatic
responses will go to}

15 | P a g e
3. Go to smtper.net and fill the forms in the format above, tick the "use
authentication" option to add the user and password.

4. input an email address to send the test message to and click "send
the test".

5. If it doesn’t work reinstall your VPS and start over from the
beginning and make sure you understand and do every step
accordingly.

-If after sending your first Spam and you are blacklisted, just buy a new
VPS server. It gets better when you can send more and more. It will only
cost you about $2.50 or extra for a new VPS server.
-Hit me up for private method on how to host your webpages and files
for direct download on your VPS. This package also comes with a
method to install SSL on your page and give it that shiny green padlock
people look out for when visiting websites and a method to keep your
webpage up even after it has been flagged as a suspicious site. It costs
only $20. Enjoy mass mailing.

SMTP TUTORIAL BY CHAMELLEO

16 | P a g e

You might also like