LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-29-2007, 07:09 PM   #1
i.of.the.storm
Member
 
Registered: Aug 2005
Distribution: Ubuntu 14.04
Posts: 72

Rep: Reputation: 15
Can I make a script to post emails to a forum? [nvm]


Hi guys, I've got a question and I figured that the people here are most likely to have an answer to this question.

I'm admin of a website for our high school's robotics club, and we've been trying to redesign our site for next year's competition because the site is part of the ranking. One thing I was working on adding was a properly updated RSS feed, because our president isn't going to update the RSS feed by hand when she posts a new message to the (google groups) mailing list.

Now, using Simple Machines Forum's SSI (server side includes) I made a php script that generates an RSS feed from the topics in a certain board (I think they had a tutorial on how to do it so it wasn't hard). However, the president never posts announcements on the forums in the announcements board that I set up for that purpose. I don't blame her because no one really checks the forum anyway.

I was wondering if it is possible to write a script on the server (perhaps set up to run as a cron job) that checks the email of a certain account which only gets email from the mailing list, and then posts a message to the forum in the appropriate board. I think the main difficulty for me would be checking the email account, as I don't know if you can do this in php. I'm willing to learn perl or whatever it takes if I have to. The site is hosted on bluehost. Thanks for the help!

Edit: A quick google search turns up php IMAP functions as a way to check email through PHP, although I am not certain whether my host has that enabled. In the cpanel there is an option for installing PHP PEAR packages, might this allow me to install IMAP support if it doesn't already exist?

Edit again: I found that there is a package http://pear.php.net/package/Mail_IMAPv2 available for installation on my server. Probably will be able to figure out how to use it to do what I want, but if anyone has any experience with this then feel free to chime in.

Last edited by i.of.the.storm; 12-30-2007 at 12:51 PM. Reason: resolved
 
Old 12-30-2007, 08:55 AM   #2
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
I am not very fond of this complicated constructs in PHP. What I usually do is to write some Bash script which uses simple and proven tools to carry out a task.

You say you are not sure about IMAP. Well, then use a Bash tool to check for mail using the POP protocol (fetchmail, procmail, telnet). Lat Bash do whatever you need to do and test it in Bash. Once everything works, use the exec call from PHP.

Just make sure that everything you write or access can be accessed from PHP which uses most likely the www-data credentials.

jlinkels
 
Old 12-30-2007, 12:49 PM   #3
i.of.the.storm
Member
 
Registered: Aug 2005
Distribution: Ubuntu 14.04
Posts: 72

Original Poster
Rep: Reputation: 15
Hmm, thanks for the ideas. I've decided on a simpler, less automated method because now I'm not sure whether you can post from a script. I'll just add a dummy email account to the mailing list that always auto-replies "Make sure you post the news in the forum as well." Simple, and effective. Thanks for the help anyway.
 
  


Reply

Tags
email, forum, list, machines, mailing, simple



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
VectorLinux user, must make post before I can post url The Headacher LinuxQuestions.org Member Intro 2 07-02-2011 11:55 AM
First post on this forum 300zxkyle LinuxQuestions.org Member Intro 1 06-22-2007 03:51 PM
Post in more than one forum? lefty.crupps LQ Suggestions & Feedback 9 12-14-2006 03:17 AM
A strange forum post The Bad Penny General 8 01-28-2005 10:27 AM
can't post on a forum? pablowablo General 3 08-15-2004 03:29 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration