Solved

forward specific emails to a remote adress by using parameters

Posted on 2001-06-15
8
314 Views
Last Modified: 2013-12-27
I use an email server on solaris and i forward emails that come in to another email (by request from some users)and at the same time i ceep copies to the local user's mail file.I have done this by writing in the ".forward" file (the .forward file is createt in the local user's mail directory) this line:

"user, user@remotesite.com"

(Accepted Answer from "shanechambers")


My question is, how can i use parameters to forward to the remote adress ("user@remotesite.com") only specific emails eg. incoming mails from a specific sender only

Thanks for your help!
0
Comment
Question by:oceanis
8 Comments
 
LVL 1

Expert Comment

by:k.kidambi
ID: 6195829
there is a file called /etc/mail/aliases. you have to add the alias entries for forwarding the emails the format looks like

usera      user-a@domain1.com
userb      user-b@domain2.com


try this out and post in here if you have anymore questions.

Kidambi
0
 
LVL 1

Expert Comment

by:shanechambers
ID: 6196284
Ok, you want to forward email from certain users, on to another address, while keeping all others, in the local mailbox.  Is this right?

If so, what I would recommend is installing procmail (http://freshmeat.net/projects/procmail).  From there you would do the following;

In the .forward file;
|exec /usr/local/bin/procmail

In .procmailrc;
:0 c
* ^From.*peter
! william@somewhere.edu

This would keep a copy locally (if you don't want a local copy, drop the 'c' on the first line), and send a copy off to william@somewhere.edu, of all mail coming from 'peter' (note you don't need the @somewhere.edu after peter).

Procmail allows you to do a far greater 'conditional' setup for mail delivery then you normally would be able to do.  Take a look at the man pages for 'procmailex,' and 'procmailrc,' once you've got it installed.
0
 

Author Comment

by:oceanis
ID: 6201930
shanechambers is it easy to install procmail on solaris?
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 1

Accepted Solution

by:
shanechambers earned 200 total points
ID: 6203090
Well, I don't really know anyplace off the top of my head to find procmail in a package form, so you would have to download it, and build it. (http://www.procmail.org/)  The first set of downloads have little to no bandwidth, so I would recommend using one of the mirror locations (I used
ucsb.edu, and it worked fine), and download 'procmail-3.15.tar.gz'.  (if the site you select doesn't have 3.15, check another one)


Next you unpackage it:

gunzip -c procmail-3.15.tar.gz | tar -xvf -

That will unzip, and untar it into the directory procmail-3.15.

Next, 'cd' into the directory, and make it.  It's always a good idea to read any files listed as README, and INSTALL, as generally they give you specific instructions on how to build and install the package.  But anyways;

(su to root first!)
make install
(I think there's one question during the configuration, hitting <ENTER> will take the default)

Procmail is setup so well, that it will configure build, and install the package in one swoop.  Once it's installed, you can delete the procmail-3.15 directory.

From here, setup your .forward, and .procmailrc files as I said above! :)

(If you run into any problems, let me know)
Shane
0
 
LVL 1

Expert Comment

by:shanechambers
ID: 6212151
How'd that work out?
0
 

Author Comment

by:oceanis
ID: 6322947
I finaly don't used it but thanks for your help shanechambers.
0
 
LVL 20

Expert Comment

by:tfewster
ID: 8050192
No comment has been added lately, so it's time to clean up this Topic Area.
I will leave a recommendation for this question in the Cleanup topic area as follows:

- Answered by shanechambers

Please leave any comments here within the next 7 days

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

tfewster
Cleanup Volunteer
0
 

Expert Comment

by:modulo
ID: 8099651
Finalized as proposed

modulo

Community Support Moderator
Experts Exchange
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question