Fetchmail to Zarafa

From Zarafa wiki

(Difference between revisions)
Jump to: navigation, search
m (Reverted edits by Ynypokizek (talk) to last revision by Bartdaniels)
 
Line 1: Line 1:
-
----
 
-
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 
-
----
 
-
=[http://erihybomex.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]=
 
-
----
 
-
=[http://erihybomex.co.cc CLICK HERE]=
 
-
----
 
-
</div>
 
== fetchmail collection to Zarafa Mailboxes: ==
== fetchmail collection to Zarafa Mailboxes: ==

Latest revision as of 09:11, 24 November 2010

fetchmail collection to Zarafa Mailboxes:

There are a few tools out there that will collect emails from External POP3 servers and deliver them to a local Zarafa server. One of them that is by far the easiest to use is fetchmail.

The following will take you through the configuration needed to use fetchmail with Zarafa.

Firstly, we need to create the 'fetchmailrc' file. This file contains the configuration parameters, usernames,passwords and what servers to download the mail from.

/root/.fetchmailrc:

   set daemon 60
   defaults
           proto pop3
           nokeep
   poll user@domain.com.au
           via mail.domain.com.au
           user "user@domain.com.au"
           pass "password"
           mda "/usr/bin/zarafa-dagent user"
           flush
           no ssl

There are a number of other parameters you can use, find more here: Redhat Fetchmail Commands

Then you repeat the 'poll' section to 'no ssl' for each user. Obviously changing the details.

Next create a file called: /etc/cron.domain/fetchmail.sh and add the following to that file: (This file will be called via crontab to initiate the fetchmail collection every 5 minutes or what ever you specify.)

/etc/cron.domain/fetchmail.sh


   #!/bin/bash
   #
   # Add this to a cron process that runs once every 15 mins
   # just to make sure fetchmail is up and running
   #
   fetchmailpid=`/sbin/pidof fetchmail`
   #
   # If fetchmail is not running then start it
   #
   if [ $? -ne 0 ]; then
     /usr/bin/fetchmail -F -K -L /var/log/fetchmail
   fi
  • Please note: The '-K' option above will delete retrieved messages from the remote mailserver. If you want to keep the emails on the external POP3 server, then i would suggest removing the '-K'.

Parameter Breakdown from above:

   -K - Delete retrieved messages from the remote mailserver. This option forces retrieved mail to be deleted
   -L - Specify the log file to which fetchmail should log to
   -F - Delete old (previously retrieved) messages from the mailserver before retrieving new messages

Set the permissions on the /etc/cron.domain/fetchmail.sh to 777:

   chmod 777 /etc/cron.domain/fetchmail

Now we setup the cron to collect the mail every 5 minutes:

   */5 * * * * /etc/cron.domain/fetchmail.sh

If there any errors check the /var/log/fetchmail.log for more information.

Personal tools