Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Email shell script return code Post 303036602 by midhun3108 on Thursday 4th of July 2019 09:54:17 AM
Old 07-04-2019
Need to send email for the output saved

Thanks for the help in code. I also want to email the saved return code from output file. Can you pls help on how to modify the script ?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Store return code of shell script in oracle table

Hi friends, I have to do the following things : 1) there should be a shell script returning the returning the return code of the script. and i have to add some more details like on which machine is has run , at what time and other details and then using plsql i have to add a row to Oracle... (3 Replies)
Discussion started by: sveera
3 Replies

2. Shell Programming and Scripting

Capture Oracle return code in shell script

I am using the following code in my shell script list=`sqlplus -s $user/$pwd@$dbms<<EOF WHENEVER SQLERROR EXIT SQL.SQLCODE set pagesize 0 feedback off verify off heading off echo off select * from control_tbl where src_nm=$3 and extrct_nm=$4; exit SQL.SQLCODE; EOF` ERROR=$?... (1 Reply)
Discussion started by: Vikas Sood
1 Replies

3. Shell Programming and Scripting

return code from script

hey all, I have a simple script #!/bin/bash ./cron.sh test_a.txt & ./cron.sh test_b.txt & wait I want to invoke another program based on the return status of the above calls. How am I were to get that? Thanks! (2 Replies)
Discussion started by: mpang_
2 Replies

4. Shell Programming and Scripting

How to return value in shell script

im using bourne shell In file scriptA i add a new function, test_return() test_return() { a=1 return $a } when i try execute , a='/''/scriptA test_return echo $a its give me error.. scriptA: cannot return when not in function ist any solution for this problem.. How... (1 Reply)
Discussion started by: neruppu
1 Replies

5. Shell Programming and Scripting

How to return the value from the called shell script to the calling sh script

Hi all, I have two ksh scripts #sample1.sh #!/bin/ksh . ./sample2.sh echo $fileExist #sample2.sh #!/bin/ksh func() { i=1 return $a } func echo $? Here how should I return the value of sample2.sh back to sample1.sh? Thanks in advance. (2 Replies)
Discussion started by: gp_singh
2 Replies

6. Shell Programming and Scripting

Need to return fail or pass from shell script on the basis of pl/sql code execution

Hi guys, I am quite new in shell scripting. I am tring to promote some oracle jobs into control-M. In control-M, I am calling a script which establishes a connection with database and execute some procedures. Now I want if that PL/sql Block got failed script should return failure to... (2 Replies)
Discussion started by: alok1301
2 Replies

7. Shell Programming and Scripting

How to return a value of a variable from shell script to perl script

HI , Is there any way to return a value of variable from shell to perl script. Code: === Perl file my $diff1=system("sh diff.sh"); my $diff2=system("sh diff1.sh"); I need exit status of below commands i.e 0 and 1 respectively. Since in both the cases diff is working so system... (3 Replies)
Discussion started by: srkelect
3 Replies

8. Shell Programming and Scripting

Need to get return code from mutt if an address is invalid/undeliverable from Unix shell script

I am using mutt on ksh Unix to send emails to addresses plucked from the database. If the "To:" email address is not longer valid and so the email is not sent to the "To:" recipient, but is sent to the valid cc address, I need to be able to get an error code returned to the shell script so that... (3 Replies)
Discussion started by: jzuber
3 Replies

9. Shell Programming and Scripting

How to capture script return code?

Hi I am executing database backup via shell script (Korn). The backup log is long, but I would like to capture only the last line so I can send an email if it fails Example of failed backup (only last 3 lines) BR0056I End of database backup: bejbofoh.aff 2012-07-26 07.31.21 BR0280I... (7 Replies)
Discussion started by: nimo
7 Replies

10. Shell Programming and Scripting

Return Code to shell script

Hi, I need to send the return code from a script to the parent shell script. But i am suppressing outputs while calling the child script. Is there any way still to get the return code from the child script with suppress output. Below is my script: I am using :$ while calling return.sh... (5 Replies)
Discussion started by: usrrenny
5 Replies
proxsmtpd(8)						    BSD System Manager's Manual 					      proxsmtpd(8)

NAME
proxsmtpd -- an SMTP server for performing filtering SYNOPSIS
proxsmtpd [-d level] [-f configfile] [-p pidfile] proxsmtpd -v DESCRIPTION
proxsmtpd is an SMTP filter that allows you to perform arbitrary filtering on email. It accepts SMTP connections and forwards the SMTP com- mands and responses to another SMTP server. The DATA email body is intercepted and scanned before forwarding. Email can be altered, bounced, or silently dropped. proxsmtpd aims to be lightweight and simple rather than have a myriad of options. The options it does have are configured by editing the proxsmtpd.conf(5) file. See the man page for proxsmtpd.conf(5) for more info on the default location of the configuration file. OPTIONS
The options are as follows. -d Don't detach from the console and run as a daemon. In addition the level argument specifies what level of error messages to dis- play. 0 being the least, 4 the most. -f configfile specifies an alternate location for the proxsmtpd configuration file. See proxsmtpd.conf(5) for more details on where the configuration file is located by default. -p pidfile specifies a location for the a process id file to be written to. This file contains the process id of proxsmtpd and can be used to stop the daemon. -v Prints the proxsmtp version number and exits. FILTER SCRIPTS
The filter script is specified using the FilterCommand option. By default the email is piped through the script on standard input. Standard output is read for the filtered email. Standard error is also read for error messages. If the FilterType option is set to 'file', your filter will operate on a file rather than processing standard in and standard out. The file name will be passed to your filter command using the EMAIL environment variable. Your script can change the file as needed. Standard error is still processed as outlined below. If the filter command returns a successful exit code (ie: 0), then the filtered email is sent to the destination mail server as usual. When a error exit code (ie: anything but 0) a failure message is sent back to the sending server. In this case the email is not sent. You can customize the error message sent back. The last line of output printed to standard error will be used in this case. If you specify a full SMTP error code then it will be used (ie: '550 Bad Email'). If it's just a text message then a 550 SMTP error code will be used. You can silently drop messages by using an error message with a 250 SMTP code. This gives the illusion to the sending server that the email was accepted. Various environment variables will be present when your script is run. You may need to escape them properly before use in your favorite scripting language. Failure to do this could lead to a REMOTE COMPROMISE of your machine. CLIENT The network address of the SMTP client connected. EMAIL When the FilterType option is set to 'file', this specifies the file that the email was saved to. RECIPIENTS The email addresses of the email recipients. These are specified one per line, in standard address format. REMOTE If proxsmtpd is being used to filter email between SMTP servers, then this is the IP address of the original client. In order for this information to be present (a) the SMTP client (sending server) must an send an XFORWARD command and (b) the SMTP server (receiving server) must accept that XFORWARD command without error. REMOTE_HELO If proxsmtpd is being used to filter email between SMTP servers, then this is the HELO/EHLO banner of the original client. In order for this information to be present (a) the SMTP client (sending server) must an send an XFORWARD command and (b) the SMTP server (receiving server) must accept that XFORWARD command without error. SENDER The email address for the sender of the email. SERVER The network address of the SMTP server we're connected to. TMPDIR The path to the temp directory in use. This is the same as the TempDirectory option. LOGGING
proxsmtpd logs to syslogd by default under the 'mail' facility. You can also output logs to the console using the -d option. LOOPBACK FEATURE
In some cases it's advantageous to consolidate the filtering for several mail servers on one machine. proxsmtpd allows this by providing a loopback feature to connect back to the IP that an SMTP connection comes in from. To use this feature specify only a port number (no IP address) for the OutAddress setting in the configuration file. This will cause proxsmtpd to pass the email back to the said port on the incoming IP address. Make sure the MaxConnections setting is set high enough to handle the mail from all the servers without refusing connections. TRANSPARENT PROXY FEATURE
A transparent proxy is a configuration on a gateway that routes certain types of traffic through a proxy server without any changes on the client computers. proxsmtpd has support for transparent proxying of SMTP traffic by enabling the TransparentProxy setting. This type of set- up usually involves firewall rules which redirect traffic to proxsmtpd and the setup varies from OS to OS. The SMTP traffic will be forwarded to it's original destination after being scanned. Note that some features (such as SSL/TLS) will not be available when going through the transparent proxy. Make sure that the MaxConnections setting is set high enough for your transparent proxying. Because proxsmtpd is not being used as a filter inside a queue, which usually throttles the amount of email going through, this setting may need to be higher than usual. SECURITY
There's no reason to run this daemon as root. It is meant as a filter and should listen on a high TCP port. Care should be taken with the directory that proxsmtpd writes its temporary files to. In order to be secure, it should not be a world write- able location. Specify the directory using the TempDirectory setting. Make sure you understand the issues involved with escaping external data. The environment variables such as SENDER or RECIPIENTS need to be treated with care. If running proxsmtpd on a publicly accessible IP address or without a firewall please be sure to understand all the possible security issues. This is especially true if the loopback feature is used (see above). SEE ALSO
proxsmtpd.conf(5) AUTHOR
Stef Walter <stef@memberwebs.com> proxsmtp June 1, 2019 proxsmtp
All times are GMT -4. The time now is 06:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy