heymatty
11-06-2002, 10:12 AM
Hi,
I need to forward some mails I recieve daily to both my email address and my assistants address.
These are transaction notifications from another company so I can't use like a web form or something.
I run redhat 7.2 and I configure my sendmail using my control panel which is webmin. But I could probably edit it by hand in ssh at a push.
My host says he doesn't recall a way to do it, maybe some software is best but I don't want to spend a fortune on CRM software to some emails.
thanks in advance
UH-Matt
11-06-2002, 10:41 AM
use a mailing list program/script set it up to run so that mail sent to youraddress is sent to everyone on the list, then add the email addresses you want to receive the mailings as subscribers.
prime
11-06-2002, 11:09 AM
#man aliases
Man page for the aliases file. Should be in /etc/mail. You'd need to run newaliases after that, but I'm pretty sure webmin lets do all this (modify /etc/mail/aliases, run newaliases to recreate the database, and restart sendmail).
From the aliases manpage:
-----
NAME
aliases - aliases file for sendmail
SYNOPSIS
aliases
DESCRIPTION
This file describes user ID aliases used by /usr/sbin/sendmail. The file resides in /etc (*WARNING, this came from an old install. The file should be in /etc/mail) and is formatted as a series of lines of the form
name: name_1, name2, name_3, . . .
The name is the name to alias, and the name_n are the aliases for that name. Lines beginning with white space are continuation lines. Lines beginning with `#' are comments.
Aliasing occurs only on local names. Loops can not occur, since no mes*sage will be sent to any person more than once.
-----
That's about it. It's really the easiest way to do it, as long as both users are local. I think the aliases mechanism is always part of sendmail, as opposed to the 'virtusertable' way that would allow you to send the message to a remote user, but might require you to recompile sendmail.
I did, often, and beleive me, for the first time it's hours and hours of fun ;)
chrisblack
11-07-2002, 11:03 AM
Have a go connecting to your server by telnet/ssh.
Enter the following commands ..
cd ~
pico .forward
and then in that file list both e-mail addresses.
No doubt there is a better way to do it, but that works for me :)
elsmore1
11-07-2002, 12:38 PM
If you are wanting to forward all mail sent to one of your email addresses to two or more addresses/accounts it is much simpler than if you are wanting to forward mail from certain senders differently than other mail to that same address.
What you probably want to do... (depending somewhat on your sendmail configuration) is to add an entry for the alias@domain you want to redirect in /etc/virtusertable, pointing to an alias (in /etc/mail/aliases) which will define the accounts and/or external addresses to which you want the mail forwarded.
Example:
### in /etc/virtusertable ###
you@yourdomain.com alias23
### in /etc/mail/aliases ###
alias23: user2,joe@somedomain.com,sally@somewhereelse.com
you will need to rebuild virtusertable db and run newaliases for the changes to take effect. (I'm not how much of that webmin will take care of for you if you use webmin to make the changes) The example above would forward all mail sent to you@yourdomain.com to the three recipients specified by alias23. (the local user "user2", and joe and sally at their respective external addresses.
If you instead want to handle mail from a specific sender separately that you do all other mail sent to the same address, this won't work, and you will need to pipe all of the mail through some kind of filter, such as procmail.
hostchamp
11-08-2002, 09:38 AM
jst defining the aliases in /etc/alias works for me, just separate the user accounts you wish ur mails to forward to with a comma, that's it.