Solved

forward specific emails to a remote adress by using parameters

Posted on 2001-06-15
8
312 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
 
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
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…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.

744 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now