Wednesday, May 5, 2010

Setup Postfix Virtual Domains

In this article, I assume that postfix has been already setup on the server and running. Here I am going to describe how to setup postfix virtual domains using hash tables. The mailboxes will also be separate accounts and not unix system accounts.

Edit /etc/postfix/main.cf file and add the following parameters.

1.  virtual_mailbox_domains=/etc/postfix/vdomains
    Here, /etc/postfix/vdomains is the file which contains names of the domains to be setup virtually and handled by postfix. Remember to enter one domain per line.

2. virtual_mailbox_base=/home/vmail
    It tells the postfix system about the base directory of the mail store. It can be any directory on the unix system.

3. virtual_mailbox_maps=hash:/etc/postfix/vmaps
   Here I have created a lookup file that maps email addresses to their mailboxes. A virtual mailbox will looks like the following.
      test@test.com                              test.com/test
      webmaster@mydomain.com        mydomain.com/webmaster
  Remember to create the hash table of the file using the following command:
     #postmap /etc/postfix/vmaps


4. Setup mailbox file ownership using following directives in main.cf.
     virtual_uid_maps= ( check /etc/passwd for uid )
     virtual_gid_maps= ( check /etc/group for gid )

5. Create required folders under /home/vmail,  e.g. for domain mydomain.com and user webmaster, the directory structure will looks like the following:
     #mkdir  /home/vmail/mydomain.com
     #mkdir  /home/vmail/mydomain.com/webmaster
     #mkdir -p  /home/vmail/mydomain.com/webmaster/{cur,new}


6. Change ownership and folder permissions.
    #chown  -R postfix.postfix  /home/vmail/mydomain.com
    #chmod  -R  775  /home/vmail/mydomain.com


7. Reload postfix system to implement the changes done above.
    #postfix reload


Thats it! Your postfix system has been configured to support multiple domains now.

Thanks!!!
  

Sunday, May 2, 2010

Configure VNC server on remote linux system.

Here I am going to explain how to setup VNC server on remote Linux system running ubuntu server.

Step 1: Make sure you are able to get connected with remote server using SSH.

Step 2: Install ubuntu desktop package on the server that will provide gnome environment.
#aptitude install ubuntu-desktop

Step 3: Install tightvnserver on the server.
#aptitude install tightvncserver

Step 4: Reconfigure XServer.
#dpkg-reconfigure xserver-org

Step 5: Run the VNC Server using following command.
#vncserver :1 -geometry 1024x768 -depth 16 -pixelformat rgb565
It will start VNC server at display 1.

Step 6: Use following command in order to stop/kill running VNC instance.
#vncserver -kill :1

Step 7: Use any of your favorite VNC client to get connected with VNC server using following syntax:
:1

That's it! Were you expecting some more complicated steps? Sorry to disappoint you :)