04-16-2009
Quote:
Originally Posted by
zedex
in perl you have to use mail parser for this which will give you exact subject
i have worked on such kind of application which used to read mails then depending upon the mail contents it used to do the job. but for that there were some standards used you have to do the same.
i am a complete idiot when it comes to these standards or unix, but i can learn real quick as long it is a Programming language. So can you please make available your above mentioned stuff. it will be very useful.
Thanks,
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
If anyone can give me some ideas on this it would be great. What I'm trying to do is to have emails be sent to my unix account. Once they are emailed to the unix account, I want to use the text in the subject field to invoke a shell script, so basically I need to find a way that I can... (4 Replies)
Discussion started by: mskarica
4 Replies
2. UNIX for Dummies Questions & Answers
hi
I have a bit of a problem i need help with.
I have a script that runs no problems when i run it manually. as soon as i stick in
tester: /app/scripts/run.pl
into /etc/aliases & try to run it by sending a mail it doesnt work.
the output files are owned by daemon, which i dont like & think... (7 Replies)
Discussion started by: jojo77
7 Replies
3. Shell Programming and Scripting
Help with script that will check log, then find a match is found, add that as the subject line.
1. The script will always run as a deamon.. and scan the event.log file
2. when a new 101 line is added to the event.log file, have the script check position 5,6 and 7 which is the job name, which... (2 Replies)
Discussion started by: axdelg
2 Replies
4. Linux
I have been looking around for a solution to this, i have been developing for a wile though am very new to CGI, PHP and a lot of the web based tech.
I have a web site hosted with a cPanel web host.
I am looking to have a script(prefer PHP) to run everytime i get a new email to help@xxx.com.... (16 Replies)
Discussion started by: iKris
16 Replies
5. Shell Programming and Scripting
Hi all,
I am trying to automate a process in which at the end of the process the script should send an email to the user saying this process is completed.
I have done everything but the problem now is the subject line of the email...
the subject line looks like this..
where abc xyz is a... (4 Replies)
Discussion started by: smarty86
4 Replies
6. Shell Programming and Scripting
Hi,
I require need help in two aspects actually:
1) Fatal error that gets generated as %F% from a log file say ABClog.dat to trigger a mail. At present I manually grep the log file as <grep %F% ABClog.dat| cut-d "%" -f1>. The idea is to use this same logic to grep the log file which is... (1 Reply)
Discussion started by: zico1986
1 Replies
7. Shell Programming and Scripting
Hi expert
I wish to start a shell script when I receive an email.
I modified the aliases file and I add this string
as400nag: "|/home/nag-script/startstop/AS400-Boot.sh
The solution works .
When the as400nag user receive an email the
/home/nag-script/startstop/AS400-Boot.sh starts .but... (3 Replies)
Discussion started by: emi65
3 Replies
8. Shell Programming and Scripting
hi ,
i have written below piece of code to meet the requirement but i am stuck in the logic here.
the requirement are:
1) to send the sql out put to email body with proper formatting.
2) if count_matching = Yes then mail should triggered with the subject line ... (10 Replies)
Discussion started by: itzkashi
10 Replies
9. Shell Programming and Scripting
Team,
Would like to know what is the best script that will send you an email if cronjob did not run.
Thanks (4 Replies)
Discussion started by: kenshinhimura
4 Replies
10. UNIX for Beginners Questions & Answers
Hi
Newbie here with first post. I've got a shell script (ksh) whereby I run a SQL*Plus script and output the results to a file. I then check the output file in an if statement that looks like this:
if ]; then
export GAPNUM=`awk '{print $4}' $OUTFILE`
if ] then
mailx -s... (10 Replies)
Discussion started by: ltzwoman
10 Replies
LEARN ABOUT REDHAT
mail::spamassassin::permsgstatus
Mail::SpamAssassin::PerMsgStatus(3) User Contributed Perl Documentation Mail::SpamAssassin::PerMsgStatus(3)
NAME
Mail::SpamAssassin::PerMsgStatus - per-message status (spam or not-spam)
SYNOPSIS
my $spamtest = new Mail::SpamAssassin ({
'rules_filename' => '/etc/spamassassin.rules',
'userprefs_filename' => $ENV{HOME}.'/.spamassassin.cf'
});
my $mail = Mail::SpamAssassin::NoMailAudit->new();
my $status = $spamtest->check ($mail);
if ($status->is_spam()) {
$status->rewrite_mail ();
$mail->accept("caught_spam");
}
...
DESCRIPTION
The Mail::SpamAssassin "check()" method returns an object of this class. This object encapsulates all the per-message state.
METHODS
$isspam = $status->is_spam ()
After a mail message has been checked, this method can be called. It will return 1 for mail determined likely to be spam, 0 if it does
not seem spam-like.
$list = $status->get_names_of_tests_hit ()
After a mail message has been checked, this method can be called. It will return a comma-separated string, listing all the symbolic
test names of the tests which were trigged by the mail.
$num = $status->get_hits ()
After a mail message has been checked, this method can be called. It will return the number of hits this message incurred.
$num = $status->get_required_hits ()
After a mail message has been checked, this method can be called. It will return the number of hits required for a mail to be consid-
ered spam.
$report = $status->get_report ()
Deliver a "spam report" on the checked mail message. This contains details of how many spam detection rules it triggered.
The report is returned as a multi-line string, with the lines separated by "
" characters.
$status->rewrite_mail ()
Rewrite the mail message. This will add headers, and possibly body text, to reflect its spam or not-spam status.
The modifications made are as follows:
Subject: header for spam mails
The string "*****SPAM*****" (changeable with "subject_tag" config option) is prepended to the subject, unless the "rewrite_subject
0" configuration option is given.
X-Spam-Status: header for spam mails
A string, "Yes, hits=nn required=nn tests=..." is set in this header to reflect the filter status. The keys in this string are as
follows:
X-Spam-Report: header for spam mails
The SpamAssassin report is added to the mail header if the "report_header 1" configuration option is given.
hits=nn The number of hits the message triggered.
required=nn The threshold at which a mail is marked as spam.
tests=... The symbolic names of tests which were triggered.
X-Spam-Flag: header for spam mails
Set to "YES".
Content-Type: header for spam mails
Set to "text/plain", in order to defang HTML mail or other active content that could "call back" to the spammer.
X-Spam-Checker-Version: header for spam mails
Set to the version number of the SpamAssassin checker which tested the mail.
spam mail body text
The SpamAssassin report is added to top of the mail message body, unless the "report_header 1" configuration option is given.
X-Spam-Status: header for non-spam mails
A string, "No, hits=nn required=nn tests=..." is set in this header to reflect the filter status. The keys in this string are the
same as for spam mails (see above).
$messagestring = $status->get_full_message_as_text ()
Returns the mail message as a string, including headers and raw body text.
If the message has been rewritten using "rewrite_mail()", these changes will be reflected in the string.
Note: this is simply a helper method which calls methods on the mail message object. It is provided because Mail::Audit uses an
unusual (ie. not quite intuitive) interface to do this, and it has been a common stumbling block for authors of scripts which use Spa-
mAssassin.
$status->finish ()
Indicate that this $status object is finished with, and can be destroyed.
If you are using SpamAssassin in a persistent environment, or checking many mail messages from one Mail::SpamAssassin factory, this
method should be called to ensure Perl's garbage collection will clean up old status objects.
SEE ALSO
"Mail::SpamAssassin" "spamassassin"
perl v5.8.0 2002-09-26 Mail::SpamAssassin::PerMsgStatus(3)