How to Install dkim on centos 7

  1. Enable EPL repository.

In centOs 7

sudo rpm -Uvh epel-release-7*.rpm


In Cent os 6

           rpm -Uvh epel-release-6*.rpm

  1. Install opendkim

yum install opendkim


mkdir /etc/opendkim/keys/$domain

/usr/sbin/opendkim-genkey -D /etc/opendkim/keys/$domain/ -d $domain -s $selector

chown -R root:opendkim /etc/opendkim/keys/$domain

chmod 640 /etc/opendkim/keys/$domain/$selector.private

chmod 644 /etc/opendkim/keys/$domain/$selector.txt




# Specifies the path to the process ID file.
PidFile /var/run/opendkim/

# Selects operating modes. Valid modes are s (signer) and v (verifier). Default is v.
Mode    sv

# Log activity to the system log.
Syslog  yes

# Log additional entries indicating successful signing or verification of messages.
SyslogSuccess yes

# If logging is enabled, include detailed logging about why or why not a message was
# signed or verified. This causes a large increase in the amount of log data generated
# for each message, so it should be limited to debugging use only.
#LogWhy yes

# Attempt to become the specified user before starting operations.
UserID  opendkim:opendkim

# Create a socket through which your MTA can communicate.
Socket  inet:[email protected]

# Required to use local socket with MTAs that access the socket as a non-
# privileged user (e.g. Postfix)
Umask   002

# This specifies a file in which to store DKIM transaction statistics.
#Statistics              /var/spool/opendkim/stats.dat
# Selects the canonicalization method(s) to be used when signing messages.
Canonicalization        relaxed/simple
# Domain(s) whose mail should be signed by this filter. Mail from other domains will
# be verified rather than being signed. Uncomment and use your domain name.
# This parameter is not required if a SigningTable is in use.
# Defines the name of the selector to be used when signing messages.
Selector                default
# Gives the location of a private key to be used for signing ALL messages.
#KeyFile                 /etc/opendkim/keys/default.private
# Gives the location of a file mapping key names to signing keys. In simple terms,
# this tells OpenDKIM where to find your keys. If present overrides any KeyFile
# setting in the configuration file.
KeyTable                 refile:/etc/opendkim/KeyTable
# Defines a table used to select one or more signatures to apply to a message based
# on the address found in the From header field. In simple terms, this tells
# OpenDKIM how to use your keys.
SigningTable                 refile:/etc/opendkim/SigningTable
# Identifies a set of “external” hosts that may send mail through the server as one
# of the signing domains without credentials as such.
ExternalIgnoreList      refile:/etc/opendkim/TrustedHosts
# Identifies a set internal host whose mail should be signed rather than verified.
InternalHosts           refile:/etc/opendkim/TrustedHosts





How to add swap partition on Centos 6 On KVM

Before we proceed to setup a swap file we need to check  if any swap files have been enabled by looking at the summary of swap usage.

swapon -s

If nothing returned that menas swap file is empty.

Now we have confirmed that we do not have any swap file enabled next we will check available disk space on server with df command


Filesystem     1K-blocks Used Available Use% Mounted on

/dev/vda1       20125372 813952 18289172   5% /

Create and Enable the Swap File

dd if=/dev/zero of=/swapfile bs=1024 count=512k

“of=/swapfile” designates the file’s name. In this case the name is swapfile.

Subsequently we are going to prepare the swap file by creating a linux swap area:

mkswap /swapfile

The results display:

Setting up swapspace version 1, size = 536866 kB

Finish up by activating the swap file:

swapon /swapfile

You will then be able to see the new swap file when you view the swap summary.

swapon -s
Filename Type Size Used Priority
/swapfile                               file 524280 0 -1

This file will last on the server until the machine reboots. You can ensure that the swap is permanent by adding it to the fstab file.

vi /etc/fstab

/swapfile          swap swap    defaults 0 0

To prevent the file from being world-readable, you should set up the correct permissions on the swap file:

chown root:root /swapfile
chmod 0600 /swapfile

How To Configure Swappiness

The operating system kernel can adjust how often it relies on swap through a configuration parameter known as swappiness.

To find the current swappiness settings, type:

cat /proc/sys/vm/swappiness


Swapiness can be a value from 0 to 100. Swappiness near 100 means that the operating system will swap often and usually, too soon. Although swap provides extra resources, RAM is much faster than swap space. Any time something is moved from RAM to swap, it slows down.

A swappiness value of 0 means that the operating will only rely on swap when it absolutely needs to. We can adjust the swappiness with the sysctl command:

sysctl vm.swappiness=10


If we check the system swappiness again, we can confirm that the setting was applied:

cat /proc/sys/vm/swappiness


To make your VPS automatically apply this setting every time it boots up, you can add the setting to the/etc/sysctl.conf file:

sudo nano /etc/sysctl.conf

# Search for the vm.swappiness setting.  Uncomment and change it as necessary.

Email newsletter design tips

An email newsletter is a perfect way to stay connected with your followers and clients.

Figure out what kind of newsletter you want to send Before getting into design aspect first you should clarify what kind of newsletter you want to send whether text-based or HTML based. If going with text-based than directly think about text layout and content which you want to send. But for HTML based newsletters you have to think beyond content and layout.
Here we are discussing HTML newsletter design aspects which you have to keep in mind while designing every HTML based newsletter.
Use tables in your Layout – In today’s modern web standards this may seem a bit contradictory but e-mails are still archaic in their rendering engines, thus you have to build towards older models. Tables are the easiest way to get everything working properly among the various e-mail clients. You may also wonder why div and other block elements are not such a good idea. Most e-mail clients are built to strip away any extraneous CSS content. This means you won’t be able to use much of anything except for inline CSS. Clients such as Microsoft Outlook 2007 and Google’s Gmail have very poor support for floated elements and direct positioning.
Best to nest multiple HTML tables each other.
Fixed width positioning – Fluid elements in your newsletter need to size a few things so you should try to keep size in pixels rather than in another unit.
Working within the 600px max width limit, you can actually fit a lot of content inside. Exposure is easier if you split your layouts into two or three columns, and always write your sizes in pixels. The only exception may be to font sizes where ems can support your readers better, but em sizing will differ in similar way percentages would – so for simplicity’s sake, stick to pixel-based alignments.
c. CSS use – If you can build what you need without CSS I would recommend that path, but don’t completely shy away from CSS in e-mail designs because contrary to popular belief it is supported in most cases.

D. Anchor Links – It is sure that you have to include some links in your HTML newsletter. These could be outbound links to other web pages or links related to your website. Most footers include an unsubscribing link to opt-out from your list how you should handle all these links in your newsletter.
A neat trick is to include both inline color and an additional span tag within the anchor element. If the color and styling of your links are important to the overall design you’ll want to take the extra precaution. I’ve added a small code example below:

some link text

Hover effects are not supported in Outlook 2007/2010, Gmail, iOS or Android. You may still want to include the a:hover style for all supporting clients: Outlook 2000/2003, Hotmail, Apple Mail, and Yahoo! mail, but personally I don’t see much benefit in the partial user experience, since the anchor selectors aren’t heavily supported I recommend just offering 2-3 link colors to use throughout your design.
As a presumption users will also expect your links to open in a new tab or window. Ideally the target=”_blank” attribute should be enough for all browsers to recognize this functionality, and the inclusion of this attribute on your anchor links shouldn’t negatively effect e-mail software such as Lotus Notes, or Outlook either.
E. Always provide a web based view – Readers won’t always be able to view your email natively always offering another version somewhere on the web will give a sense of compatibility.
F. Adding image content :- You’ll want to always set both width and height attributes on your img tags. Without these specifications in order, some clients will distort the image content. An alt tag will also prove useful, so visitors will know what the image content contains before it’s loaded.
The image align=”left” attribute will work much better, or alternatively map out exact table cells to fit your images along the top, left, or right side of your newsletter. You won’t be able to get a perfect match-up with so many clients out there (especially mobile clients), but optimize your images and keep file sizes small for best results.
What content you should write in your newsletter
Make HTML use to create a performing newsletter
Get creative with email subject line
Pic one primary call to action

4 tips for writing good email

Most of us Judge emails by their subject line whether to read the email or directly delete them all decided by subject line.
Hence subject line is the first impression of your email to your recipients although it is a small part of our email but play a most important role in our email marketing strategy.
Email subject line serve the purpose of our email, what email body contains, and it relates your goal directly with your message. Hence it is a very important part of our whole email that’s why here we are trying to tell you some tips to improve your email subject lines.

  • Keep it short and simple. Subject line should be a maximum of 50 characters
  • Use personalization tokens in subject line it will help to catch their attention. Every one loves the sound of their name. Adding recipient name adds a feeling of a relationship of mutual understanding or trust and agreement between people
  • If you can’t (or don’t want to) use personalization tokens in the subject line, use “you” or “your,” so it still sounds like you’re addressing them directly.
  • The goal behind the email should be clear. when one read your email subject line it should be clear what your email is about.
  • Do not make false promise to increase open rate of your email this will lead irritation in your audience and will lead to a big unsubscribe list.
  • Use A/B testing, split testing with different content in subject line. this will give you a better performing subject line.
  • Most important. How will your viewer benefit from your email ? For example, “Increase your open rates by 60% today” is more appealing than “How to increase open rates.”
  • Make your subject line interesting. For example – “Your order has been received”  is less interesting than “Your new order – 868332 request received ”
  • Use numbers in your subject line. For example “Tips to improve subject line” is less effective than “10 Tips to improve your subject line”
  • Use deadline like “only for today” , “last 10 hours” , this will give a quick hit on your email.
  • Asking a question can also increase user engagement with your email.
  • Make your subject line “Location-specific” for offers related to particular locations only.
  • Make your recipient feel special with creating subject line. Like “Offer For our beloved customers only”
  • Do not use capitalization in email subject line.