LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-25-2009, 04:29 AM   #1
darkeagl
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Rep: Reputation: 0
Fetchmail and Imap Issue


Hi guys,

Till now I could solve all my problems with your help in the forum but now I cannot find anything really that helps me so I ask directly.

I set up a new Suse 11.1 server with fetchmail postfix and cyrus. The problem was that I started fetchmail for the first try without configuring postfix and cyrus first.
Now the problem: I have in /var/spool/mail couple of large files with several mails in them. How can I separate them and deliver them to my /var/spool/imap/user ... folders? I donīt want to do it manually and there should be an easier way, I hope.

I hope for a fast answer And thank you guys anyways.
 
Old 07-26-2009, 06:08 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Configure procmail with the right delivery recipes, then cat the mailspools and pipe them through procmail?
 
Old 07-26-2009, 01:43 PM   #3
darkeagl
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Original Poster
Rep: Reputation: 0
I have already set up the system without procmail. After a long search yesterday I found a nice small script mb2md which did the trick now I just need to import the mails somehow to the imap cyrus system.
 
Old 07-26-2009, 05:35 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
IMAP is just a representation layer on top of the mailbox and maildir format.
 
Old 07-27-2009, 05:51 AM   #5
darkeagl
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Original Poster
Rep: Reputation: 0
OK but how do I import my mails now into the maildir system, that cyrus and the users see them? Iīm totally new to this kind of stuff and frustrated right now. Sitting on this small thing now already for a week...
 
Old 07-27-2009, 06:40 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
I pointed to procmail but in return you said you "already set up the system without procmail" and something about some script. That makes it kind of stalemate, right?
So as far as your options go you could 0) install procmail, 1) wait for somebody to recommend Something Else, 2) go search for another solution or 3) move emails manually.
 
Old 07-28-2009, 05:02 AM   #7
darkeagl
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Original Poster
Rep: Reputation: 0
I could install procmail, or better to say it is installed but I just donīt use it. Can you tell me step by step how to do it on Suse 11.1. I would appreciate it.

Last edited by darkeagl; 07-28-2009 at 05:22 AM.
 
Old 07-28-2009, 07:31 AM   #8
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Simply put procmail is a mail delivery agent (MDA). It gets handed over complete messages from a mail transfer agent (MTA) and delivers those according to rules. Note the input usually comes from the MTA but can be a another process, a mailbox or maildir as well as any other convoluted scheme. Also note "delivery" means stuffing messages in local mailboxes or maildirs but any preprocessing like handing it off to an AV scanner, changing subject or driving arbitrary scripts is possible. Because procmail can see the whole message these rules (called "recipes") can act on any aspect of a message including headers that are invisible to the mail user agent (MUA), visible headers like the sender, lists of addresses, recipient, subject and whatnot.

* In general experimenting can lead to interesting results and mucking with mailspools and procmail isn't the exception. Working with copies of mailspools, delivering to test addresses and using test mailboxes makes sense. Also enable debug settings.

Let's try delivering email messages from a copy mailspool to a local users test maildirs:
Code:
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin
SHELL=/bin/sh
# "VERBOSE=on" for debugging.
VERBOSE=on
# Default delivery option
DROPPRIVS=yes
# As much logging as possible
LOGABSTRACT=all
# Mailbox to deliver to if not filtered
DEFAULT=/var/TEST/procmail.mbx
# Logfile to read back in case of troubleshooting
LOGFILE=/var/TEST/procmail.log

# Deliver to MAILDIR (notice slash at end of path) for recipient "postmaster"
:0:
* ^To:.*postmaster
/var/TEST/spool/imap/postmaster/MAILDIR/

# Deliver to MAILDIR for recipient "Administrator" who can be in the
# "hostname.doma.in", "doma.in" or "localhost" domain:
:0:
* ^To:.*Administrator@(([-a-z0-9]+\.)*doma\.in|localhost)
/var/TEST/spool/imap/administrator/MAILDIR/

# =========================================================================
# Last rule:  mailbox for unfiltered email
:0:
$DEFAULT
# ==========================================================================
# End of Recipes
How to use this. In /var/TEST/spool/ create "${USERNAME}/MAILDIR/" subdirectories for all usernames you want to test delivery with and set user access accordingly. Save above recipe as /var/TEST/procmail.rc and create a recipe for each user you created a test maildir for. Run ''cat /var/spool/mail/spoolfilename | formail -s | procmail -m /var/TEST/procmail.rc 2>&1 | tee /var/TEST/procmail.tee'. Read back /var/TEST/procmail.log in case of errors and check /var/TEST/procmail.mbx for undeliverables.
 
  


Reply

Tags
cyrus, fetchmail, imap, postfix, suse



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
fetchmail - postfix - imap etam Linux - Newbie 2 10-23-2006 12:35 PM
fetchmail for imap el_pajaro! Linux - Server 3 09-05-2006 07:14 PM
fetchmail from imap to imap? martsari Linux - Networking 1 07-03-2006 11:48 AM
Fedora + IMAP + Squirrelmail + Fetchmail + Procmail murphy23 Linux - Software 2 03-30-2004 08:47 AM
IMAP and fetchmail / postfix / procmail / spamc etc... fordboy0 Linux - Networking 2 09-17-2003 07:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:25 AM.

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
Open Source Consulting | Domain Registration