User Tools

Site Tools


local_imap

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
local_imap [2015/10/25 14:40] – [Configure fetchmail to deliver mail to local users] Converted to using procmail. breetailocal_imap [2016/03/27 14:37] (current) – [Local Dovecot IMAP server] breetai
Line 36: Line 36:
  
 <code> <code>
-apt-get istall dovecot-common dovecot-core dovecot-imapd+apt-get install dovecot-common dovecot-core dovecot-imapd
 </code> </code>
 Standard settings don't allow dovecot to manage /var/mail/ and it goes bonkers because of that. It shows this with the following error in /var/log/syslog. Change the configuration of dovecot to use the mail group for accessing the mail spool. Standard settings don't allow dovecot to manage /var/mail/ and it goes bonkers because of that. It shows this with the following error in /var/log/syslog. Change the configuration of dovecot to use the mail group for accessing the mail spool.
Line 267: Line 267:
  
 === Global fetchmailrc === === Global fetchmailrc ===
-Now lets create a new global /etc/fetchmailrc. Inspiration taken from [[https://www.howtoforge.com/debian_etch_fetchmail|here]] or you can also find it in /usr/share/doc/fetchmail/examples..+Now lets create a new global /etc/fetchmailrc. Inspiration taken from [[https://www.howtoforge.com/debian_etch_fetchmail|here]] or you can also find it in /usr/share/doc/fetchmail/examples.
 <code> <code>
 # /etc/fetchmailrc for system-wide daemon mode # /etc/fetchmailrc for system-wide daemon mode
Line 294: Line 294:
 poll  pop.xs4all.nl protocol POP3:  poll  pop.xs4all.nl protocol POP3: 
 envelope  X-XS4ALL-TO envelope  X-XS4ALL-TO
- user "some_user1" there with password "<password>" is "some_user1" here fetchall; + user "some_user1" there with password "<password>" is "some_user1" here fetchall 
- user "some_user2" there with password "<password>" is "some_user2" here fetchall +mda '/usr/bin/procmail -d some_user1' 
-mda '/usr/bin/procmail -d %T'+ 
 +poll  pop.xs4all.nl protocol POP3:  
 +envelope  X-XS4ALL-TO 
 +user "some_user2" there with password "<password>" is "some_user2" here fetchall  
 +mda "/usr/bin/procmail -d some_user2"
 </code> </code>
 The with *envelope* is needed to prevent warnings from syslog. It identifies which header fetchmail should use to feed it to the local mail server.  The with *envelope* is needed to prevent warnings from syslog. It identifies which header fetchmail should use to feed it to the local mail server. 
  
-The *mda* command tells fetchmail to use procmail and tell procmail to deliver it to the local user. +The *mda* command tells fetchmail to use procmail and tell procmail to deliver it to the local user. also don't use single quotes ( ' ) but double quotes on the command line. Otherwise strange stuff happens.  
 + 
 +Also addressing multiple users was quite difficult. A lot of tutorials use either the multiple users per single drop and don't use the mda. Or use a single user and then use mda with procmail. I tried using the "procmail -d %T" method across multiple lines but then it ust didn't work. So it's better to have 2 complete separate definitions and hardcode procmail to the correct user per session. Haven't had a problem since
  
 Make sure that the daemon starts with the following setup for /etc/fetchmailrc: Make sure that the daemon starts with the following setup for /etc/fetchmailrc:
Line 309: Line 315:
  
 === Test run === === Test run ===
-The test run didn't pan out that well. It's better to just start the daemon in regular mode. But having acute logging open of /var/log/syslog and /var/log/mail.log via "tail -f" I observed what happened. Like for instance my mail being downloaded and then disappearing. Exim deemed the culprit in this case. It had a limit of only 10 new entries per delivery. Nice for a big site, but worthless for a small site like mine. So adapt the setting for Exim. Figuring this out is deemed out of scope for this article.+The test run didn't pan out that well. It's better to just start the daemon in regular mode. But having acute logging open of /var/log/syslog/var/log/mail.log and /var/log/procmail via "tail -f" I observed what happened. Like for instance my mail being downloaded and then disappearing. Exim deemed the culprit in this case. It had a limit of only 10 new entries per delivery. Nice for a big site, but worthless for a small site like mine. So adapt the setting for Exim. Figuring this out is deemed out of scope for this article.
  
 === Enable fetchmail globally ===  === Enable fetchmail globally === 
local_imap.1445784035.txt.gz · Last modified: 2015/10/25 14:40 by breetai