Many organizations want the benefits of both a web based Forum and a email based Mailing List. It is easy to get this with OpenACS because OpenACS Forums have built in notifications and a "Reply by Email" functionality for instant notifications.
This tutorial guides you in setting up "reply by email" for the forums package. The forums package will email an article to users who are subscribed to notifications. The "reply by email" feature allows recipients of the notification to reply to the forum post by email.
The system is configured to receive the email and post the reply to the appropriate forum article. 1
1. Have the mails delivered in a Maildir formatted directory which the site has read and write access to. Assuming user web is running the server, the email sender prefix is "notification" and the domain is "domain.com", here are a couple of ways to do this:
a. Mail server in the same machine - Install a mail server which supports Maildir (e.g. Postfix) in the server. -
- Add an MX entry for domain.com pointing to the server on your DNS.
- Configure the mail to deliver all notification-*@domain.com to user web.
- Create a .forward file in web's home directory containing the location of the Maildir directory
b. Mail server in a different machine
- Install fetchmail and procmail
- In web's home directory, create a .fetchmailrc file and put:
poll <your.mail.server> protocol pop3 user "<email.account.username>" password "<password>", is web here and wants mda "</location/of/procmail>"
- Then create a .procmailrc file and put:
:0 w * ^subject:.*Out of Office AutoReply /dev/null :0 w </location/of/Maildir/>
The first three lines filter out Outlook auto-replies.
Set fetchmail to run every 5 minutes via cron
crontab -e 0,5,10,15,20,25,30,35,40,45,50,55 * * * * /opt/csw/bin/fetchmail
2. Setup the OpenACS notifications package
EmailDomain: domain.com
EmailQmailQueue: /location/of/Maildir
EmailQmailQueueScanP: 1
EmailReplyAddressPrefix: notification
3. Restart OpenACS
Getting permissions on the Maildir directory is normally quite tricky.<p>
Using the methods in this tut you should avoid those problems because the .forward would be run as the user not as the server (I think).<p>
Likewise, fetchmail can be run as whatever user you want.<p>
Another simple (although a bit yucky) alternative if your mail server uses Maildir natively (like qmail) is to have a cron job that regularly chowns or chmods the new email files to your aolserver process user (or group would be better). Aside from some error messages in your log if ACS tries to access the file out of sync, everything works fine.<p>
Another comment is that out of office filtering is fiendishly difficult. This is especially because every message from oacs forums has a different "email address" - the consequence of this is that out of office algorithms designed to stop loops won't notice that it is looping becuase it thinks they are differnent people.<p>
I am having quite good success with the following regexp on the subject:<p>
<pre>regexp -nocase "(out of.*office|automated response)" $reply(subject)</pre>
and this on the body:<p>
<pre>regexp -nocase "out of (the )?office" $reply(content)</pre>
For no particular reason I do this filtering in the tcl proc <tt>process_reply</tt> (of the forum package). Doing it in the email system is a much better idea (although this way I get information logged in the aolserver log).
by Mark Aufflick on 04/25/06
I am wondering why you make your live harder than it is. Postfix is capable of forwarding every e-mail that goes e.g. to www.solutiongrove.com to the user "solutiongrove", who is the user running your webserver process in a maildir format.
Using the new incoming e-mail handler (http://openacs.org/xowiki/incoming_email) you will then be able to parse the e-mails and be happy.
What I am wondering though is, how can I configure postfix to route through procmail first, meaning e-mail arrives, postfix sends them through procmail and once this is done forward them to the user.
by Malte Sussdorff on 01/31/07
You may request notification for Solution Grove Blog.