Installing and setting up Postfix SMTP Server in Ubuntu 10.04 is easy. Postfix by default uses the mbox mail format so we’ll just change it to maildir.
Configure Postfix


sudo vi /etc/postfix/main.cfand add the line below
home_mailbox = Maildir/
In main.cf, lines starting with # are comments. Save the file after completing your changes.
Make sure that the mail_spool_directory and mailbox_command lines are commented out. Otherwise, it will override the setting in the home_mailbox line.
If you are not familiar with vi, check out this quick vi tutorial.Test Postfix
Here is a sample postfix session. Replace johndoe with any valid user account. The dot after the line test is a command that should be typed in.
If you need to add new user accounts, learn how to add or remove user accounts here.johndoe@mail:~$ telnet localhost smtp Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 220 mail ESMTP Postfix (Ubuntu) ehlo localhost 250-mail 250-PIPELINING 250-SIZE 10240000 250-VRFY 250-ETRN 250-STARTTLS 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN mail from:<johndoe> 250 2.1.0 Ok rcpt to:<johndoe> 250 2.1.5 Ok data 354 End data with <CR><LF>.<CR><LF> test . 250 2.0.0 Ok: queued as 9729067C17 quit 221 2.0.0 Bye Connection closed by foreign host. johndoe@mail:~$
To check if the mail indeed exists
johndoe@mail:~$ cd /home/johndoe/Maildir/new johndoe@mail:~/Maildir/new$ ls 1185669817.Vfd00I18012M795756.mail johndoe@mail:~/Maildir/new$ cat 1185669817.Vfd00I18012M795756.mail
Don’t worry, you don’t have to type in the whole filename above. Just type in the first few characters say 118 then press Tab to activate automatic completion.
From johndoe@mail.acme.local Thu Feb 22 21:48:28 2007
Return-Path: <johndoe@mail.acme.local>
X-Original-To: johndoe
Delivered-To: johndoe@mail.acme.local
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by mail.acme.local (Postfix) with SMTP id 9729067C17
for <johndoe>; Thu, 22 Feb 2007 21:48:26 -0500 (EST)
Message-Id: <20070222134827.9729067C17@mail.acme.local>
Date: Thu, 22 Feb 2007 21:48:26 -0500 (EST)
From: johndoe@mail.acme.local
To: undisclosed-recipients:;
test
johndoe@mail:~/Maildir/new$
If you encounter any problems, check the log file at /var/log/mail.log.Visit the forum to ask for help or to give a comment.
***
Posted on 9/11/2011 and last updated on 9/12/2011
Filed under Postfix , Ubuntu 10.04
