Project

General

Profile

Actions

Feature #2490

open

a less cpu-intensive setup for receiving emails through fetchmail/imap (please add to wiki ?)

Added by Jérémy Lal over 15 years ago. Updated over 5 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Email receiving
Target version:
-
Start date:
2009-01-11
Due date:
% Done:

0%

Estimated time:
Resolution:

Description

Hi,
i did not want to open my smtp port as i'm not good at configuring mail server...
So here's a method that uses fetchmail to get redmine to receive emails using WS :

  • Fetching emails from an IMAP server using fetchmail to pipe to WS:
    • Pros: quite easy to setup, .fetchmailrc and crontab needed to be configured, works with a remote mail server, no open smtp port, is not CPU-intensive
    • Cons: emails are not processed instantly, fetchmail is in daemon mode

Fetching emails from an IMAP server using fetchmail to pipe to WS

fetchmail need to be installed.

Add a redmine user (sudo adduser --disabled-password redmine)

Add a .fetchmailrc file in /home/redmine (change this file according to your configuration):

set daemon 60
poll imap.gmail.com with
   proto imap
   service 993
   timeout 10
   user redmine@xxx.xx
   password xxxxx
   ssl
   mda "ruby /usr/share/redmine/extra/mail_handler/rdm-mailhandler.rb --url http://host.redmine.com --key <your secret key>" 

This will poll emails received in the imap inbox every 60 seconds.

Add a crontab for user redmine to make sure fetchmail starts at boot:

# m h  dom mon dow   command
@reboot    nice -19 /usr/bin/fetchmail &> /dev/null

For testing purposes, comment (#) the first line of /home/redmine/.fetchmailrc,
and start fetchmail (as redmine user)
If it works ok, uncomment and start fetchmail again, it will poll every 60 seconds for incoming mails :
nice -19 /usr/bin/fetchmail &> /dev/null

Actions

Also available in: Atom PDF