Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-10-2011, 01:12 PM   #1
Registered: Feb 2010
Location: chennai - India
Distribution: centos
Posts: 294

Rep: Reputation: 10
Each mail to be in Separate File..!!!

Hi friends

I need your valuable suggestions, that really helpful to my application

Is it possible to do in Linux each mail be in single file.

For example: i am having all the mail in /var/mail/root.

From root@localhost.localdomain Thu Mar 10 21:47:47 2011
Return-Path: <root@localhost.localdomain>
Received: from localhost.localdomain (localhost.localdomain [])
by localhost.localdomain (8.13.8/8.13.8) with ESMTP id p2AGHlx4004190
for <root@localhost.localdomain>; Thu, 10 Mar 2011 21:47:47 +0530
Received: (from root@localhost)
by localhost.localdomain (8.13.8/8.13.8/Submit) id p2AGHlD5004189
for root@localhost.localdomain; Thu, 10 Mar 2011 21:47:47 +0530
Date: Thu, 10 Mar 2011 21:47:47 +0530
From: root <root@localhost.localdomain>
Message-Id: <201103101617.p2AGHlD5004189@localhost.localdomain>
To: root@localhost.localdomain
Subject: new

company test
requirement newinstance

is it possible to do every mail when i receive it not store in the /var/mail/root. and need to be store like
/var/mail/root1(for firs mail) and for another mail would be store in diff file like /var/mail/root2(for second mail)

With Regards
Anish Kumar.V
Old 03-10-2011, 01:32 PM   #2
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Rep: Reputation: 68
you need to setup some MDA, that can work with maildirs; after installing just forward all incoming mails to it creating "~/.forward", e.g. for procmail:
echo '"| exec /usr/bin/procmail"' >~/.forward
Old 03-10-2011, 07:00 PM   #3
Registered: Feb 2010
Location: chennai - India
Distribution: centos
Posts: 294

Original Poster
Rep: Reputation: 10
Hi Ygrex,

echo '"| exec /usr/bin/procmail"' >~/.forward

Thanks for your suggestion, but i think you didn't understand my requirement is for each and every mail will be display in a single single file. i dont think for this MDA will works. any how I'll try and post the result.

With Regards,
Anish Kumar.V
Old 03-10-2011, 10:15 PM   #4
Registered: Nov 2001
Location: US
Distribution: Slackware 14.2
Posts: 354

Rep: Reputation: 93
You want Maildir format files. Your current /var/mail/root files are in Mbox format. You would use an MDA (like Procmail) to set the file format for the incoming mail. Procmail will set the format to Maildir if you add a trailing slash to your default mail directory in your ~/.procmailrc file (DEFAULT=$HOME/Mail/).


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
File name in separate column jeesun Linux - General 5 04-26-2010 05:27 AM
Separate server for mail? Zeno McDohl Linux - Server 1 01-07-2008 12:22 PM
Debian separate mail and web servers help rprodan Debian 4 12-22-2007 04:54 AM
How to save mail on separate partition yeehi Linux - Software 1 05-23-2004 11:56 AM
How to separate Incoming Mail and Outgoing Mail on SENDMAIL LiloAma Linux - Networking 1 03-22-2004 02:24 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:05 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration