Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 256
  • Last Modified:

automatic replay to an user mail

Hello Experts!!..

We have a server with Redhat Enterprise 3.0 with sendmail+MailScanner running. We have a user named s.garzon. what i want to do is to reply, automatically, any message from  capipuer@telecartagena.com to this user with a message i want they to receive. I guess this can be done putting a .procmailrc file  in the user directory but i don't know how to do  it. Can somebody tell me how to do it??..

P.D.: the messages must be received, i just want to reply them.

Thanx

RBrayM.
0
rbraym
Asked:
rbraym
  • 3
  • 2
1 Solution
 
blklineCommented:
I'm not sure what you're asking.   Are you trying to replace any message sent from capipuer@telecaragena.com to s.garzon with a message of your own?  What about the original message?  Where should it go?

What you want is probably a procmail script.  You may be able to find a sample that accomplishes what you want by doing:

man procmailex

If you can't then be a bit more specific and we'll get you straightened out.

Barry
0
 
rbraymAuthor Commented:
Hello Barry..

The message must be received by s.garzon as normal.. all i want to do is trigger a reply message to capipuer@telecaragena.com when they sent a message to this user, saying that must sent that message to other user. Just that.

How can i do this??

Thanx
0
 
blklineCommented:
Pretty simple:

:0c
*     ^From:.capipuer@telecaragena.com
*     ^To:.s.garzon*
| echo "Your message was received" | mail -s "E-mail subject here" capipuer@telecaragena.com


This is the simplest thing.  If you have a longer message, you can do something like this:

....
| cat filename | mail -s "E-mail subject here" capipuer@telecaragena.com

Barry
0
 
rbraymAuthor Commented:
Thanks..  Barry.. It worked but i had to add .* in the beggining and the end of capipuer.. and s.garz.... addresses, 'cause i was getting NO MATCH error in procmail.log.

Just another question, if i want to change the FROM header in the message that is sent back to capipuer (with the text file).. how can i do this??

Thanx

RBrayM
0
 
blklineCommented:
You can do that by using sendmail instead of the mail utility.  Try "man sendmail" and check out the -f and -r flags.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

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.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now