Sponsored Content
Top Forums Shell Programming and Scripting Reading a mailbox and sending new messages to a text file Post 302186507 by rsw626 on Thursday 17th of April 2008 11:40:40 AM
Old 04-17-2008
Reading a mailbox and sending new messages to a text file

I'm new to scripting and have been tasked with creating a script that will read a mailbox, such as /var/mail/user1, scan it for new messages, then send those new messages to another file.

It also has to be looped to run almost continuously.

Any help would be greatly appreciated
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Reading text from a file

Guys, I am trying to read text from a file, into arrays. The format of the file is: @DATABASE femotest @PACKAGE_SPECS /usr/home/oracle92/sosa/scripts/test.pks /usr/home/oracle92/sosa/scripts/rep.pks @PACKAGE_BODIES ... (12 Replies)
Discussion started by: LiquidChild
12 Replies

2. Shell Programming and Scripting

Attaching file and sending text in body using sendmail command!!

Hello, I need to send with text in the body and 2 files as attachments using sendmail command. i can send only one at a time either attachment or text in body of email. Can any one please help me how to get that? I will be great for any help. Thanks, Sparan (1 Reply)
Discussion started by: sparan_peddu
1 Replies

3. UNIX for Dummies Questions & Answers

sorting files with find command before sending to text file

i need help with my script.... i am suppose to grab files within a certain date range now i have done that already using the touch and find command (found them in other threads) touch -d "$date_start" ./tmp1 touch -d "$date_end" ./tmp2 find "$data_location" -maxdepth 1 -newer ./tmp1 !... (6 Replies)
Discussion started by: deking
6 Replies

4. UNIX for Advanced & Expert Users

Reading a file and sending mail based on content of the file

Hi Gurus, I am having an requirement. i have to read a list file which contains file names and send mail to different users based on the files in the list file. eg. if file a.txt exists then send a mail to a@a.com simillary for b.txt,c.txt etc. Thanks for your help, Nimu (6 Replies)
Discussion started by: nimu1979
6 Replies

5. Programming

reading a text file in c++

hello all , im trying to read a text file and display its contents. While i got the code running and the output was displayed perfectly for sometime , i started getting Abort(core dump) error . Am i missing something here ? im using HP-UX. #include <iostream.h> #include <fstream.h> #include... (1 Reply)
Discussion started by: vishy_85
1 Replies

6. Shell Programming and Scripting

Problem with sending email(to include contents of text file)

Hello, I was using a shell script for sending contents of a text file(email.report) to different users. I was using the below command in my script to send email... cat email.report | /usr/bin/mailx -s $REQ_SUBJECT -h 5 abc@xyz.com It was working fine all these days but now all of a sudden it... (18 Replies)
Discussion started by: smarty86
18 Replies

7. Shell Programming and Scripting

Reading a file and sending mail by shell scripting?

hi I need help urgently...i need to write a shell script which can solve the following problem....its urgent plz help me out coz m totally newbie in shell scripting.... the problem is: Suppose I have a folder called logs. whenever some error occurs some correspondence error file is generated. I... (4 Replies)
Discussion started by: sukhdip
4 Replies

8. Shell Programming and Scripting

Weird ? symbol coming through-sending text file

Hi All, When I am trying to send a text file through Unix,I get a weird symbol in the .txt file. The symbol is ? in a box (square)....which is making the file unloadable. Please help me with the solution. Thanks in advance Gopi (1 Reply)
Discussion started by: gopi.palleti
1 Replies

9. UNIX for Dummies Questions & Answers

Sending mail to multiple recipient added in a text file

I am trying to find a code that can help me mail to a list of recipients which are in a text file. Sample code $cat recipient.txt me@test.com me1@test.com me2@test.com I want a mailx step that can read contents of recipient.txt and mail to all the users. I don't want to use mails... (1 Reply)
Discussion started by: Gurkamal83
1 Replies

10. Programming

How to write in other language in text/xml file by reading english text/xml file using C++?

Hello Team, I have 2 files.one contains english text and another contains Japanese. so i have to read english text and replace the text with Japanesh text in third file. Basically, I need a help to write japanese language in text/xml file.I heard wstring does this.Not sure how do i write... (2 Replies)
Discussion started by: SA_Palani
2 Replies
EXIM_LOCK(8)						      System Manager's Manual						      EXIM_LOCK(8)

NAME
exim_lock - Mailbox maintenance SYNOPSIS
exim_lock [options]mailbox-file DESCRIPTION
The exim_lock utility locks a mailbox file using the same algorithm as Exim. For a discussion of locking issues, see section 25.2. exim_lock can be used to prevent any modification of a mailbox by Exim or a user agent while investigating a problem. The utility requires the name of the file as its first argument. If the locking is successful, the second argument is run as a command (using C's "system()" function); if there is no second argument, the value of the SHELL environment variable is used; if this is unset or empty, /bin/sh is run. When the command finishes, the mailbox is unlocked and the utility ends. The following options are available: -fcntl Use "fcntl()" locking on the open mailbox. -interval This must be followed by a number, which is a number of seconds; it sets the interval to sleep between retries (default 3). -lockfile Create a lock file before opening the mailbox. -mbx Lock the mailbox using MBX rules. -q Suppress verification output. -retries This must be followed by a number; it sets the number of times to try to get the lock (default 10). -timeout This must be followed by a number, which is a number of seconds; it sets a timeout to be used with a blocking "fcntl()" lock. If it is not set (the default), a non-blocking call is used. -v Generate verbose output. If none of -fcntl, -lockfile or -mbx are given, the default is to create a lock file and also use "fcntl()" locking on the mailbox, which is the same as Exim's default. The use of -fcntl requires that the file be writable; the use of -lockfile requires that the directory containing the file be writable. Locking by lock file does not last for ever; Exim assumes that a lock file is expired if it is more than 30 minutes old. The -mbx option is mutually exclusive with -fcntl. It causes a shared lock to be taken out on the open mailbox, and an exclusive lock on the file /tmp/.n.m where n and m are the device number and inode number of the mailbox file. When the locking is released, if an exclusive lock can be obtained for the mailbox, the file in /tmp is deleted. The default output contains verification of the locking that takes place. The -v option causes some additional information to be given. The -q option suppresses all output except error messages. A command such as exim_lock /var/spool/mail/spqr runs an interactive shell while the file is locked, whereas exim_lock -q /var/spool/mail/spqr <<End <some commands> End runs a specific non-interactive sequence of commands while the file is locked, suppressing all verification output. A single command can be run by a command such as exim_lock -q /var/spool/mail/spqr "cp /var/spool/mail/spqr /some/where" Note that if a command is supplied, it must be entirely contained within the second argument - hence the quotes. BUGS
This manual page needs a major re-work. If somebody knows better groff than us and has more experience in writing manual pages, any patches would be greatly appreciated. SEE ALSO
exim(8), /usr/share/doc/exim4-base/ AUTHOR
This manual page was stitched together from spec.txt by Andreas Metzler <ametzler at downhill.at.eu.org>, for the Debian GNU/Linux system (but may be used by others). March 26, 2003 EXIM_LOCK(8)
All times are GMT -4. The time now is 07:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy