a less cpu-intensive setup for receiving emails through fetchmail/imap (please add to wiki ?)
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 email@example.com 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