Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forwarding a mail

Status
Not open for further replies.

BIS

Technical User
Jun 1, 2001
1,893
NL
Hallo,

I have already posted this in the Sendmail forum, but seeing this place is a bit more active, I decided to post it here as well. My apologies to anyone who might find this annoying...

Hopefully this is a simple question...

How to I forward a copy of a mail sent to a user, and also keep a copy of that mail on the mailserver? Suppose Bob wants to keep his mail on the company webserver, but also wants a copy of it forwarded to bob@somewhere.com, how do I go about doing that?
 

In .procmail (in users home directory):

0: c # That's a zero, c means keep local copy
!bob@somewhere.com

Cheers Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 
Sorry - this might make me look like a complete moron, but there is no .procmail in the users home directory...
Can I just create a file called .procmail and enter the commands as shown above?
 

Yes

Cheers Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 
Hmm, doesn't seem to work. Anything I need to do on the permission side?
 
I am beginning to invetigate this. A few more questions if I may...

According to this site the syntax is different.

:0c not 0:c ,and ! address (with a space). Which is correct?

Also I can see that I have procmail installed - but sure as to whether it is running and configured. How can I check that?
 

It's ":0 c" it was a typo.
I don't think the space matters but give it a try.

procmail is not a daemon, it's being called by yout MDA (sendmail or other).

Does 'grep -i procmail /etc/sendmail.conf' give anything??

Cheers Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 
Henrik,
Many thanks for your help, I really appreciate it. Still having problems though...

What is the name of the file? .procmail or .procmailrc
Do I need anything else in this file like PATHs etc?
I am getting slightly confused on the syntax. Is it :0(space)c or just :0c ?

I do not have a sendmail.conf file. This is an old RH6.2 box. If I do 'grep -i procmail /etc/sendmail.cf' I get the following output:

##### @(#)local_procmail.m4 8.11 (Berkeley) 5/19/1998 #####
### PROCMAIL Mailer specification ###
##### @(#)procmail.m4 8.11 (Berkeley) 5/19/1998 #####
Mprocmail, P=/usr/bin/procmail, F=DFMSPhnu9, S=11/31, R=21/31, T=DNS/RFC822/X-Unix,
A=procmail -Y -m $h $f $u
Mlocal, P=/usr/bin/procmail, F=lsDFMAw5:/|@qSPfhn9, S=10/30, R=20/40,
A=procmail -Y -a $h -d $u

Does look ok?
 

Ahhh... Sorry about all the typo's, I'm just writing too fast.

It's .procmailrc and sendmail.cf and to be sure use ':0 c' but I don't know if it matters.

Your sendmail.cf looks ok. Does it still not work??

Cheers

Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 
Ehm ... no [pc]

Is there a log file somewhere?
 

Depends on your setup. Try /var/log/messages and /var/log/sendmail maybe.

Does the mail get anywhere?? It is in the local mailbox, right??
What does 'mailq' give??

Cheers Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 

Is /usr/bin/procmail actually there??

Cheers Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 
Hmm....

/usr/bin/procmail is there.

There is no /etc/procmailrc (is this needed?)

In the /home/bob directory there is a file called .procmailrc (with -rwxrwxr-x), this contains two lines:
:0 c
! bob@somewhere.com

There is also an entry for bob in the /etc/aliases file:

billy: bob

If I send a mail to billy@something.com I receive it, but it does not get forwarded.
If I send a mail to bob@something.com I receive it, but is does not get forwarded.

Any (more) ideas? My excuses for being such a pest.
 

Can you actually send to bob@somewhere.com??

Try 'mailq' to see if they're stuck in the queue and try 'echo "" | sendmail -v Test bob@somewhere.com' to see if you can send to this address.

After sending a mail to bob@something.com (your local machine) try 'ls -lu .procmail' to see if the file has been accessed.

Cheers Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 
No need for procmail. Create a '.forward' file and just type in where you want to forward your email to and the address for the additional copy.

.forward file for bob@yourcompany.com

bob@yourcompany.com
bob@somewhere.com

Now, you'll receive identical emails at both accounts.
 

Problem is that that won't leave a local copy.

Cheers Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top