Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

forward specific emails to a remote adress by using parameters

Posted on 2001-06-15
8
Medium Priority
?
326 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Accepted Solution

by:
shanechambers earned 800 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 21

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
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…
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…

715 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