FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » Integrate With A Mailing List
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Integrate With A Mailing List [message #31780] Wed, 17 May 2006 22:34 Go to next message
aleman   United Kingdom
Messages: 40
Registered: May 2006
Location: Blackpool UK
Karma: 0
Member
OK Latest in the continuing saga that is my struggle with everything UNIX based Smile

I have successfullt set up FUDForum, Modified the template, and set up mailing from the forum to a Subscription List (Handled by Mailman)! Yay! Smile

Ok now the bit that I thought would be tricky, going from the mailing list to FUDForum . . . . procmail . . . oh . . . . Yeuch! Confused

Off to google, and come up with a basic introduction to mail forwarding using procmail. Right, now according to the instructions on the mailing list page of FUDForum I need to add something along the lines of

:0:
* ^TO_ .*ukhbtest(at)lists(dot)uk-homebrew(dot)info
| /home//ukhomebrew/uk-homebrew.info/.forum/scripts/maillist.php 2

into my .procmailrc file (or better still a rc.subscription file that I have included in the .procmailrc file)

OK done that with pico

Still didn't work mail went to and back from the mailing list but didn't appear in the forum, and nothing in the pm log either. Checked hosts wiki and found some more instructions. I have to set mail up to pipe through procumail using a .forward.something file. . . . Ok Done that . . . Oh Now mail doesn't get to the mailing list it gets returned to sender . . . AH BUT THERE IS A PM LOG! procmail is working!! Oh . . . Contents of log are

procmail: [20191] Wed May 17 15:16:56 2006
procmail: No match on "(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To)Sad.*[^-a-zA-Z0-9_.])?) .*ukhbtest(at)lists(dot)uk-homebrew(dot)info"
procmail: Assigning " LASTFOLDER=/mnt/thresher/vol/boot/spunky/doodles/ukhomebrew/Maildir/new/114 7904216.20191_1.chopstick "
procmail: Notified comsat: "ukhomebrew@0 :/mnt/thresher/vol/boot/spunky/doodles/ukhomebrew/Maildir/new/1147904216.20 191_1.chopstick "
From MAILER-DAEMON Wed May 17 15:16:56 2006
Subject: Mail delivery failed: returning message to sender
Folder: /mnt/thresher/vol/boot/spunky/doodles/ukhomebrew/Maildir/new 2494

OK anyone got any ideas. To me it seems that the ^TO_ isn't matching the list address, which is definately correct, could the regex be confusing matters?

Regards

Aleman


--
Aleman
Re: Integrate With A Mailing List [message #31782 is a reply to message #31780] Wed, 17 May 2006 22:59 Go to previous messageGo to next message
darren is currently offline  darren   United Kingdom
Messages: 16
Registered: January 2006
Karma: 0
Junior Member
aleman wrote on Wed, 17 May 2006 18:34

OK Latest in the continuing saga that is my struggle with everything UNIX based Smile

I have successfullt set up FUDForum, Modified the template, and set up mailing from the forum to a Subscription List (Handled by Mailman)! Yay! Smile

Ok now the bit that I thought would be tricky, going from the mailing list to FUDForum . . . . procmail . . . oh . . . . Yeuch! Confused

Off to google, and come up with a basic introduction to mail forwarding using procmail. Right, now according to the instructions on the mailing list page of FUDForum I need to add something along the lines of

:0:
* ^TO_ .*ukhbtest(at)lists(dot)uk-homebrew(dot)info
| /home//ukhomebrew/uk-homebrew.info/.forum/scripts/maillist.php 2

into my .procmailrc file (or better still a rc.subscription file that I have included in the .procmailrc file)

OK done that with pico

Still didn't work mail went to and back from the mailing list but didn't appear in the forum, and nothing in the pm log either. Checked hosts wiki and found some more instructions. I have to set mail up to pipe through procumail using a .forward.something file. . . . Ok Done that . . . Oh Now mail doesn't get to the mailing list it gets returned to sender . . . AH BUT THERE IS A PM LOG! procmail is working!! Oh . . . Contents of log are

procmail: [20191] Wed May 17 15:16:56 2006
procmail: No match on "(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To)Sad.*[^-a-zA-Z0-9_.])?) .*ukhbtest(at)lists(dot)uk-homebrew(dot)info"
procmail: Assigning " LASTFOLDER=/mnt/thresher/vol/boot/spunky/doodles/ukhomebrew/Maildir/new/114 7904216.20191_1.chopstick "
procmail: Notified comsat: "ukhomebrew@0 :/mnt/thresher/vol/boot/spunky/doodles/ukhomebrew/Maildir/new/1147904216.20 191_1.chopstick "
From MAILER-DAEMON Wed May 17 15:16:56 2006
Subject: Mail delivery failed: returning message to sender
Folder: /mnt/thresher/vol/boot/spunky/doodles/ukhomebrew/Maildir/new 2494

OK anyone got any ideas. To me it seems that the ^TO_ isn't matching the list address, which is definately correct, could the regex be confusing matters?

Regards

Aleman



The procmail FAQ says that "a .* just after ^TO or ^TO_ is also superfluous" - http://laku19.adsl.netsonic.fi/%7Eera/procmail/mini-faq.html#syntax

In other words, try something like

:0:
* ^TO_ukhbtest(at)lists(dot)uk-homebrew(dot)info


... without the .*

[Updated on: Wed, 17 May 2006 23:05]

Report message to a moderator

Re: Integrate With A Mailing List [message #31790 is a reply to message #31782] Thu, 18 May 2006 09:40 Go to previous messageGo to next message
aleman   United Kingdom
Messages: 40
Registered: May 2006
Location: Blackpool UK
Karma: 0
Member
Quote:


The procmail FAQ says that "a .* just after ^TO or ^TO_ is also superfluous" - http://laku19.adsl.netsonic.fi/%7Eera/procmail/mini-faq.html#syntax

In other words, try something like

:0:
* ^TO_ukhbtest(at)lists(dot)uk-homebrew(dot)info


... without the .*


Thanks Darren, Ok Got that bit working, Email sent to the list returns to the users in the list, But doesn't appear in the Forum Sad. The pmlog file contains

procmail: [29131] Thu May 18 02:34:37 2006
procmail: Match on "(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):(.*[^-a-zA-Z0-9_.])?)ukhbtest(at)lists(dot)uk-homebrew(dot)info"
procmail: Assigning "LASTFOLDER=/home//ukhomebrew/uk-homebrew.info/.forum/scripts/maillist.php 2"
procmail: Executing "/home//ukhomebrew/uk-homebrew.info/.forum/scripts/maillist.php,2"
procmail: Notified comsat: "ukhomebrew@:/home//ukhomebrew/uk-homebrew.info/.forum/scripts/maillist.php 2"
From ukhbtest-bounces(at)lists(dot)uk-homebrew(dot)info  Thu May 18 02:34:36 2006
 Subject: [Ukhbtest] Working List to Web Interface
  Folder: /home//ukhomebrew/uk-homebrew.info/.forum/scripts/maillist.p	   3103
/usr/local/bin/php: error while loading shared libraries: libmysqlclient.so.15: cannot open shared object file: No such file or directory


So almost completely there, Just going to do a search to see if the error has been found before

Cheers

Aleman


--
Aleman
Re: Integrate With A Mailing List [message #31805 is a reply to message #31790] Fri, 19 May 2006 02:59 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The last error tells you what is the problem your PHP install at:
/usr/local/bin/php appears to be broken, you either need to use PHP from another location or make sure that the linker can find the libmysqlclient.so.15 library.



FUDforum Core Developer
Re: Integrate With A Mailing List [message #32595 is a reply to message #31805] Mon, 10 July 2006 21:44 Go to previous messageGo to next message
aleman   United Kingdom
Messages: 40
Registered: May 2006
Location: Blackpool UK
Karma: 0
Member
Having Reconfigured my domain on my host can anyone explain why I now get

procmail: [27191] Mon Jul 10 14:00:23 2006
procmail: Assigning "MAILDIR=/mnt/thresher/vol/boot/spunky/doodles/ukhomebrew/Maildir"
procmail: Match on "(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):(.*[^-a-zA-Z0-9_.])?)list(at)ukhomebrew(dot)info"
procmail: Assigning "LASTFOLDER=/home//ukhomebrew/.forumdata/scripts/maillist.php 1"
procmail: Executing "/home//ukhomebrew/.forumdata/scripts/maillist.php,1"
/home//ukhomebrew/.forumdata/scripts/maillist.php: line 2: ?php: No such file or directory
/home//ukhomebrew/.forumdata/scripts/maillist.php: line 3: /bin: is a directory
/home//ukhomebrew/.forumdata/scripts/maillist.php: line 4: syntax error near unexpected token `('
/home//ukhomebrew/.forumdata/scripts/maillist.php: line 4: `* copyright            : (C) 2001-2006 Advanced Internet Designs Inc.'
procmail: [27191] Mon Jul 10 14:00:25 2006
procmail: Assigning "LASTFOLDER=/mnt/thresher/vol/boot/spunky/doodles/ukhomebrew/Maildir/new/1152565223.27191_0.spunkymail-mx3"
procmail: Notified comsat: "ukhomebrew@0:/mnt/thresher/vol/boot/spunky/doodles/ukhomebrew/Maildir/new/1152565223.27191_0.spunkymail-mx3"
From ukhomebrew-bounces(at)lists(dot)ukhomebrew(dot)info  Mon Jul 10 14:00:23 2006
 Subject: Re: Test Post to Mailing List
  Folder: /mnt/thresher/vol/boot/spunky/doodles/ukhomebrew/Maildir/new	   3395


in my pmlog file, and no post to the list. I did think that it could be the path to php but that is in /usr/local/bin as in the first line of the maillist.php script.

My Procmail recipe is

:0:
* ^TO_list(at)ukhomebrew(dot)info
| /home//ukhomebrew/.forumdata/scripts/maillist.php 1

and that part appears to be working. The only thing I can think is that htere is a mis configuration to php . . . but this was working until I deleted everything off the site and started again, the position of php can't have changed.


--
Aleman
Re: Integrate With A Mailing List [message #32596 is a reply to message #32595] Mon, 10 July 2006 22:22 Go to previous messageGo to next message
aleman   United Kingdom
Messages: 40
Registered: May 2006
Location: Blackpool UK
Karma: 0
Member
Just to add that if I execute file /usr/local/bin/php I get
$ file /usr/local/bin/php
/usr/local/bin/php: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.0, dynamically linked (uses shared libs), stripped
Back.

Seems to me my php binary is in the right place according to
Quote:

In order to use the maillist and/or nntp utility you need to make sure the 1st line in the file points to the path of the PHP executable on your system. By default this line is set to /usr/local/bin/php, if you php binary is else where modify the #!/usr/local/bin/php with the full path of your php binary.


--
Aleman
Re: Integrate With A Mailing List [message #32598 is a reply to message #32596] Tue, 11 July 2006 00:01 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Try changing your procmail execution line to:

/usr/local/bin/php /path/to/maillist.php


FUDforum Core Developer
Re: Integrate With A Mailing List [message #32608 is a reply to message #32598] Tue, 11 July 2006 07:36 Go to previous messageGo to next message
aleman   United Kingdom
Messages: 40
Registered: May 2006
Location: Blackpool UK
Karma: 0
Member
Iila,

Thank you that appears to work (once I remove the implicit lock), what I now get is
procmail: Assigning "LASTFOLDER=/usr/local/bin/php /home//ukhomebrew/.forumdata/scripts/maillist.php 1"
procmail: Executing "/usr/local/bin/php,/home//ukhomebrew/.forumdata/scripts/maillist.php,1"
procmail: Assigning "LASTFOLDER=/mnt/thresher/vol/boot/spunky/doodles/ukhomebrew/Maildir/new/1152602842.11642_0.spunkymail-mx4"
procmail: Notified comsat: "ukhomebrew@0:/mnt/thresher/vol/boot/spunky/doodles/ukhomebrew/Maildir/new/1152602842.11642_0.spunkymail-mx4"
From ukhomebrew-bounces(at)lists(dot)ukhomebrew(dot)info  Tue Jul 11 00:27:21 2006
 Subject: Re: Test Post to Mailing List
  Folder: /mnt/thresher/vol/boot/spunky/doodles/ukhomebrew/Maildir/new	   3707
but the mail doesn't appear in the forum I guess I have some digging to do. I am having some funnies when I post to the forum in that I keep getting the test environment forum appearing after I post . . Stupid me I guess I should have used different user names for the test and live databases

thanks again

Tony


--
Aleman
Re: Integrate With A Mailing List [message #32625 is a reply to message #32608] Tue, 11 July 2006 21:56 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Check your mailing list import rule settings, perhaps you're settings indicate that messages need to be manually approved before appearing on the forum?

FUDforum Core Developer
Re: Integrate With A Mailing List [message #32638 is a reply to message #32625] Wed, 12 July 2006 16:07 Go to previous messageGo to next message
aleman   United Kingdom
Messages: 40
Registered: May 2006
Location: Blackpool UK
Karma: 0
Member
No I've checked that, I've also Uninstalled the forum and reinstalled it, and its still not working. I've chmodded the forum data root and subdirectories to 777 as well and they still don't appear. . . . I may be going back to 2.7.4 at this rate.

I have the forum data root in my home directory outside the web directory, I could move it Back if you think that would help

Clutching at straws now


--
Aleman

[Updated on: Wed, 12 July 2006 17:21]

Report message to a moderator

Re: Integrate With A Mailing List [message #32653 is a reply to message #32638] Wed, 12 July 2006 23:48 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Have you checked the database itself for the messages?
Also when you are calling maillist.php are you passing the import rule id as a parameter?


FUDforum Core Developer
Re: Integrate With A Mailing List [message #32660 is a reply to message #32653] Thu, 13 July 2006 07:34 Go to previous messageGo to next message
aleman   United Kingdom
Messages: 40
Registered: May 2006
Location: Blackpool UK
Karma: 0
Member
I'm really appreciating the help here, I am also fairly sure that it is smething I am doing. What I'm finding it difficult to understand is why it was so easy to get it all working in 2.7.4 and now it just doesn't want to know.

There is no message in the DB

Here is the line from my .procmailrc
:0c
* ^TO_list(at)ukhomebrew(dot)info
| /usr/local/bin/php /home//ukhomebrew/.forumdata/scripts/maillist.php 1


--
Aleman
Re: Integrate With A Mailing List [message #32663 is a reply to message #32660] Thu, 13 July 2006 13:36 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
One simple test you can do is to take 1 message and save it to a file then run

cat message_file | /usr/local/bin/php /home//ukhomebrew/.forumdata/scripts/maillist.php 1

and see the result, watch for any error messages. If no errors occur then the next step would be to check the forum's msg table for the presence of the message.


FUDforum Core Developer
Re: Integrate With A Mailing List [message #32688 is a reply to message #32663] Fri, 14 July 2006 19:52 Go to previous messageGo to next message
aleman   United Kingdom
Messages: 40
Registered: May 2006
Location: Blackpool UK
Karma: 0
Member
Quote:

cat message_file | /usr/local/bin/php /home//ukhomebrew/.forumdata/scripts/maillist.php 1

and see the result, watch for any error messages


We Have a result!! one test message inserted into the forum Message from CAT as foloows

[twizzler]$ cat testmsg/msg.NTsL |/usr/local/bin/php /home//ukhomebrew/.forumdata/scripts/maillist.php 1
X-Powered-By: PHP/4.4.2
Content-type: text/html

Now I'm not that sure what it means? I guess that it proves that a message can be inserted into the forum and therefore maillist.php is working. My procmail recipe is working as I used that to catch the message.

I'm really sorry to ask this but what next . . . I can't believe I was looking a phpBB this lunchtime Sad


--
Aleman
Re: Integrate With A Mailing List [message #32727 is a reply to message #32688] Mon, 17 July 2006 19:24 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
I presume the imported messages shows up on the forum?

What this means is that there is no problem with the script, you may need to change your execution line to:

usr/local/bin/php -q /home/ukhomebrew/.forumdata/scripts/maillist.php 1

so it php-cgi does not print headers. Also make sure your procmail recipe is passing the import rule id (1)


FUDforum Core Developer
Re: Integrate With A Mailing List [message #32730 is a reply to message #32727] Mon, 17 July 2006 21:05 Go to previous messageGo to next message
aleman   United Kingdom
Messages: 40
Registered: May 2006
Location: Blackpool UK
Karma: 0
Member
Thanks again Ilia

Yes the message does appear in the forum.

WHile I was thinking over the weekend, I used the FUDBox.php script to load an MBOX formatted archive into our test environment (which also uses the php -q switch). Initially it was failing with an access is denied error, so I chmodded the directories and files to 777 and tried again. Archive was loaded with no problem.

I want to try the -q switch with Procmail but our server is on a serious go slow, so I'll let you know how I get on.

I'm really hoping that I don't have to chmod the forum directories to 777 Sad


--
Aleman
Re: Integrate With A Mailing List [message #32737 is a reply to message #32730] Mon, 17 July 2006 23:48 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Chmoding them 755 will do just fine, but you need to make sure that all files are chmoded 644 or greater and the msg_* files inside the messages/ directory are chmoded 666

FUDforum Core Developer
Re: Integrate With A Mailing List [message #32760 is a reply to message #32737] Wed, 19 July 2006 07:21 Go to previous message
aleman   United Kingdom
Messages: 40
Registered: May 2006
Location: Blackpool UK
Karma: 0
Member
I've Chmodded the directories and added the -q switch, but still nothing.

You asked if the import rule id is being passed. Well procmail reports this in the verbose log
procmail: Executing "/usr/local/bin/php,-q,/home/.doodles/ukhomebrew/.forumdata/scripts/maillist.php,1"

So I can only assume that it is indeed doing so.

Once my Host has recovered from the major downtime they have had over the weekend. I am going to ask them to completely wipe our area and I will restart building all this from scratch (Useful stuff really)

AS I said earlier, I had all this working with 2.7.4, and I know that I can load MBOX archives, so I know it does work, There has to be something (probably unrelated to FUD forum) that has changed either just before, just after, or during the upgrade to 2.7.5, that is causing all this.

I'm going on leave this weekend, so I'm not going to be able to work on this for a couple of weeks. When I get back I'll start again, with hopefully a virgin setup


--
Aleman
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Regex to URL rewrite.
Next Topic: how to execute php code into fud templates?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 12:47:30 GMT 2024

Total time taken to generate the page: 0.05935 seconds