10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,I have a stored procedure to verify no of months since current fiscal.I want a shell script to exit with returtn code when the verification fails,I have shell script below but this doesnt work
sqlplus / << EOF
WHENEVER SQLERROR exit 1
WHENEVER OSERROR exit 2
DECLARE
v_time_period... (2 Replies)
Discussion started by: haadiya
2 Replies
2. UNIX for Dummies Questions & Answers
May i please know
1) How to check if FIFO process is down?
2) How to bring FIFO up and running?
we are using redhat Linux OS and bash shell
Thank you. (1 Reply)
Discussion started by: Ariean
1 Replies
3. Shell Programming and Scripting
Greetings...
I have to construct shell script to check the SFTP status,
Define a global variable (say sftpStatus). Set it to default value "success" when you define it first time outside the script.
check the current SFTP status (say currentStatus - local variable within the script)
if... (16 Replies)
Discussion started by: manju98458
16 Replies
4. Shell Programming and Scripting
I am relatively new to scripting. I am trying to develop a script that will
1. Source an executable file as an argument to the script that sets up the environment
2. Run a command "stat" that gives the status of 5 Engines running on the system
3. Check the status of the 5 Engines as either... (0 Replies)
Discussion started by: paslas
0 Replies
5. Shell Programming and Scripting
Can I use -ctime/-mtime to verify if a particular directory has been updated or not?
I don't care about number of days. I just want to perform some operations only if the folder is modified (or it's metadata is modified), i.e. some files are added to the directory.
This thread has a more... (1 Reply)
Discussion started by: Pramit
1 Replies
6. Shell Programming and Scripting
Hi All,
I like to check the status of sendmail and take the appropriate action based on success / failure etc.
I have gone through one of the thread where a suggestion is made to use RC for return code
Following is the code:
==================================
#!/usr/bin/bash
export... (0 Replies)
Discussion started by: tmanda
0 Replies
7. Shell Programming and Scripting
I'm developing a script that spawns many background processes that will be executing concurrently and need to check the exit status of each spawned process after it terminates. After starting the background process I can get the pid from $! which I can store in an associative array but how do I... (2 Replies)
Discussion started by: twk
2 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I m new to unix and I need a help in FTp-ing a file.
My script is given below
ftp -n <<END_SCRIPT
open $FTP_HOST
user $FTP_USER $FTP_PASSWD
lcd $TEMPFOLDER
cd $FTP_LOCATION
put $1
bye
END_SCRIPT
exit_status=$?
if ; then
log "successfully FTPed the file"
else... (5 Replies)
Discussion started by: MeeraNair
5 Replies
9. Shell Programming and Scripting
I hope one of you smart people out there can help me with what seems like a real simple questing but I can't quite figure out.
In a script I am doing a cmp on two files. I am trying to check the exit status with an if statement but can't seem to figure out the syntax. If the exit status is 1 I... (4 Replies)
Discussion started by: PrimeRibAndADew
4 Replies
10. UNIX for Dummies Questions & Answers
After I send a mail thr unix with following command
uuencode tmpFile | mailx -s "sub1" emailid
Yet, I havent received this mail at intended mail client.
In order to find out if the sent mail action resulted in failure,
I checked at
/usr/spool/mail/userid
But there also I couldnt find... (1 Reply)
Discussion started by: videsh77
1 Replies
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)