Re: [Dovecot] How do I get my mail from fetchmail into dovecot
Am 29.04.2009, 21:31 Uhr, schrieb Andrzej Adam Filip : Michael Steinbeck-Reeves wrote: [...] That is the problem, fetchmail just forwards it to port 25 (I think) and I need to work out what to put between fetchmail and dovecot in order to get the mail into the correct folders... And I am just going around in circles on this at the moment. Any hint would be appreciated! You can use mda option provided in fetchmail as SMTP alternative. - I recommend using procmail as mda in ~/.fetchmailrc e.g.: mda "/usr/bin/procmail -tY -m /home/user/.procmail/account-1.rc" and calling dovecot's deliver inside procmail scripts DELIVER="/usr/lib/dovecot/deliver" DELIVERFLAGS="-e" :0 w |$DELIVER $DELIVERFLAGS Using procmail provides nice hook for extra processing e.g. * spam filtering/tagging * virus detection - You can make fetchmail use dovecot's deliver direclty in mda option I advise against the use of procmail for fresh installs. Use maildrop instead. It is maintained, has cleaner code, cleaner interfaces, much better error handling and an easier-to-read syntax. => http://www.courier-mta.org/maildrop/ -- Matthias Andree
Re: [Dovecot] How do I get my mail from fetchmail into dovecot
Steinar Bang wrote: >> Andrzej Adam Filip : > >> You can use mda option provided in fetchmail as SMTP alternative. >> - >> I recommend using procmail as mda in ~/.fetchmailrc e.g.: > > Heh... I'm an old procmail user, and was happy to be able to switch back > to it from sieve (which I never really got the hang of), when moving > from cyrus to dovecot. > > But I'm not sure if I'd ever *recommend* it to someone else. > > On a side note: the exim default config of debian (and debian > derivatives, like Ubuntu), uses procmail for filtering and delivery if > it is available, and there is a .procmailrc file in the users' home > directories. I use *both* (procmail script as fetchmail's MDA and sieve). Somehow I prefer to: a) avoid passing messages via local MTA (fetchmail's default) b) avoid calling dovecot's deliver directly from ~/.fetchmailrc -- [pl>en: Andrew] Andrzej Adam Filip : a...@onet.eu "They are both businesses - if you have given them enough money, I'm sure they'll do whatever the hell you ask:->" -- David Welton
Re: [Dovecot] How do I get my mail from fetchmail into dovecot
> Andrzej Adam Filip : > You can use mda option provided in fetchmail as SMTP alternative. > - > I recommend using procmail as mda in ~/.fetchmailrc e.g.: Heh... I'm an old procmail user, and was happy to be able to switch back to it from sieve (which I never really got the hang of), when moving from cyrus to dovecot. But I'm not sure if I'd ever *recommend* it to someone else. On a side note: the exim default config of debian (and debian derivatives, like Ubuntu), uses procmail for filtering and delivery if it is available, and there is a .procmailrc file in the users' home directories.
Re: [Dovecot] How do I get my mail from fetchmail into dovecot?
On Friday 01 May 2009 00:33:49 Michael Steinbeck-Reeves wrote: > Hi Andreas > > I sort of have it working but am still not quite there... > > I have created virtual users with homes under their mail folders > (using mbox), as recommended in the Dovecot Wiki VirtualUsers > section. Hi, The examples I gave, and the setup I have running, are for system users with real accounts. I don't know how this would translate for virtual users although it should be doable. Unfortunately I don't have the possibility to create a test setup that matches yours at the moment so I'm afraid I don't think I can help you much more. I'd try, however, to correct the errors the log files show you, and while you are at it, you might want to ditch mbox for Maildir, if you can afford to do so. I also think you should run Getmail as the vmail user in order to have an easier time with permissions, especially if you have a virtual domain hosting setup that involves Postfix (or any MTA, really) as well. Finally, you should head over to the Getmail mailing list and ask about using Getmail with virtual users there. Charles, the author of Getmail, is really helpful if you ask him the right questions the right way :) Andreas -- Andreas Ntaflos Vienna, Austria GPG Fingerprint: 6234 2E8E 5C81 C6CB E5EC 7E65 397C E2A8 090C A9B4
Re: [Dovecot] How do I get my mail from fetchmail into dovecot?
> Dovecot's Sieve support is excellent, thanks to Stephan Bosch. There is > much more documentation out there than I can possibly provide or link > to in this post but I think it gets the point across. Thanks for the examples. Does anyone know if dovecot-sieve supports the Editheade extensions which allow you to add or delete email headers? I currently use procmail and pipe to formail to add a header which indicates which procmail recipe got applied. I'd like to add headers in sieve so I can achieve the same result. Regards, Phill
Re: [Dovecot] How do I get my mail from fetchmail into dovecot?
Hi Andreas I sort of have it working but am still not quite there... I have created virtual users with homes under their mail folders (using mbox), as recommended in the Dovecot Wiki VirtualUsers section. I have had quite a time with permissions! Finally getmail and vmail appear to have the required permissions in my structure. However, I still can't quite work out how the system knows which mailbox to deliver to - i.e. who is the virtual user? I tried setting it using the -d parameter but still get an error. My test files are as follows (a bit quick and dirty at the moment): .rc [retriever] type = SimplePOP3Retriever server = pophost.123-reg.co.uk username = -yy password = zzz [destination] type = MDA_external path = /usr/libexec/dovecot/deliver arguments = ('-d miker',) .dovecot.sieve if header :matches ["to","cc","bcc"] ["*"] { fileinto "inbox"; stop; } the log reads: deliver(getmail): Apr 30 23:43:20 Error: mbox root directory can't be a file: /var/spool/mail/getmail (http://wiki.dovecot.org/MailLocation/Mbox) deliver(getmail): Apr 30 23:43:20 Error: mbox root directory can't be a file: /var/spool/mail/getmail (http://wiki.dovecot.org/MailLocation/Mbox) The output from the command line is: [getm...@duquesne ~]$ /usr/bin/getmail --rcfile /var/spool/mail/miker/.imap/.imap/.getmail/xx.rc --getmaildir /var/spool/mail/miker/.imap/.imap/.getmail getmail version 4.8.4 Copyright (C) 1998-2008 Charles Cazabon. Licensed under the GNU GPL version 2. SimplePOP3Retriever:xx:110: Delivery error (command deliver 16665 error (64, Fatal: Unknown argument: -d miker)) msg 1/2 (1465 bytes), delivery error (command deliver 16665 error (64, Fatal: Unknown argument: -d miker)) Delivery error (command deliver 1 error (64, Fatal: Unknown argument: -d miker)) msg 2/2 (1870 bytes), delivery error (command deliver 1 error (64, Fatal: Unknown argument: -d miker)) 2 messages (3335 bytes) retrieved, 0 skipped directory listing ls -la /var/spool/mail ... drwx-- 2 getmail getmail 4096 2009-04-30 23:44 getmail ... Thanks, Michael On Thu, 2009-04-30 at 13:46 +0200, Andreas Ntaflos wrote: > On Thursday 30 April 2009 12:22:17 Michael Steinbeck-Reeves wrote: > > > Message: 1 > > > Date: Thu, 30 Apr 2009 00:27:46 +0200 > > > From: Andreas Ntaflos > > > Subject: Re: [Dovecot] How do I get my mail from fetchmail into > > > dovecot? > > > > > > > I have dovecot (with squirrel mail etc.) running without any > > > > problems but cannot understand how to get e-mail from a pop > > > > server into dovecot. I have fetchmail configured to pick up the > > > > mail from the pop3 server but don't understand how to get it from > > > > there into my dovecot mbox structure. > > > > > > My advice: forget Fetchmail and use Getmail [1] instead. Getmail > > > does everything Fetchmail does, only better. The documentation is > > > excellent, the author (and mailinglist) very responsive should you > > > run into problems you can't seem to solve on your own and I believe > > > there exist a number of HOWTOs on how to setup Getmail with > > > Dovecot. Not that it's very difficult, though. > > > > Thanks, I have changed over and your diagrams made it much more > > obvious what is actually going on. > > > > > I myself have such a "mail hamster" setup running just fine, which > > > I mentioned a few weeks ago on this list [2]. You might find that > > > post helpful. > > > > > > The general idea is to use Getmail to poll the remote mail servers > > > (I poll two POP servers and three IMAP-SSL servers), retrieve > > > messages, optionally scan them for viruses and spam and then hand > > > them over to your local Dovecot server using Dovecot's LDA > > > "deliver". See [3] for a nice picture :) If you skip virus and spam > > > scanning the configuration for a single remote IMAP server boils > > > down to: > > > > > > ~/.getmail/remote_imap_server.rc: > > > > > > [options] > > > verbose = 0 > > > read_all = false > > > > > > [retriever] > > > type = SimpleIMAPSSLRetriever > > > server = address_of_remote_imap_server > > > username = username_on_remote_server > > > password = password_on_remote_server > > > > > > [destination] > > > type = MDA_external > > > path = /usr/local/libexec/dovecot/deliver > > > > > > The destination part tells getmail to call the "deliver" program > > > (without any commandline options)
Re: [Dovecot] How do I get my mail from fetchmail into dovecot?
On Thursday 30 April 2009 12:22:17 Michael Steinbeck-Reeves wrote: > > Message: 1 > > Date: Thu, 30 Apr 2009 00:27:46 +0200 > > From: Andreas Ntaflos > > Subject: Re: [Dovecot] How do I get my mail from fetchmail into > > dovecot? > > > > > I have dovecot (with squirrel mail etc.) running without any > > > problems but cannot understand how to get e-mail from a pop > > > server into dovecot. I have fetchmail configured to pick up the > > > mail from the pop3 server but don't understand how to get it from > > > there into my dovecot mbox structure. > > > > My advice: forget Fetchmail and use Getmail [1] instead. Getmail > > does everything Fetchmail does, only better. The documentation is > > excellent, the author (and mailinglist) very responsive should you > > run into problems you can't seem to solve on your own and I believe > > there exist a number of HOWTOs on how to setup Getmail with > > Dovecot. Not that it's very difficult, though. > > Thanks, I have changed over and your diagrams made it much more > obvious what is actually going on. > > > I myself have such a "mail hamster" setup running just fine, which > > I mentioned a few weeks ago on this list [2]. You might find that > > post helpful. > > > > The general idea is to use Getmail to poll the remote mail servers > > (I poll two POP servers and three IMAP-SSL servers), retrieve > > messages, optionally scan them for viruses and spam and then hand > > them over to your local Dovecot server using Dovecot's LDA > > "deliver". See [3] for a nice picture :) If you skip virus and spam > > scanning the configuration for a single remote IMAP server boils > > down to: > > > > ~/.getmail/remote_imap_server.rc: > > > > [options] > > verbose = 0 > > read_all = false > > > > [retriever] > > type = SimpleIMAPSSLRetriever > > server = address_of_remote_imap_server > > username = username_on_remote_server > > password = password_on_remote_server > > > > [destination] > > type = MDA_external > > path = /usr/local/libexec/dovecot/deliver > > > > The destination part tells getmail to call the "deliver" program > > (without any commandline options) with the retrieved message. > > Dovecot then does the rest. > > That seems simple - thanks. > > Do I just put a list of retrievers, one after the other with a single > destination following that and let dovecot sort out the destinations? Normally you have one RC file per remote server your want to poll, with each RC file looking quite like the example I gave. Create a cron job for Getmail to run periodically and tell it which RC files to use: # Run every two minutes and get mail from the specified servers */2 * * * * /usr/bin/getmail \ --rcfile /home/daff/.getmail/dword.org.rc \ --rcfile /home/daff/.getmail/gmx.at.rc \ [...] Refer to the Getmail docs for further info. > The only thing I don't understand and can't find/understand in the > documentation is how to tell the LDA where to put my e-mails. I have > mails to several addresses mixed up in several POP3 boxes and need to > sort them out and deliver them based on the target address. e.g. > mich...@domain1 and mich...@domain2 go to my box etc. I can't see > where I identify the addresses and allocate the appropriate storage > area. This is where Sieve shines. If you don't use Sieve then the LDA (deliver) will just put any messages handed to it by Getmail into your top-level INBOX. With Sieve you can specify rules and tell the LDA what to do with each message. You should read up on Sieve [1], Sieve in Dovecot [2] and Dovecot's LDA [3]. Once you configured the LDA to understand Sieve you can create rules like the following: ~/.dovecot.sieve: # Messages from the Dovecot list end up in the IMAP folder # INBOX.dword.dovecot-users if header :contains ["List-Id"] ["Dovecot Mailing List "] { fileinto "INBOX.dword.dovecot-users"; stop; } # All messages addressed directly to me shall end up in # the IMAP folder INBOX.dword if header :matches ["to","cc","bcc"] ["*d...@dword.org*"] { fileinto "INBOX.dword"; stop; } # Another account I have. Put those messages in # the IMAP folder INBOX.gmx. if address :contains ["to","cc","bcc"] ["my.addr...@gmx.at"] { fileinto "INBOX.gmx"; stop; } Dovecot's Sieve support is excellent, thanks to Stephan Bosch. There is much more documentation out there than I can possibly provide or link to in this post but I think it gets the point across. Hope this helps :) Andreas [1] http://sieve.info/ [2] http://wiki.dovecot.org/LDA/Sieve [3] http://wiki.dovecot.org/LDA -- Andreas Ntaflos Vienna, Austria GPG Fingerprint: 6234 2E8E 5C81 C6CB E5EC 7E65 397C E2A8 090C A9B4
Re: [Dovecot] How do I get my mail from fetchmail into dovecot?
> Message: 1 > Date: Thu, 30 Apr 2009 00:27:46 +0200 > From: Andreas Ntaflos > Subject: Re: [Dovecot] How do I get my mail from fetchmail into > dovecot? > > I have dovecot (with squirrel mail etc.) running without any problems > > but cannot understand how to get e-mail from a pop server into > > dovecot. I have fetchmail configured to pick up the mail from the > > pop3 server but don't understand how to get it from there into my > > dovecot mbox structure. > > My advice: forget Fetchmail and use Getmail [1] instead. Getmail does > everything Fetchmail does, only better. The documentation is excellent, > the author (and mailinglist) very responsive should you run into > problems you can't seem to solve on your own and I believe there exist > a number of HOWTOs on how to setup Getmail with Dovecot. Not that it's > very difficult, though. Thanks, I have changed over and your diagrams made it much more obvious what is actually going on. > I myself have such a "mail hamster" setup running just fine, which I > mentioned a few weeks ago on this list [2]. You might find that post > helpful. > > The general idea is to use Getmail to poll the remote mail servers (I > poll two POP servers and three IMAP-SSL servers), retrieve messages, > optionally scan them for viruses and spam and then hand them over to > your local Dovecot server using Dovecot's LDA "deliver". See [3] for a > nice picture :) If you skip virus and spam scanning the configuration > for a single remote IMAP server boils down to: > > ~/.getmail/remote_imap_server.rc: > > [options] > verbose = 0 > read_all = false > > [retriever] > type = SimpleIMAPSSLRetriever > server = address_of_remote_imap_server > username = username_on_remote_server > password = password_on_remote_server > > [destination] > type = MDA_external > path = /usr/local/libexec/dovecot/deliver > > The destination part tells getmail to call the "deliver" program > (without any commandline options) with the retrieved message. Dovecot > then does the rest. That seems simple - thanks. Do I just put a list of retrievers, one after the other with a single destination following that and let dovecot sort out the destinations? The only thing I don't understand and can't find/understand in the documentation is how to tell the LDA where to put my e-mails. I have mails to several addresses mixed up in several POP3 boxes and need to sort them out and deliver them based on the target address. e.g. mich...@domain1 and mich...@domain2 go to my box etc. I can't see where I identify the addresses and allocate the appropriate storage area. Thanks, Michael
Re: [Dovecot] How do I get my mail from fetchmail into dovecot?
> I myself have such a "mail hamster" setup running just fine, which I > mentioned a few weeks ago on this list [2]. You might find that post > helpful. > > The general idea is to use Getmail to poll the remote mail servers (I > poll two POP servers and three IMAP-SSL servers), retrieve messages, > optionally scan them for viruses and spam and then hand them over to > your local Dovecot server using Dovecot's LDA "deliver". See [3] for a > nice picture :) If you skip virus and spam scanning the configuration > for a single remote IMAP server boils down to: Thanks for that - really useful post. I've been using fetchmail for ages which gets the amil and uses Procmail to apply some processing rules and deliver the messages to the appropriate folders. But I'll check Getmail now. I've been running procmail for years and have recently been toying with the idea of replacing that with dovecot-sieve but have been a bit reluctant to mess with things. But I'd also like to get Open-Xchange up and running and this requires sieve so that's why I'm looking at replacing Procmail. Great to hear someone's done it already and put together some nice documentation. Regards, Phill
Re: [Dovecot] How do I get my mail from fetchmail into dovecot?
On Wednesday 29 April 2009 15:46:05 Michael Steinbeck-Reeves wrote: > I have dovecot (with squirrel mail etc.) running without any problems > but cannot understand how to get e-mail from a pop server into > dovecot. I have fetchmail configured to pick up the mail from the > pop3 server but don't understand how to get it from there into my > dovecot mbox structure. My advice: forget Fetchmail and use Getmail [1] instead. Getmail does everything Fetchmail does, only better. The documentation is excellent, the author (and mailinglist) very responsive should you run into problems you can't seem to solve on your own and I believe there exist a number of HOWTOs on how to setup Getmail with Dovecot. Not that it's very difficult, though. I myself have such a "mail hamster" setup running just fine, which I mentioned a few weeks ago on this list [2]. You might find that post helpful. The general idea is to use Getmail to poll the remote mail servers (I poll two POP servers and three IMAP-SSL servers), retrieve messages, optionally scan them for viruses and spam and then hand them over to your local Dovecot server using Dovecot's LDA "deliver". See [3] for a nice picture :) If you skip virus and spam scanning the configuration for a single remote IMAP server boils down to: ~/.getmail/remote_imap_server.rc: [options] verbose = 0 read_all = false [retriever] type = SimpleIMAPSSLRetriever server = address_of_remote_imap_server username = username_on_remote_server password = password_on_remote_server [destination] type = MDA_external path = /usr/local/libexec/dovecot/deliver The destination part tells getmail to call the "deliver" program (without any commandline options) with the retrieved message. Dovecot then does the rest. HTH Andreas [1] http://pyropus.ca/software/getmail/ [2] http://dovecot.org/pipermail/dovecot/2009-March/038074.html [3] http://img394.imageshack.us/img394/6148/mailhamster.png -- Andreas Ntaflos Vienna, Austria GPG Fingerprint: 6234 2E8E 5C81 C6CB E5EC 7E65 397C E2A8 090C A9B4
Re: [Dovecot] How do I get my mail from fetchmail into dovecot
Michael Steinbeck-Reeves wrote: > [...] > That is the problem, fetchmail just forwards it to port 25 (I think) and > I need to work out what to put between fetchmail and dovecot in order to > get the mail into the correct folders... > > And I am just going around in circles on this at the moment. Any hint > would be appreciated! You can use mda option provided in fetchmail as SMTP alternative. - I recommend using procmail as mda in ~/.fetchmailrc e.g.: mda "/usr/bin/procmail -tY -m /home/user/.procmail/account-1.rc" and calling dovecot's deliver inside procmail scripts DELIVER="/usr/lib/dovecot/deliver" DELIVERFLAGS="-e" :0 w |$DELIVER $DELIVERFLAGS Using procmail provides nice hook for extra processing e.g. * spam filtering/tagging * virus detection - You can make fetchmail use dovecot's deliver direclty in mda option -- [pl>en: Andrew] Andrzej Adam Filip : a...@onet.eu Blessed is he who has reached the point of no return and knows it, for he shall enjoy living. -- W. C. Bennett
Re: [Dovecot] How do I get my mail from fetchmail into dovecot
I have dovecot (with squirrel mail etc.) running without any problems but cannot understand how to get e-mail from a pop server into dovecot. I have fetchmail configured to pick up the mail from the pop3 server but don't understand how to get it from there into my dovecot mbox configure dovecot-deliver as MDA for fetchmail. If you use system users, calling "deliver" should be sufficient. On virtual users, you probably need to pass the correct recipient to deliver. Anton
Re: [Dovecot] How do I get my mail from fetchmail into dovecot
On Qua, 29 Abr 2009, Michael Steinbeck-Reeves wrote: That is the problem, fetchmail just forwards it to port 25 (I think) and I need to work out what to put between fetchmail and dovecot in order to get the mail into the correct folders... A MTA (Mail Tranfer Agent), such as exim, postfix or others. Though there might be a way to configure fetchmail to store directly in the mail store, but I'm not sure (I don't use it). -- Eduardo M KALINOWSKI edua...@kalinowski.com.br
Re: [Dovecot] How do I get my mail from fetchmail into dovecot
> Message: 3 > Date: Wed, 29 Apr 2009 16:53:49 +0300 > From: Odhiambo ? > Subject: Re: [Dovecot] How do I get my mail from fetchmail into > dovecot? > To: Dovecot Mailing List > Message-ID: > <991123400904290653g205c603m2e4b511486a69...@mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > On Wed, Apr 29, 2009 at 4:46 PM, Michael Steinbeck-Reeves < > mich...@steinbeck-reeves.uk.com> wrote: > > > I have dovecot (with squirrel mail etc.) running without any problems > > but cannot understand how to get e-mail from a pop server into dovecot. > > I have fetchmail configured to pick up the mail from the pop3 server but > > don't understand how to get it from there into my dovecot mbox > > > Where does fetchmail put the e-mails? > Point dovecot there with "mail_location =..." then use your favorite MuA to > access the e-mail. That is the problem, fetchmail just forwards it to port 25 (I think) and I need to work out what to put between fetchmail and dovecot in order to get the mail into the correct folders... And I am just going around in circles on this at the moment. Any hint would be appreciated! Thanks, Michael
Re: [Dovecot] How do I get my mail from fetchmail into dovecot?
On Wed, Apr 29, 2009 at 4:46 PM, Michael Steinbeck-Reeves < mich...@steinbeck-reeves.uk.com> wrote: > I have dovecot (with squirrel mail etc.) running without any problems > but cannot understand how to get e-mail from a pop server into dovecot. > I have fetchmail configured to pick up the mail from the pop3 server but > don't understand how to get it from there into my dovecot mbox Where does fetchmail put the e-mails? Point dovecot there with "mail_location =..." then use your favorite MuA to access the e-mail. -- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254733744121/+254722743223 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ "Clothes make the man. Naked people have little or no influence on society." -- Mark Twain
[Dovecot] How do I get my mail from fetchmail into dovecot?
I have dovecot (with squirrel mail etc.) running without any problems but cannot understand how to get e-mail from a pop server into dovecot. I have fetchmail configured to pick up the mail from the pop3 server but don't understand how to get it from there into my dovecot mbox structure. New to mail servers! Thanks, Michael.