Wednesday, August 29, 2012

Setting up email server on CentOS 6.2

Setting up email server on CentOS 6.2 within 5 minutes

If you have only 5 minutes,  you can still setup an email server on CentOS 6.2. Don't waste it :)

This email server supports SMTP(TCP port 25) and IMAPS(secure IMAP,TCP port 993). Now, you can specify this as an outgoing and incoming email server on email client such as Thunderbird on your PC.

1. Install packages

Three packages are required for this. Install them if you haven't done yet.
$yum install sendmail
$yum install sendmail-cf
$yum install dovecot

The role of sendmail is to receive emails destined to you and keep them in your mailbox on email server. Then, dovecot actually delivers those emails to your PC when you open Thunderbird or Microsoft Outlook. For outgoing email, Thunderbird first contacts sendmail, then sendmail relays the email to final destination for you.

2. Configure sendmail

You just need to change 2 lines in configuration file /etc/mail/sendmail.mc

Comment out this to allow receiving email from anywhere.
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl


Add this line
FEATURE(`relay_hosts_only')dnl
Add your PC's full hostname in this file. Create one if this file doesn't exist.
/etc/mail/relay-domains

After changing configuration file, run this command to activate it.

$/etc/mail/make
$service sendmail start

3. Configure dovecot

You just need to edit two files.

In /etc/dovecot/dovtcot.conf, just edit these two lines
protocols = imap
listen = *, ::

In /etc/dovtcot/dovecot.d/10-mail.conf, edit these 3 lines

mail_location = mbox:~/mail:INBOX=/var/mail/%u
mail_privileged_group = mail
mbox_write_locks = dotlock fcntl

Start dovecot service
$service dovecot start
4. (Optional) Reconfigure iptables only if you are already using iptables
Add these 2 lines into /etc/sysconfig/iptables to allow email to go through firewalls.

-A INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 993 -j ACCEPT

then, restart iptables by
$service iptables restart

DONE
This is it. Of course, you can do more to enhance the security level of your email server. For example, you can make sendmail more secure by using SMTP over SSL. Feel free to suggest any idea about this article. Thanks.

Tuesday, August 28, 2012

"CON" Folder On Desktop

This is very common question in our mind that why we can’t create a folder with name CON, NUL, COM1, COM2, COM3, LPT1, LPT2, LPT3,COM1 to COM9 and LPT1 to LPT9……..

But here we will create folder with these name…….

you need to follow these steps carefully

STEP1: G oto command prompt

STEP2: and type md \\.\\”c:\con” (with quotes)

The above command will create the folder named “con” in Drive C:

To create that folder in your desktop (for Windows XP) replace the ‘c:\con’ with the FULL PATH of your Desktop, Below is an Example:

md \\.\\”C:\Documents and Settings\USER\Desktop\con” (Where USER is your USERNAME)

(You MUST specify the full path within double quotes ["] If it contains spaces)

In Windows 98, your Desktop path would be : C:\windoiws\Desktop (where C: is the drive letter if your Windows installation)

That is all about creating the folder.

BUT DON’T STOP HERE
Because after creating such a folder, you can’t delete it by simply pressing the DEL key.
To delete this kind of folder, use the same command replacing MD with RD. For example:

rd \\.\\”c:\con” (with quotes for path containing spaces)