Trying to manipulate mail recipients before it leaves AIX - Aix

This is a discussion on Trying to manipulate mail recipients before it leaves AIX - Aix ; Hello, I am trying to see if someone can help me figure out if there is any way I can do the following: I have many AIX servers that have many scripts configured to alert us. These scripts simply send ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Trying to manipulate mail recipients before it leaves AIX

  1. Trying to manipulate mail recipients before it leaves AIX

    Hello,

    I am trying to see if someone can help me figure out if there is any
    way I can do the following:


    I have many AIX servers that have many scripts configured to alert
    us.
    These scripts simply send an e-mail to the following address:


    system@company.org => This is an Outlook alias that simply points to
    a bunch of people addresses: bb@company.org, cc@company.org,
    dd@company.org, etc (many more)

    Please note that "system" is not an AIX user account. It is an Outlook
    alias that we use to send mail to from AIX scripts.

    I need to configure AIX somehow so that when the many scripts run and
    mail is sent to "system@company.org", AIX filters it and sends the
    mail ONLY to a few
    people (a...@company.org and d...@company.org) and not to the whole
    list defined in Outlook.

    What we are trying to avoid is to edit all of the scripts to send to a
    different address/alias and we don't want everyone in the Outlook
    "system" alias to receive the AIX e-mails.

    Everytime I do :

    # mail system@company.org
    it leaves AIX and it send it to the SMTP server and then sends it to
    everyone in the Outlook alias. This is fine but we don't want everyone
    in the "system" alias Outlook to get these e-mails and we don't want
    to edit all of the scripts to change the line "system@company.org"


    Is there anyway to do this with sendmail, etc. in AIX?


    Thanks for any help you can provide.

    BTNA

  2. Re: Trying to manipulate mail recipients before it leaves AIX

    so, what you have are a number of scripts that have incorrect email
    addresses specified in them and the email addresses are in fact not
    correct i.e. you do not actually want to send the emails to those
    addresses, so you want to change them on the fly everytime the script
    is run whilst leaving them in this incorrect state ??

    Ok, so, that is wrong on so many levels

    How are you storing the email addresses ? in a variable ? hardcoded ?

    Usually I will set them up in a config file and each script that fires
    off read the config file giving me only one pace to define the email
    addresses .. but thats just me ..

    You may want to direct your effort at fixing the scripts to work more
    efficiently rather than frigging it on the fly ..

    perl / sed / awk can all do text substitution, so you could globally
    change all your scripts to have the correct email addresses, or I
    would suggest, sorting out your scripts ...

    my 2 pence anyhoo

    HTH
    Mark Taylor

  3. Re: Trying to manipulate mail recipients before it leaves AIX

    On May 15, 11:05*pm, btna wrote:
    > Hello,
    >
    > I am trying to see if someone can help me figure out if there is any
    > way I can do the following:
    >
    > I have many AIX servers that have many scripts configured to alert
    > us.
    > These scripts simply send an e-mail to the following address:
    >
    > sys...@company.org *=> This is an Outlook alias that simply points to
    > a bunch of people addresses: b...@company.org, c...@company.org,
    > d...@company.org, etc (many more)
    >
    > Please note that "system" is not an AIX user account. It is an Outlook
    > alias that we use to send mail to from AIX scripts.
    >
    > I need to configure AIX somehow so that when the many scripts run and
    > mail is sent to "sys...@company.org", AIX filters it and sends the
    > mail ONLY to a few
    > people (a...@company.org and d...@company.org) and not to the whole
    > list defined in Outlook.
    >
    > What we are trying to avoid is to edit all of the scripts to send to a
    > different address/alias and we don't want everyone in the Outlook
    > "system" alias to receive the AIX e-mails.
    >
    > Everytime I do :
    >
    > # mail sys...@company.org
    > it leaves AIX and it send it to the SMTP server and then sends it to
    > everyone in the Outlook alias. This is fine but we don't want everyone
    > in the "system" alias Outlook to get these e-mails and we don't want
    > to edit all of the scripts to change the line "sys...@company.org"
    >
    > Is there anyway to do this with sendmail, etc. in AIX?
    >
    > Thanks for any help you can provide.
    >
    > BTNA


    I had similar situations.
    What we did was:
    1-localize and rename the mail program to let's say mail.original
    2-create a script with all the logic you want and then call the
    program mail.original passing the required parameters . if the address
    to is not sys...@company.org, in this script, just call the program
    mail.original.

    hope it helps
    JP

  4. Re: Trying to manipulate mail recipients before it leaves AIX

    On May 16, 6:04*am, Mark Taylor wrote:
    > so, what you have are a number of scripts that have incorrect email
    > addresses specified in them and the email addresses are in fact not
    > correct i.e. you do not actually want to send the emails to those
    > addresses, so you want to change them on the fly everytime the script
    > is run whilst leaving them in this incorrect state ??
    >
    > Ok, so, that is wrong on so many levels
    >
    > How are you storing the email addresses ? in a variable ? hardcoded ?
    >
    > Usually I will set them up in a config file and each script that fires
    > off read the config file giving me only one pace to define the email
    > addresses .. but thats just me ..
    >
    > You may want to direct your effort at fixing the scripts to work more
    > efficiently rather than frigging it on the fly ..
    >
    > perl / sed / awk can all do text substitution, so you could globally
    > change all your scripts to have the correct email addresses, or I
    > would suggest, sorting out your scripts ...
    >
    > my 2 pence anyhoo
    >
    > HTH
    > Mark Taylor


    Well. The e-mail address in the script is correct: system@company.org
    but since this is an Outlook alias, it contains may Outlook addresses
    including Directors and managers that still want to be in the Outlook
    alias (system) but don't want to get now the AIX alerts.
    So, instead of modifying the scripts to change this alias, I wanted to
    try to manuipulate sendmail to alias in AIX system@company.org to the
    e-mail addresses I need the alerts to go to.

    Hope this clears the reason for the reques.

    thanks again for your input.


  5. Re: Trying to manipulate mail recipients before it leaves AIX

    On May 16, 10:19 am, btna wrote:
    > On May 16, 6:04 am, Mark Taylor wrote:
    >
    >
    >
    >
    >
    > > so, what you have are a number of scripts that have incorrect email
    > > addresses specified in them and the email addresses are in fact not
    > > correct i.e. you do not actually want to send the emails to those
    > > addresses, so you want to change them on the fly everytime the script
    > > is run whilst leaving them in this incorrect state ??

    >
    > > Ok, so, that is wrong on so many levels

    >
    > > How are you storing the email addresses ? in a variable ? hardcoded ?

    >
    > > Usually I will set them up in a config file and each script that fires
    > > off read the config file giving me only one pace to define the email
    > > addresses .. but thats just me ..

    >
    > > You may want to direct your effort at fixing the scripts to work more
    > > efficiently rather than frigging it on the fly ..

    >
    > > perl / sed / awk can all do text substitution, so you could globally
    > > change all your scripts to have the correct email addresses, or I
    > > would suggest, sorting out your scripts ...

    >
    > > my 2 pence anyhoo

    >
    > > HTH
    > > Mark Taylor

    >
    > Well. The e-mail address in the script is correct: sys...@company.org
    > but since this is an Outlook alias, it contains may Outlook addresses
    > including Directors and managers that still want to be in the Outlook
    > alias (system) but don't want to get now the AIX alerts.
    > So, instead of modifying the scripts to change this alias, I wanted to
    > try to manuipulate sendmail to alias in AIX sys...@company.org to the
    > e-mail addresses I need the alerts to go to.
    >
    > Hope this clears the reason for the reques.
    >
    > thanks again for your input.- Hide quoted text -
    >
    > - Show quoted text -


    Sorry, but I have to agree with Mark. Essentially what you are saying
    is that you have an email address that you use that is an alias to a
    whole bunch of other email addresses. You want to "sometimes" send the
    emails to all users, but "sometimes" email the messages to only SOME
    users in that group.

    I would follow Mark's advice and set up a config file that lists all
    the programs which will run on your AIX server that generate and email
    a log. You then specify the email address that you want the log for
    that particular program/script to go to. So for example, my scripts in
    the config file may look like this:

    # cat /etc/default.emails.cfg
    default:sys...@company.org
    daily.backup.sh:admin@company.org
    daily.sales.sh:salesmen@company.org
    weekly.cleanup.sh:admin@company.org
    check.logins.sh:security@company.org
    manager.reports.sh:managers@company.org

    You then set up these email addresses as aliases in your Outlook and
    the "admin@company.org" will send the emails to anyone who is a member
    of that Outlook group. If the script is not listed, you can have it go
    to the default of "sys...@company.org" or simply not send an email.

    You are better to control who gets the emails at the Outlook alias
    level by creating more aliases, rather than modifying or coding
    special email functions on your AIX.

    Just my two Canadian cents... :-)

    SteveN

+ Reply to Thread