LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Closed Thread
  Search this Thread
Old 01-08-2010, 08:36 AM   #1
gunturian
LQ Newbie
 
Registered: Jan 2010
Posts: 1

Rep: Reputation: 0
Need assistance on shell script


Hi there,

I'm a newbie to shell scripting. Request your help in writing a shell script for the following requirement:

1) scan each incoming mail with conditions on sender name and subject
2) scan the mail body for set of characters and email them.


general usage is as follows:
I get a mail as follows
from: user@domani.com
subject : Urgent, please reply
body : name : xyz
contact : 12345

the script should mail the following as subject line:

n:xyz c:12345

I know procmail is a good option for this, but I'm compelled to use shell script

Thanks in advance for your help
Maddy
 
Old 01-08-2010, 12:32 PM   #2
irmin
Member
 
Registered: Jan 2010
Location: the universe
Distribution: Slackware (modified), Slackware64 (modified), openSuSE (modified)
Posts: 342

Rep: Reputation: 62
How do you receive your emails (own mailserver, fetch by POP or IMAP)? How should the shell script be started (automatically on delivery, by hand)? How should the script send the response emails (by sendmail, SMTP, ...)?
 
Old 01-08-2010, 12:50 PM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,695

Rep: Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972
Quote:
Originally Posted by gunturian View Post
Hi there,

I'm a newbie to shell scripting. Request your help in writing a shell script for the following requirement:

1) scan each incoming mail with conditions on sender name and subject
2) scan the mail body for set of characters and email them.

general usage is as follows:
I get a mail as follows
from: user@domani.com
subject : Urgent, please reply
body : name : xyz
contact : 12345

the script should mail the following as subject line:

n:xyz c:12345

I know procmail is a good option for this, but I'm compelled to use shell script
First, this sounds very much like homework.

Second, as is the case here normally...post what you've written so far, and where you're having a problem. We are not going to write a script for you, but will be glad to HELP you figure out a problem.

Procmail, fetchmail, and mailx can all be called via shell scripts. Read the man pages.
 
Old 01-08-2010, 01:15 PM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Per the LQ Rules, please do not post homework assignments verbatim. We're happy to assist if you have specific questions or have hit a stumbling point, however. Let us know what you've already tried and what references you have used (including class notes, books, and Google searches) and we'll do our best to help. Also, keep in mind that your instructor might also be an LQ member.

Above is the standard reply for homework.

Please feel free to start a new thread that complies with the guidelines.
 
  


Closed Thread



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need assistance with shell script to pull MP3 file Cpare Linux - Newbie 5 06-28-2008 08:53 PM
Shell script assistance required.. TheEngineer Linux - Newbie 4 10-26-2006 06:42 AM
Assistance with 'find -exec cp' shell script dick.swift Linux - Software 6 01-23-2006 10:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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