Solved

forward specific emails to a remote adress by using parameters

Posted on 2001-06-15
8
316 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
nodeip 9 86
how to check for shares on aix 1 85
remove a combination of patterns from a file 15 70
mobaxterm not able to change directory 28 207
Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
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.

860 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