Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

forward specific emails to a remote adress by using parameters

Posted on 2001-06-15
8
Medium Priority
?
331 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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…
Suggested Courses
Course of the Month13 days, 11 hours left to enroll

963 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