Setting up your own mail server to use with automated SEO tools for just $10 per month

Discussion in 'Black Hat SEO Tools' started by neteater, Jan 27, 2017.

  1. neteater

    neteater Jr. VIP Jr. VIP

    Feb 14, 2009
    Likes Received:
    somewhere between CPU an d heat sink
    Home Page:
    Setting up your own mail server to use with automated SEO tools for just $10 per month

    Disclaimer: This guide will be for users with Linux skills

    In the progress of setting the infrastructure to provider services for my own RankerX customers, I need to set up mail servers to provide 20 free email accounts for each user per day. Although users can use RankerX's free email accounts, they are limited to the provided domains and it's inconvenient to use with other tools like GSA Search Engine Ranker, Senuke .... So I am guiding you to set up mail servers, bulk create email accounts and use the accounts with Blackhat SEO tools and possibly as the background for who wants to set up a catchall mail service.

    - Prequsites:
    + You need to buy domains. I personally buy domains from because it provides free whois guard for one year.
    + You need a VPS. There are some candidates here: Digital Ocean, Linode, .. I only have experience with Digital Ocean and Linode. Both are very easy to setup. But I recommend Digital Ocean. Linode is stricter when it comes to spam. I got warning once when using Linode.

    - Setup:
    After setting up the server (I will have a guide for it later today). You need to switch the domain name server of your domain from namecheap to Digital Ocean:
    Then logging into your Digital Ocean to set up the DNS records as follow:

    Change to the domain you purchased. Also change the IP address to the one of your server.


    - Now you're all set. Let's setup the required packages for your server to serve as a mail server:

    + SSH to your server (on Windows you can use putty, on Linux or Mac you can use Terminal):
    ssh -l root your_server_ip_address
    + Then type in:
    apt-get install postfix postfix-mysql dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-mysql mysql-server

    Explanation: apt-get is Debian's package management system. This command install the following packages:
    postfix: This is the Mail Transfer Agent (MTA). The purpose of postfix is to receive emails from other MTA (like Google's one) and deliver emails to other MTA.
    dovecot: This is to provide POP3 and IMAP server functionality.
    mysql-server: This is to store domains, email accounts, ....

    When installing mysql-server, you will be prompted to enter your Mysql Root password, enter anything that you want.

    + Set up the database first:


    + Now, set up postfix:
    + Open postix configuration file by entering:
    vim /etc/postfix/
    + Create and edit the following files (remember to change mailuser and mailpassword to the ones you set when setting up the database)
    + Edit the file to look similiar to:

    + Create and edit the file for virtual domains (later you can add multiple domains to your mail server): /etc/postfix/ with the following content:

    + Create and edit the file for your email accounts (you can add thousands of email accounts to your mail server in bulk): /etc/postfix/

    + Create and edit the file for your email alias (this can be used for catchall mail services, I will have a separate guide to set this up later): /etc/postfix/

    + Create email2email file: /etc/postfix/ with the following content:

    + Edit the first section of the file: /etc/postfix/ to look similar to this:

    + Now after setting neccessary postfix configuration file you need to restart the postfix service:
    service postfix restart

    + Now we set up Dovetcot to act as POP3 and IMAP server so the SEO Tools can connect to the mailserver and receive the mails:

    + Edit /etc/dovecot/dovecot.conf to look like this

    + Edit /etc/dovecot/conf.d/10-mail.conf (this file be used to point to where we want to store our actual email messages), change the mail_location and mail_privileged_group variables to
    mail_location = maildir:/var/mail/maildir/%d/%n
    mail_privileged_group = mail

    + Now create the actual directry and change the permission to access the folder:
    mkdir -p /var/mail/maildir/
    groupadd -g 5000 vmail useradd -g vmail -u 5000 vmail -d /var/mail
    chown -R vmail:vmail /var/mail

    + Edit /etc/dovecot/conf.d/10-auth.conf to disable plaintext authentication because we use SQL:
    disable_plaintext_auth = yes
    auth_mechanisms = plain login
    #!include auth-system.conf.ext
    !include auth-sql.conf.ext

    + Edit /etc/dovecot/conf.d/auth-sql.conf.ext so dovecot knows how to access the database:

    passdb {
    driver = sql
    args = /etc/dovecot/dovecot-sql.conf.ext
    userdb {
    driver = static
    args = uid=vmail gid=vmail home=/var/mail/maildir/%d/%n
    + Edit /etc/dovecot/dovecot-sql.conf.ext and comment out the driver variable so Dovocot knows that we would use Mysql to store the emails and how to connect to the database:

    + Correct the ACL for dovocot configuration folder:
    chown -R vmail:dovecot /etc/dovecot
    chmod -R o-rwx /etc/dovecot

    + Edit the file /etc/dovecot/conf.d/10-master.conf to look like this:


    + Edit the file /etc/dovecot/conf.d/10-ssl.conf to look like this:
    ssl_cert = </etc/dovecot/dovecot.pem
    ssl_key = </etc/dovecot/private/dovecot.pem
    ssl = required

    + Now restart dovecot:

    service dovecot restart

    + Now it comes the interesting part, adding new domain and bulk create email accounts!


    Let me know if you guys have any question regarding.