Some of us like to read and post in the forum using our email clients (iphone, Mail.app, gmail, etc.) just like a mailing list.
Due to the problems in google groups, riq decided to migrate the forum to a more stable solution, but since it does not have a built-in email gateway, I quickly coded a simple solution. It has some problems, but so far it's been working good and satisfies most of my requirements.
Here's a step-by-step guide on how to setup the mailing gateway.
Requirements
- ruby 1.8 (haven't tested ruby 1.9)
- gateway script (download it from here, click on "raw" to get the latest version)
- some gems: sqlite3 sequel tmail tlsmail main. If the script has problems loading any of those gems, it will output the command to install them
- an email account with imap/smtp support (I've been using a google-hosted email, gmail accounts will also work)
- a computer that can run the script (tested on Linux and Mac OS X)
So, you have ruby and the latest version of the script, the first thing you need to do, is get an email address for the script to check, I recommed using gmail for that:
http://mail.google.com/mail/signup
Ok, now that you have an email, create the database and add yourself as a user:
ruby emailgateway.rb --add-user user:pass:myemail@gmail.com --email mygateway@gmail.com
What does this mean? This will create the database, will create a new recipient (myemail@gmail.com) and it will assign the email mygateway@gmail.com to the gateway. You can now send emails to that address and the messages will be posted to the forum. Only recipients can send emails to that account, any other source will be discarded. It's important that you do not use your personal email account, as discarded emails are deleted!! (they're not even stored in the Trash!)
Ok, now you need to configure the smtp/imap settings (again, I'm assuming a gmail-like scenario, where smtp and imap user/passwords are the same):
ruby emailgateway.rb --smtp-server imap.gmail.com --smtp-user mygateway@gmail.com --smtp-password 1234
So, you're now ready to run the script:
ruby emailgateway.rb
If you chmod it with execution permission, you can install it in your crontab:
chmod +x emailgateway.rb
I use this crontab line:
* * * * * /home/rolando/cocos-gateway/emailgateway.rb -d /home/rolando/cocos-gateway/gateway.db
Using the crontab, you *have* to specify the location of the database. By default is in the same directory as the script and it's named gateway.db
About the database
The database is a sqlite3 database, you can view/edit it with the sqlite3 cli:
sqlite3 gateway.db
Is there an easier way?
If you don't mind giving me your forum password, I can add you to my gateway. Or, if you don't plan replying by email, I can add you to the recipients list with no password (that way you only get emails but can't create new topic/posts)
Enjoy!
Rolando./