route email to a script.


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users route email to a script.
# 1  
Old 11-18-2003
route email to a script.

Issue: when i send an email to edi@qgatu001.con-way.com it is supposed to get sent to the deliveryagent es_mime_in so it can get proccessed. ok i got this to happen 1x. Will update over the weekend when i can test to let you know if it works completely.

sendmail: 8.12.10.
sendmail.mc was compiled w/:
FEATURE(`mailertable', `dbm /etc/mail/mailertable')

added the entry:
qgatu001.con-way.com es_mime_in:[localhost]
(note the space between the host and the delivery agent is 2 tabs)
made the map w/ the following command:
makemap dbm /etc/mail/mailertable < /etc/mail/mailertable

in my sendmail.cf i have the following deffintion for es_mime_in

Mes_mime_in, P=/usr/synthium/sun4.Solaris/bin/es_mime_in, S=11/31, R=21/31, A=es_mime_in -env /usr/synthium/etc/syn_env.sh -o $g -r $u -t mail -x
# 2  
Old 11-24-2003
the only thing i seemed to be missing was /etc/mail/relay-hosts

in there i have my:
domainname
*

everything is working now.
# 3  
Old 11-24-2003
FYi for other folks on how to filter emails on your UNIX host.

edit the /etc/aliases file and add this line...


<username> "|/path/to/script" ## that | is a pipe...


Then email to the <username> and the script can then filter and forward the email or filter and apply data to a oracle DB as in my example for my DBAs!

Dont forget to execute newaliases...


This is for HPUX but i am sure it is very similar on other unixces.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to email status

Hi, I have few processes in the server continuous run few jobs, each of the process will generate a log file which detailing when its jobs are completed. the logfile will has the name something like this, result1.log, result2.log, result3.log,.... result10.log, result11.log, result12.log.......... (8 Replies)
Discussion started by: khchong
8 Replies

2. Shell Programming and Scripting

Simple Email Script

Hi All, Im completely new to scripting but I was wondering can somebody show me how to write a bash script so that if any file enters a specific directory that an email gets sent? I am running a few backups on a few different machines and rysncing them to a remote device, For each server I... (5 Replies)
Discussion started by: jgalvin
5 Replies

3. Shell Programming and Scripting

Email not being sent from shell script

Hi All, I have prepared the below shell script but no email is being sent from the shell script.Not sure what's wrong here: echo $SHELL /bin/bash . $HOME/.profile . /home/oracle/Oracle_xyz.env export log=/orabin/Oracle/rman_Oracle_arch.out rman target /... (4 Replies)
Discussion started by: a1_win
4 Replies

4. Shell Programming and Scripting

Script to send email after comparing the folder permissions to a certain permission & send email

Hello , I am trying to write a unix shell script to compare folder permission to say drwxr-x-wx and then send an email to my id in case the folders don't have the drwxr-x-wx permissions set for them . I have been trying to come up with a script for few days now , pls help me:( (2 Replies)
Discussion started by: nairshar
2 Replies

5. Shell Programming and Scripting

Getting Email from script

I am running a script from crontab and sending the output to another file. This is the statement in crontab: 45 23 * * * /dst/nikutst/clarity/lib/DSTRestartTest1.sh >> /dst/nikutst/clarity/logs/RestartTest.log The script runs fine and sends output to the log file. But I always get a system... (3 Replies)
Discussion started by: snturner
3 Replies

6. Shell Programming and Scripting

Caller Script should produce and email from 4 different script within it

Hi I wrote a shell script , which includes one output file which is emailed back to me , when the script runs . Now i want to slip the script into 4 different shell scripts each of which taking the parameter PROD or DEV, and include all the 4 different shell scripts in a caller script. ... (3 Replies)
Discussion started by: rxg
3 Replies

7. Shell Programming and Scripting

Email Attachment Script

Hello, I created the following script but i'm trying to figure out why i keep getting an error. #!/usr/bin/perl -w use strict; use warnings; my $baseDir = '/export/home/omcadmin/bin'; my $attachment = "$baseDir/message.txt"; my $from = 'xxx@xxx.com'; my $to = 'xxx@xxx.com'; my... (10 Replies)
Discussion started by: xmaverick
10 Replies

8. Shell Programming and Scripting

Getting the email intot he script

Hi, I'm trying to write a simple script to take an email subject line and add it to a db. I've currently given up on getting procmail to work with my hosting folks so that leaves me with a shell script as the next option. I can set things up so when I receive an email the script is triggered,... (2 Replies)
Discussion started by: mmesford
2 Replies

9. Shell Programming and Scripting

script to change default route when primary gateway dies

Hello all! We have two fedora routers one at each site. What we are trying to do worked using freesco but not on fedora, i'm not very good at scripting and need a little guidence. Basicly what we are trying to do is if the primary line dies, the router will change it's routes to go through our... (0 Replies)
Discussion started by: slacker
0 Replies

10. Shell Programming and Scripting

Email through Script

I have a script to sent email when error occur in the process. The scripts use a config file where I dot . ./config.cfg into the environment. However, when I export the message below into the environment and echo $msg, it shows only "THERE" the first word in the sentence. export msg=THERE WERE... (2 Replies)
Discussion started by: rkumar28
2 Replies
Login or Register to Ask a Question