LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 03-10-2011, 02:12 PM   #1
anishkumarv
Member
 
Registered: Feb 2010
Location: chennai - India
Distribution: centos
Posts: 289

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.


Quote:
From root@localhost.localdomain Thu Mar 10 21:47:47 2011
Return-Path: <root@localhost.localdomain>
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
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

XXXXXXXXXXXXXXXXXXXX
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, 02:32 PM   #2
Ygrex
Member
 
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:
Code:
echo '"| exec /usr/bin/procmail"' >~/.forward
 
Old 03-10-2011, 08:00 PM   #3
anishkumarv
Member
 
Registered: Feb 2010
Location: chennai - India
Distribution: centos
Posts: 289

Original Poster
Rep: Reputation: 10
Hi Ygrex,

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

Thanks for your suggestion, but i think you didn't understand my post...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, 11:15 PM   #4
speck
Member
 
Registered: Nov 2001
Location: US
Distribution: Slackware 14.2
Posts: 342

Rep: Reputation: 83
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/).
 
  


Reply


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 06:27 AM
Separate server for mail? Zeno McDohl Linux - Server 1 01-07-2008 01:22 PM
Debian separate mail and web servers help rprodan Debian 4 12-22-2007 05:54 AM
How to save mail on separate partition yeehi Linux - Software 1 05-23-2004 12:56 PM
How to separate Incoming Mail and Outgoing Mail on SENDMAIL LiloAma Linux - Networking 1 03-22-2004 03:24 AM


All times are GMT -5. The time now is 03:34 PM.

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