Sponsored Content
Full Discussion: Which hammer do I use?
Operating Systems Solaris Which hammer do I use? Post 302857493 by blackrageous on Thursday 26th of September 2013 12:31:04 PM
Old 09-26-2013
Perhaps a .forward file will work for you that points to a script. I usually will create a specific email account for this purpose and in .forward have this

| /usr/local/bin/foobar.sh

And in foobar.sh have something like

Code:
while read a
do 
ifSubject=`echo ${a} | grep "Subject: ...."`
if ! [[ -z {ifSubject} ]] 
then
  insert magic here
fi
.
.
done

this can also be done by using /etc/aliases and not a .forward file
Some admins disable the use of .forward files so you need to insure you can use one if use .forward instead of /etc/aliases.
 
mailcompat(1)							   User Commands						     mailcompat(1)

NAME
mailcompat - provide SunOS compatibility for Solaris mailbox format DESCRIPTION
mailcompat is a program to provide SunOS 4.x compatability for the Solaris mailbox format. You would typically run mailcompat to be able to read mail on a workstation running SunOS 4.x when your mail server is running Solaris. Enabling mailcompat creates an entry in your .forward file, if it exists. If this file does not exist, mailcompat will create it. Dis- abling mailcompat will remove the entry from the .forward file, and if this was the only entry, will remove the entire file. To execute mailcompat, log onto the Solaris mail server and enter mailcompat on the command line. Answer the queries provided by the pro- gram. USAGE
See largefile(5) for the description of the behavior of mailcompat when encountering files greater than or equal to 2 Gbyte ( 2^31 bytes). EXAMPLES
Example 1 Examples of the mailcompat feature. The following example enables the mailcompat feature for the user "john". example% mailcompat This program can be used to store your mail in a format that you can read with SunOS 4.X based mail readers To enable the mailcompat feature a ".forward" file is created. Would you like to enable the mailcompat feature? Y Mailcompat feature ENABLED.Run mailcompat with no arguments to remove it example% The following example disables the mailcompat feature for the user "john". example% mailcompat This program can be used to store your mail in a format that you can read with SunOS 4.X based mail readers You have a .forward file in your home directory containing: "|/usr/bin/mailcompat johns" Would you like to remove it and disable the mailcompat feature? y Back to normal reception of mail. example% FILES
~/.forward list of recipients for forwarding messages ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
mailx(1), attributes(5), largefile(5) SunOS 5.11 4 Aug 1994 mailcompat(1)
All times are GMT -4. The time now is 10:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy