Sponsored Content
Top Forums Shell Programming and Scripting Stop sending mail after certain number of mail Post 302466337 by rbatte1 on Tuesday 26th of October 2010 07:32:16 AM
Old 10-26-2010
Assuming ksh, but probably very similar in other shells:-

Code:
if <whatever your condition is>
then
   ((i=`cat statusfile`+1))
   echo $i > statusfile
   if [ $i -le 5 ]
   then
       sendmail commands here
   fi
else
   echo 0 > statusfile     # Make sure there is a space after the zero
fi


Does that help?



Robin

Last edited by Scott; 10-26-2010 at 08:47 AM.. Reason: Code tags, please...
This User Gave Thanks to rbatte1 For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sending a mail to a mail client

Hi everyone! I'm trying to create a database monitoring script that reads an alert file and sends an error message if it can 'grep' a particular string. Is there a way to send this message to a mail client using SMTP? Even better, is there any place on this site that has these kinds of... (5 Replies)
Discussion started by: solaris73
5 Replies

2. UNIX for Dummies Questions & Answers

Sending Mail

Please help me out i want to know how to send email from unix machine to any email-id. mail to be sent is web based mail. (1 Reply)
Discussion started by: parmeet
1 Replies

3. Shell Programming and Scripting

Mail sending

Dear all, how can i send mail using mailx or mail command?do i need to configure anything for sending mail?please help me.Its urgent. the version i use is Linux TDM 2.4.21-4.EL #1 Fri Oct 3 18:13:58 EDT 2003 i686 i686 i386 GNU/Linux Thanks Regards, Pankaj (15 Replies)
Discussion started by: panknil
15 Replies

4. Solaris

how to forward mail in /var/mail/username to external mail

Dear All, Now I use solaris 10 and I try to forward mail from /var/mail/username to their external mail so what should I do? thank u in advance (2 Replies)
Discussion started by: unitipon
2 Replies

5. UNIX for Dummies Questions & Answers

sending mail

i want to send an email from the unix machine to the windows machine. now windows dont have any specified folder for the mail. mail has to be sent to the email-id like abc@xyz.com unix machine itself can not directly send mail. it has to be transferred via mail server. (11 Replies)
Discussion started by: parmeet
11 Replies

6. Shell Programming and Scripting

Sending mail

Hi there, How can I send the automated log file, daily at 7 am to the respective mail . Thanks in Advance, Neha (2 Replies)
Discussion started by: NehaKrish
2 Replies

7. UNIX for Advanced & Expert Users

need to configure mail setting to send mail to outlook mail server

i have sun machines having solaris 9 & 10 OS . Now i need to send mail from the machines to my outlook account . I have the ip adress of OUTLOOK mail server. Now what are the setting i need to do in solaris machines so that i can use mailx or sendmail. actually i am trying to automate the high... (2 Replies)
Discussion started by: amitranjansahu
2 Replies

8. Shell Programming and Scripting

Sending Mail

Hi All, I have a script that looks like this: *********** #!/bin/sh -x cd /u01/app/oracle/diag/rdbms/spdb/spdb/trace cat alert_spdb.log|grep Archiver >/dev/null if ; then mailx -s "Archiver message in Alert log" user@email.com fi ************ Im using the -x option to see any... (1 Reply)
Discussion started by: oradba888
1 Replies

9. Red Hat

Problems sending mail: Difference between Mail and Mailx?

Whats the difference between mail and mailx? I'm trying to troubleshoot a problem where I can send mail from server A with this `echo $MESSAGE | mail -s "$SUBJECT" -r $FROM $RECIPIENTS` command but executing the same command from server B throws me this error (Both servers are RHEL) ... (1 Reply)
Discussion started by: RedSpyder
1 Replies

10. UNIX for Advanced & Expert Users

Client was not authenticated to send anonymous mail during MAIL FROM (in reply to MAIL FROM comm

I am having trouble getting mail to work on a red hat server. At first I was getting this message. Diagnostic-Code: X-Postfix; delivery temporarily suspended: connect to :25: Connection refused Then added the port to my firewall. Then I temporarily turned off selinux. I then copied this file... (1 Reply)
Discussion started by: cokedude
1 Replies
pop3browser(1)															    pop3browser(1)

NAME
pop3browser -- small perl script to access POP3 mail accounts DESCRIPTION
pop3browser is a perl script that uses libnet-perl to give access to POP3 mail accounts without fetching the messages. pop3browser can be used to delete unwanted mails (SPAM), especially when they come with large attachments, before downloading them over low-bandwidth connections. The --limit option of fetchmail is very useful to filter such large mails which can then be inspected with pop3browser. The program supports normal POP3 authentication and APOP. USAGE
pop3browser welcomes you with a short copyright note and a command line prompt. The settings for a mailbox (host, password etc.) have to be specified in a configuration file (similar to fetchmail). pop3browser understands the following commands: hosts list available hosts specified in .pop3browserrc login n log into host no. n, use 'hosts' to get a list of available hosts o(pen) n same as login apop n same as login but uses APOP c(lose) delete messages marked for deletion and close current connection list list sizes and message numbers of the mails on the account s(how) n show header and some body lines of mail number n m(ailbox) list message number, size, sender and subject for each mail d(elete) n delete mail number n undel(ete) n undelete mail number n k(ill) expr delete mails matching expr in header u(nkill) expr undelete mails matching expr in header q(uit) delete messages marked for deletion and quit program exit same as quit help print a command summary CONFIG FILE
The definitions for a mailbox are specified in ~/.pop3browserrc. One line per mailbox. Lines starting with # are ignored. Each definition must be in the following form:.br hostname <tab or space> userid <tab or space> password <tab or space> protocol (optional) For example: #definition for bar@pop.foo.com #pop-server UID passwd protocol pop.foo.com bar s3cr3t apop #end of definition Recognised options for the protocol are pop3 and apop. If no protocol is specified the command login/open assumes pop3. The command apop ignores the protocol option. To override the default header-filter of the show command you can specify a custom set of keywords in ~/.pop3browserrc. Lines starting with "@headpattern" or "@bodylines" are parsed by pop3browser. Settings for the header-filter must be in the following form: @headpattern <tab or space> = <tab or space> "<keyword1>","<keyword2>",.... The filter keywords are matched against the start of a header line. Settings for the number of body lines to show, have to be in the following form: @bodylines <tab or space> = <tab or space> <Number> Example: @headpatterns = "From:","To:","Subject:","Date:","CC" @bodylines = 10 The file ~/.pop3browserrc must only be readable for the owning user. pop3browser corrects other file modes automatically. SEE ALSO
fetchmail(1) AUTHOR
Christoph Baumann <cgb@debian.org> THANKS
Jorrit 'J"o' Fahlke, for his overhaul of the config file parser Takeshi Hamasaki, for the headpattern patch Debian/GNU Linux Nov. 2003 pop3browser(1)
All times are GMT -4. The time now is 03:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy