Sponsored Content
Full Discussion: email mailbox output -
Operating Systems HP-UX email mailbox output - Post 302509233 by Bill L. on Wednesday 30th of March 2011 10:43:41 AM
Old 03-30-2011
email mailbox output -

this was handy for me. stout goes to mail here.
Code:
#mailbox                                                                        
pgm=mailbox                                                                     
USER1=`eval whoami`                                                             
                                                                                
year1=$(date +%Y)                                                               
monthh=$(date +%h)                                                              
day2=$(date +%d)                                                                
local_date=$year1$monthh$day2                                                   
                                                                                
echo "All:"  > /home/$USER1/${pgm}_out                                          
echo "  for $year1 $monthh $day2 copy" >> /home/$USER1/${pgm}_out               
echo " "  >> /home/$USER1/${pgm}_out                                            
echo "$USER1 - check of mail" >> /home/$USER1/${pgm}_out                        
                                                                                
mail -p >> /home/$USER1/${pgm}_out                                              
                                                                                
mailx -s "$USER1 - $pgm/stout - for $local_date" "william.g.loughran@isomeplace.com"  < /home/$USER1/${pgm}_out


Last edited by Scott; 03-30-2011 at 02:47 PM.. Reason: Please use code tags
Bill L.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

direct output to a file then email it

Ok so i have this script and I dont know how to have the output go to a file and then email that file to someone. #!/bin/ksh print "AL" print "AM" print "AN" print "RL\n" nawk '/PROD/ {print $3, $2}' /home/user/switch_listtest | sort -k1,2 print "End of Report" Thank you in... (2 Replies)
Discussion started by: llsmr777
2 Replies

2. Shell Programming and Scripting

sending output of command via email

Hi all i want to send the output of a command by email, i have done this <comand> | mail -s <subject> <email address> which works well, but if the command retunrs noting then i just get a blank email, is there a way to stop this thanks Adam (4 Replies)
Discussion started by: ab52
4 Replies

3. AIX

Sending script output as email

Hi i have a script which executes daily through cron. The output of the script is appended to a log file everyday It also emails me the output of the logfile as we have the mailx command in the script The below is my requirement : Normally When I get the email it sends the entire content... (3 Replies)
Discussion started by: newtoaixos
3 Replies

4. Shell Programming and Scripting

Format the output to sent in Email

Hi I have a script #!/bin/sh # email addresses to send results to, separated by a space EMAILS="xxxx.yyyy@yahoo.com" SUBJECT="MySQL reporting " DISK_DATA_USAGE=/home/aaaa/usaage.txt mysql YYYYYYYY -e " select 100*sum(max_data_length) as disk_usage_pct from xxxxxx;" >... (2 Replies)
Discussion started by: asha210
2 Replies

5. Shell Programming and Scripting

Using AWK to format output and email

Hello, I'm a bit stumped, for some reason when using AWK 'print' is not printing the entire date/line. awk '{print "Ticket #: " $1} {print "Queue : " $2} {print "Recieved : " $3} {print "AP Date : " $4} {print "Circuit ID : " $5} {print... (4 Replies)
Discussion started by: ArvinSodhi
4 Replies

6. UNIX for Dummies Questions & Answers

Formatting The Email Output

Hello All, When i use the single quotes around the variables i am getting each line in the array as seperate in the email as shown in code2 & output2. But i don't want those single quotes to be printed but each array element should be printed as seperate line as when i remove those single quotes... (1 Reply)
Discussion started by: Ariean
1 Replies

7. Shell Programming and Scripting

Send email if Output is available

hello can anyone debug these lines cd /usr/local/scripts ./build update ./build versions | grep available if then mail -s "update for server `hostname`" $EMAIL else echo -e "$YELLOW No update $RESET" fi echo "Please press a key - Back to main menu . . ." ; read but... (3 Replies)
Discussion started by: nimafire
3 Replies

8. Shell Programming and Scripting

Email Format Output issues

Hi Guys, I have written a script, which output information from email notfication. The output works fine in HTML format, but non-html format it is not shown in a human readable format. Can you help with the format *** Script echo " Server Name : $CLIENT_CHECK "... (4 Replies)
Discussion started by: Junes
4 Replies

9. Shell Programming and Scripting

Getting email output in single line with out space in email

I have tried below email method and i am getting every thing in single line . i have put echo to provide space, but it is not helping my code ( echo "From: $FROM" echo "To: $MAILTO" echo "CC: $CC" echo "Subject: $SUBJECT" echo "MIME-Version: 1.0" echo 'Content-Type: multipart/mixed;... (6 Replies)
Discussion started by: mirwasim
6 Replies
IPURGE(8)						      System Manager's Manual							 IPURGE(8)

 *

NAME
ipurge - delete mail from IMAP mailbox or partition based on age or size SYNOPSIS
ipurge [ -f ] [ -C config-file ] [ -x ] [ -X ] [ -i ] [ -s ] [ -o ] [ -d days | -b bytes | -k Kbytes | -m Mbytes ] [ mailbox-pattern... ] DESCRIPTION
Ipurge deletes messages from the mailbox(es) specified by mailbox-pattern that are older or larger than specified by the -d, -b, -k or -m options. If no mailbox-pattern is given, ipurge works on all mailboxes. If the -x option is given, the message age and size MUST match exactly those specified by -d, -b, -k or -m. The are no default values, and at least one of -d, -b, -k or -m MUST be specified. Ipurge by default only deletes mail below shared folders, which means that mails in mailbox(es) below INBOX.* and user.* stay untouched. Use the option -f to also delete mail in mailbox(es) below these folders. Ipurge reads its configuration options out of the imapd.conf(5) file unless specified otherwise by -C. OPTIONS
-f Force deletion of mail in all mailboxes. -C config-file Read configuration options from config-file. -d days Age of message in days. -b bytes Size of message in bytes. -k Kbytes Size of message in Kbytes (2^10 bytes). -m Mbytes Size of message in Mbytes (2^20 bytes). -x Perform an exact match on age or size (instead of older or larger). -X Use delivery time instead of Date: header for date matches -i Invert match logic: -x means not equal, date is for newer, size is for smaller -s Skip over messages that have the Flagged flag set. -o Only purge messages that have the Deleted flag set. FILES
/etc/imapd.conf CMU
Project Cyrus IPURGE(8)
All times are GMT -4. The time now is 11:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy