Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 03-06-2009, 08:26 AM   #1
LQ Newbie
Registered: Mar 2008
Posts: 11

Rep: Reputation: 0
fetchmail dovecot postfix and filtering

I have taken the plunge and stored my mail archive on a nslu2 ( running an imap server (dovecot) on Debian (5.0) after the kind suggestions by people here...

I have even managed to get the imap server to hand smtp mail to procmail which then uses my isp as a relay so I even get sent mail stored on imap (rather handy!)

All is good
(after lots of cursing! there are just *so* many ways to set these things up!)

However the one thing I'm stuck on implementing filtering

I have this kind of structure (mbox files)

|-- Drafts
|-- HelenOS
|-- Sent
|-- Trash
|-- archive
|   |-- 2004
|   |-- 2005
|   |-- 2006
|   |-- 2007
|   `-- 2008
|-- archive-sent
|   |-- 2004
|   |-- 2005
|   |-- 2006
|   |-- 2007
|   `-- 2008
|-- gce
|-- growveg
|-- inbox
|-- scottishpower
|-- ubuntu
|-- virgin
`-- wii
where mail is in home/username

so for example if something is coming from it wants to go in ~/mail/ubuntu
(I'll be good for filter syntax just once I have somewhere to put it and a working config round it!)

my problem is that I have seen so many different tutorials for filtering I just dont know which way to turn! some say sendmail some fetchmail some are using sql (i'm not) some suggest procmail etc etc!
the list in inexhaustible seemingly...

here's some config excerpts that might clue you into how I lashed things together!

set no bouncemail
set logfile fetchmail.log
set idfile fetchmail_uidls.log
poll with proto pop3 service 110 uidl username
"the bit before the @" with password "yeah like I'm telling" is "chris" here fetchall
added to postfix
home_mailbox = mail/inbox
relayhost =
I don't remember adding anything to dovecot's config

I do realise that this is probably the simplest case and the simplest set up but with the 1001 different ways to go, finding info from tutorials can be uphill!

oh nearly forgot theres a /etc/init.d/fetchmail yet I have to run a user cron job for fetchmail is this normal?

Oh and if you got all the way down here thanks for reading!
Old 03-07-2009, 01:01 AM   #2
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
There seems to be a little confusion here (not helped by the crossover in what some packages do). Postfix is an MTA (,ail trandfer agent) that can also act as an MDA (mail delivery agent) which is what procmail is.

Now I don't use procmail, because I use maildrop (another MDA), but that allows me to tell postfix to use maildrop as my MDA (see mailbox_command parameter for or Once that is done, I have a text file (~/.mailfilter) tha thas pattern matching and deliver rules that allow me to direct mail with various senders, subjects or whatever I choose to match to a specific mail folder.

I'm sure you could do the same with procmail, but as I said, I don't use it.


Edit - try a line like
@reboot fetchmail -d 600 > /dev/null 2>&1
in your users crontab. This runs fetchmail as a daemon, checking for mail every 600 seconds.

Last edited by billymayday; 03-07-2009 at 01:03 AM.


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
Fetchmail/Dovecot Receiving Partial Image Attachments centos82 Linux - Software 0 11-08-2008 11:17 AM
dovecot & fetchmail ... fetching all mail xrado Linux - Networking 4 08-05-2008 04:27 PM
Fetchmail / Dovecot configuration Lord Wodan Linux - Server 6 09-10-2007 09:50 PM
Postfix Dovecot Help BigAppleFan Linux - Newbie 7 08-15-2005 05:08 PM
Postfix and Dovecot umbraeOtheisles Linux - Software 3 11-23-2004 07:36 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:00 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
Open Source Consulting | Domain Registration