Jump to content

Procmail/Perl email integration


Recommended Posts

My objective is to allow a list of people (email addresses) to send email from their usual email client, such that the server sends it on to another list of email addresses automatically. CWH build doesn't support the imap functions, so my first idea of a cron job on the mailbox using PHP's imap_open() etc won't work.

 

The help desk advise that I could, at my own risk, use the Procmail filters to pipe mail to a script on the machine which would handle the email as it enters the system. However I am familiar with neither Perl nor Procmail. I have loaded Dada mail to help with this, but its "send from email" feature does not want to work. I have a call in to them. I have found .procmailrc and persuaded it to run a script that I have found.

 

.procmail looks like this:

INCLUDERC=/etc/ALAquota/overquotarc
VERBOSE=on
RECIP=$1
MAILDIR=$HOME/mydomain-mail
LOGFILE=$HOME/mail.log
INCLUDERC=$HOME/dada.rc
INCLUDERC=.procmailrc

and the file dada.rc looks like this:

:0
* $RECIP ?? ^^[email protected]
{
:0
| /home/mydomain/www/cgi-bin/dada/plugins/dada_bridge.pl
}
## where list1 is the address for the distribution list

The log I get is:

procmail: Assigning "INCLUDERC=/home/myroot/dada.rc"

procmail: Match on "^^[email protected]"

procmail: Assigning "LASTFOLDER=/home/myroot/www/cgi-bin/dada/plugins/dada_bridge.pl"

procmail: Executing "/home/myroot/www/cgi-bin/dada/plugins/dada_bridge.pl"

procmail: Notified comsat: "myroot@:/home/myroot/www/cgi-bin/dada/plugins/dada_bridge.pl"

From [email protected] Thu Feb 22 10:41:05 2007

Subject: test

Folder: /home/myroot/www/cgi-bin/dada/plugins/dada_bridge.pl 1258

I am pretty sure something needs setting in mydomain.com/cgi-bin/dada/plugins/dada_bridge.pl or one of its supporting files, but when I try to load it I get a server (500) error.

 

So my question is one of two. Either has anyone been here and fixed it? If so, how please?. Or has anyone another solution to suggest. As always grateful for any advice.

 

Tim

Link to comment
https://forums.phpfreaks.com/topic/39650-procmailperl-email-integration/
Share on other sites

If I am pulling out the right log, I get

xx.xx.xxx.x - - [28/Feb/2007:01:24:04 -0500] "GET /cgi-bin/dada/plugins/dada_bridge.pl HTTP/1.1" 500 539 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2"

Is that the log you mean?

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.