Sponsored Content
Top Forums Shell Programming and Scripting Schedule a script to check mail? Post 47742 by norsk hedensk on Wednesday 18th of February 2004 01:10:57 AM
Old 02-18-2004
i recently did something similar just for fun. i have a perl script which dumps the messages in a specified mail spool file. then, this script is run via a cron job which dumps that output to a .html file which in turn is a nice small bbs. a semi-dynamic page, without the extra webserver load! (however you could argue running that perl script ever half hour or whatever is just as much load. but actually with a lot of traffic its less load than if apache did it dynamically). anyway here is the script the way i am using it now:

Code:
#!/usr/bin/perl

# this is the perl script for the BBS section of farragutmarine.com/~joe

use Mail::Box::Mbox;

my $folder = Mail::Box::Mbox->new( folder => '/var/mail/bbs' );
my $head = Mail::Message::Head->new;

foreach my $msg ( reverse ($folder->messages()) )
{


	print "<div align=\"left\"><table border=\"0\" cellpadding=\"5\" cellspacing=\"1\" bgcolor=\"#000000\" style=\"width: 632px; height: 158px;\"><tbody><tr><td bgcolor=\"#eeeeff\"><table border=\"0\"><tbody><tr><td align=\"right\"><font color=\"#000000\">Message:</font></td><td><font color=\"#000000\">",$msg->replyPrelude($head->get('sender')),"<br></font></td></tr><tr><td align=\"right\"><font color=\"#000000\">Subject:</font></td><td><font color=\"#000000\">",$msg->subject(),"<br></font></td></tr></tbody></table></td></tr><tr><td bgcolor=\"#ffffff\">",$msg->body(),"<br></td></tr></tbody></table></div><br>";

}


as you can see, you need the Mail::Box::Mbox perl module.

here are the threads where the great people here helped me to write this :

https://www.unix.com/showthread.php?s...ht=MailBoxMbox
https://www.unix.com/showthread.php?s...ht=MailBoxMbox

Last edited by norsk hedensk; 02-18-2004 at 02:18 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script Schedule Scrutiny

Hi All, Here's one that may belong in the Scripting Thread but I thought I'd start off here. Here's the scenario:- I have to transfer the functionality and data from an old E450 to a nice new Sun V440. The E450 contains a bunch of scripts which may or may not still be in use daily,... (2 Replies)
Discussion started by: geralex2
2 Replies

2. UNIX for Dummies Questions & Answers

unix script to check if rsh to box and send status mail

rshstatus=`rsh -n lilo /db/p2/oracle/names9208/restart_names.sh` if $rshstatus <>0 then errstatus=1 mailx -s "xirsol8dr" ordba@xxx.com >> $log_dr else if errstatus=0 echo "status to xirsol8dr successful" can anyone provide if this is t he correct way to do this or is there a better way? (1 Reply)
Discussion started by: bpm12
1 Replies

3. Shell Programming and Scripting

check postfix deferred mail and send notification script

Hi Guys, I have a postfix server which is deferring emails. Now I need to send notification to a specific email address if: The sender of the deferred email is: abc@example.com Contains specific subjects: a file (/opt/subjects) contains all the subjects in place Then need to send a... (0 Replies)
Discussion started by: linuxrulz
0 Replies

4. Shell Programming and Scripting

Mail not attaching the attachment when schedule in crontab

Hi , Iam want to send the mail with attachment , iam using below in my script uuencode /path/pathname/filename filename.csv | mailx -s "subject of mail" vinoth@xxx.com when i trigger the script manually from command prompt i can get with the attachment but when i schedule it in crontab... (4 Replies)
Discussion started by: vinothsekark
4 Replies

5. Shell Programming and Scripting

perl script to check the mail ids in the correct format or not

Hi Folks, I have few mailids in a text file and need to check whether the mailid is in correct format or not. If just to check whether the string is a mailid or not there is a perl module Email::Valid to do the business or we can implement our own logic. But the mail_ids I am having is... (4 Replies)
Discussion started by: giridhar276
4 Replies

6. UNIX for Dummies Questions & Answers

Schedule the Script

I have wriiten one script to get some results from log files. Daily I have to run the script using the below command to get the output. What I need is, Can I schedule the Script to execute once every day at a particular Time and get the output by mail automatically? I heard about 'cron job' . .... (3 Replies)
Discussion started by: Padmanabhan
3 Replies

7. Shell Programming and Scripting

How to write this script:- check output word and send a mail?

Hi Guys, I am not Good at scripting. I need to write a script such that if output of command shows the particular word in output then send mail to abc@compay.com -bash-3.2$ ps -ef | grep bpbkar root 6040 1 0 13:05:19 ? 0:00 bpbkar -r 2678400 -ru root -dt 47395 -to 0... (20 Replies)
Discussion started by: manalisharmabe
20 Replies

8. Shell Programming and Scripting

Check pending mail in mail queue

I know the command mailq can check the pending mail in mqueue , and also have another command to check POSIX mail queue in server , now I will regularly check the mqueue manually , it is time consuming , would advise the script that could help to check the mail queue , and then send the details to... (3 Replies)
Discussion started by: ust3
3 Replies

9. UNIX for Beginners Questions & Answers

Need in for a script that should check for errors in multiple log file (approx 2500) and should mail

hello everyone, I am new to linux and got this deliverable to write a script that should check for error in multiple log file (count is approx 2500 log files on single server) and once error is found, it should mail that error My logic says: we can put all log files path/location in one... (2 Replies)
Discussion started by: Pratik_CTS
2 Replies

10. Shell Programming and Scripting

Check file if not found send mail if exit call second script

I need to check my script and change to working mode. currently it was not sending the mail and exit without calling the second script. I need to check the file is present ="/home/Rvtools/test.csv" if this file not found after the time retry send mail file not found If the file exit run the... (2 Replies)
Discussion started by: ranjancom2000
2 Replies
WEBPMUX(1)						      General Commands Manual							WEBPMUX(1)

NAME
webpmux - command line tool to create WebP Mux/container file. SYNOPSIS
webpmux -get GET_OPTIONS INPUT -o OUTPUT webpmux -set SET_OPTIONS INPUT -o OUTPUT webpmux -strip STRIP_OPTIONS INPUT -o OUTPUT webpmux -frame FRAME_OPTIONS [ -frame ... ] [ -loop LOOP_COUNT ] [ -bgcolor BACKGROUND_COLOR ] -o OUTPUT webpmux -info INPUT webpmux [-h|-help] webpmux -version DESCRIPTION
This manual page documents the webpmux command. webpmux can be used to create a WebP container file and extract/strip relevant data from the container file. OPTIONS
GET_OPTIONS (-get): icc Get ICC profile. exif Get EXIF metadata. xmp Get XMP metadata. frame n Get nth frame. SET_OPTIONS (-set) icc file.icc Set ICC profile. Where: 'file.icc' contains the ICC profile to be set. exif file.exif Set EXIF metadata. Where: 'file.exif' contains the EXIF metadata to be set. xmp file.xmp Set XMP metadata. Where: 'file.xmp' contains the XMP metadata to be set. STRIP_OPTIONS (-strip) icc Strip ICC profile. exif Strip EXIF metadata. xmp Strip XMP metadata. FRAME_OPTIONS (-frame) file_i +di[+xi+yi[+mi]] Where: 'file_i' is the i'th frame (WebP format), 'xi','yi' specify the image offset for this frame, 'di' is the pause duration before next frame and 'mi' is the dispose method for this frame (0 for NONE or 1 for BACKGROUND). Additionally, if 'mi' is ommitted then'xi' and 'yi' can be omitted and will default to +0+0. -loop n Loop the frames n number of times. 0 indicates the frames should loop forever. Valid range is 0 to 65535 [Default: 0 (infinite)]. -bgcolor A,R,G,B Background color of the canvas. where: 'A', 'R', 'G' and 'B' are integers in the range 0 to 255 specifying the Alpha, Red, Green and Blue component values respec- tively [Default: 255,255,255,255]. INPUT Input file in WebP format. OUTPUT (-o) Output file in WebP format. Note: The nature of EXIF, XMP and ICC data is not checked and is assumed to be valid. BUGS
Please report all bugs to our issue tracker: http://code.google.com/p/webp/issues Patches welcome! See this page to get started: http://www.webmproject.org/code/contribute/submitting-patches/ EXAMPLES
webpmux -set icc image_profile.icc in.webp -o icc_container.webp webpmux -get icc icc_container.webp -o image_profile.icc webpmux -strip icc icc_container.webp -o without_icc.webp webpmux -set xmp image_metadata.xmp in.webp -o xmp_container.webp webpmux -get xmp xmp_container.webp -o image_metadata.xmp webpmux -strip xmp xmp_container.webp -o without_xmp.webp webpmux -set exif image_metadata.exif in.webp -o exif_container.webp webpmux -get exif exif_container.webp -o image_metadata.exif webpmux -strip exif exif_container.webp -o without_exif.webp webpmux -frame anim_1.webp +100 -frame anim_2.webp +100+50+50 -loop 10 -bgcolor 255,255,255,255 -o anim_container.webp webpmux -get frame 2 anim_container.webp -o frame_2.webp AUTHORS
webpmux is written by the WebP team. The latest source tree is available at http://www.webmproject.org/code This manual page was written by Vikas Arora <vikaas.arora@gmail.com>, for the Debian project (and may be used by others). SEE ALSO
dwebp(1), cwebp(1), gif2webp(1). Please refer to http://developers.google.com/speed/webp/ for additional information. March 16, 2013 WEBPMUX(1)
All times are GMT -4. The time now is 08:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy