Feature #2490

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

Added by Jérémy Lal over 13 years ago. Updated almost 4 years ago.

Status:NewStart date:2009-01-11
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Email receiving
Target version:-
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

History

#1 Updated by Jérémy Lal over 13 years ago

also note that this method is "safer" : the fetchmail daemon is run as redmine user, not suid root,
whereas it configuring the MTA in method 1 could lead to some security issue.

#2 Updated by Jérémy Lal over 13 years ago

NB : chmod 710 .fetchmailrc

#3 Updated by Jérémy Lal over 13 years ago

  • Assignee set to Jean-Philippe Lang

#4 Updated by Toshi MARUYAMA over 8 years ago

  • Category changed from Wiki to Email receiving

#5 Updated by Toshi MARUYAMA over 8 years ago

  • Tracker changed from Patch to Feature

#6 Updated by Yar n about 8 years ago

why this method is better than simple imap/pop fetching?

#7 Updated by Toshi MARUYAMA about 8 years ago

  • Category changed from Email receiving to Documentation

#8 Updated by Toshi MARUYAMA about 8 years ago

  • Category changed from Documentation to Email receiving
  • Assignee deleted (Jean-Philippe Lang)

#9 Updated by Fernando Fernandez almost 4 years ago

Can I use with an office365 mailbox?

Also available in: Atom PDF