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 09-29-2007, 10:41 AM   #1
iAlta
Member
 
Registered: Oct 2005
Distribution: Ubuntu 7.10, OpenSUSE 10.3, Linux Mint, Arch
Posts: 92

Rep: Reputation: 15
email-based interface


Here's what I want to do:
I want to send an email to a email-address with some data in the subject line(or maybe the body, doesn't really matter), then take that data, use it as an argument in a script, and then send the result the processed data back to the sending address.
 
Old 09-29-2007, 01:55 PM   #2
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
You're talking about this being an automated process?

If the other end is running Sendmail, then you can do this. It requires a couple of things. First, you need your program or script that processes the email. Then you need to put a symlink to that script in /var/adm/sm.bin. That is essentially the list of programs that are allowed to be called directly from sendmail. Then you need to put an entry in /etc/mail/aliases. This will be the name you send mail to. It will be something like:

namex: realname,"| /var/adm/sm.bin/programname"

So, if you send mail to namex on that machine, it will send a copy of the mail to realname on that machine and another copy will get piped to programname.

If you are using something other than sendmail, then it will be different, but the same idea. It is similar to the way that procmail and hypermail have to be set up. So, if you are on another type of mail server, you can look for instructions for setting up those.
 
Old 09-29-2007, 01:56 PM   #3
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
Oh, and, of course, if you change /etc/mail/aliases, you have to run newaliases.
 
Old 09-30-2007, 04:54 AM   #4
iAlta
Member
 
Registered: Oct 2005
Distribution: Ubuntu 7.10, OpenSUSE 10.3, Linux Mint, Arch
Posts: 92

Original Poster
Rep: Reputation: 15
Automated, yes!

I need to digest that at bit, but do both ends need to use sendmail? I actually don't know what my server uses... How can I check that. But you say that you can do this with other mail servers.
 
Old 09-30-2007, 10:24 AM   #5
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
If you are not the server admin, then you'll have to check with that person. Show them your script or what you want to do, and they would have to set up the mail server to allow it.

You simply send a mail from whatever mail client you use to namex at the server.

I actually have an instance where a data collection computer at a research site sends automated emails to our server. They are processed through a script as described above and the data shows up in graphs on our website.
 
  


Reply



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
Use web-based email as preferred email app? Short.Cipher Linux - Software 3 07-22-2007 03:23 AM
LXer: An LCD Interface for PC-Based Robots LXer Syndicated Linux News 0 01-14-2007 10:54 PM
serial port based midi interface frieza Linux - General 4 04-10-2005 06:54 AM
web based email thesnaggle Linux - Newbie 4 09-26-2003 12:06 PM
Philips 7134 based TV tuner card uses V4L interface? Thymox Linux - Hardware 7 07-16-2003 06:39 PM

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

All times are GMT -5. The time now is 09:08 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