LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-04-2003, 01:39 PM   #1
tracer
LQ Newbie
 
Registered: May 2002
Posts: 17

Rep: Reputation: 0
SENDMAIL: Forward only?


I have a Redhat machine with a static IP on an aDSL line. I would like to configure sendmail to forward
user_1@MYDOMAIN.com ---> user_1@aol.com
user_2@MYDOMAIN.com ---> user_2@earthlink.net
user_3@MYDOMAIN.com ---> user_3@msn.net

etc etc...

Additionally

ANYTHING_ELSE@MYDOMAIN.com ---> admin@something.net

no mail should actually stay on the machien as they will all be "Virtual addresses" which just forward somewhere else.

1) What is the easiest way to set this up?
2) What kind of worries do I need to have about spammers using my sendmail install?
 
Old 09-08-2003, 07:43 AM   #2
Medievalist
Member
 
Registered: Aug 2003
Distribution: Dead Rat
Posts: 191

Rep: Reputation: 56
You can easily do this with entries in the /etc/aliases file. Any time you make changes, run the "newaliases" command.

There are probably a dozen or more ways to do this, incidentally, but you asked for the easiest way.

If your machine is up to date on patches, and you haven't done anything foolish in /etc/mail/sendmail.mc, you have absolutely no worries about spammers hijacking your mail node.

If you fall behind in patches, or you make unwise configuration choices in sendmail.mc, you will be owned in less than a week. A static IP on a DSL line is the holy grail for spammers; if you set up snort you will see that your address is being attacked 10-500 times a day.

It's worse if you are running a windows box, because the patches do not come out in a timely fashion. But regardless of what OS you run, if you fall behind in patches and you are on a high-bandwidth line, you will be 0wned. Check the HoneyNet Project for documentation of this if you were not already aware of the problem.
 
Old 09-08-2003, 03:12 PM   #3
Sticky Toejam
LQ Newbie
 
Registered: Sep 2003
Posts: 17

Rep: Reputation: 0
/etc/mail/aliases is the quick and dirty way of doing this. /etc/mail/virtusertable gives you more options. Use virtual user table (/etc/mail/virtusertable) with the following entries:

user_1 user_1@aol.com
user_2 user_2@earthlink.net
user_3 user_3@msn.net
@MYDOMAIN.com admin@something.net
@OTHERDOMAIN.BLAH localmachineuser
@FOO.BAR groundcontrol@majortom.blah

The order is important - you want user-specific items first (user1, user2, etc) and then the catch-all (@mydomain.com) last. Once you edit this you will need to re-make the map. In /etc/mail/ type:

makemap -v virtusertable <virtusertable

makemap = command to remake the map
"- v" = verbose - ie, see it happen
virtusertable = name of the database. ".db" will be appended
<virtusertable = ascii file data is snarfed from.

This will create a file called "virtusertable.db" from the file "virtusertable". You do not have to stop/restart sendmail for this to take effect. Note that you can use virtusertable for delivering error messages - ie

userid1 error:userid1 is gone.
@otherdomain.blah error:not here - try mydomain.com

etc.
 
Old 09-08-2003, 03:50 PM   #4
Medievalist
Member
 
Registered: Aug 2003
Distribution: Dead Rat
Posts: 191

Rep: Reputation: 56
Agreed. The virtusertable is probably the current best practice (assuming aliases are too simplistic for your needs - there's something to be said for simple solutions to simple problems, too) and it's well supported by the sendmail authors.

Just make sure it's turned on if you decide to use it, and that the file's in the place sendmail.mc says it is. For example,

FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl
 
Old 09-10-2003, 11:21 PM   #5
Sticky Toejam
LQ Newbie
 
Registered: Sep 2003
Posts: 17

Rep: Reputation: 0
Actually I was incorrect in how to generate the table. One actually needs to use:

The order is important - you want user-specific items first (user1, user2, etc) and then the catch-all (@mydomain.com) last. Once you edit this you will need to re-make the map. In /etc/mail/ type:

makemap -v hash virtusertable <virtusertable

makemap = command to remake the map
"- v" = verbose - ie, see it happen
hash = hash tables
virtusertable = name of the database. ".db" will be appended
<virtusertable = ascii file data is snarfed from.

Got a quick question for you Medievalist. You say use

FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl

yet I have found that - at least when compiling with tarballs - one needs to use

FEATURE(virtusertable, `hash -o /etc/mail/virtusertable -T<TMPF>')dnl

My version of sendmail (8.12.9) will complain if I use the first, but shut up if I use the second. What exactly does "-T<TMPF>" do and why is it needed with tarballs and apparently not with RPMs?


Thoughts?
 
Old 09-11-2003, 09:36 AM   #6
Medievalist
Member
 
Registered: Aug 2003
Distribution: Dead Rat
Posts: 191

Rep: Reputation: 56
Hmmm... I dunno. Red Hat is famous for adding patches to nearly everything they ship; this is (depending on your philosophy) either a intrinsically wrong thing that subverts the Open Source development process, or a service to customers that allows Red Hat to deliver a polished and cleanly interoperating set of packages. So this may have something to do with Red Hat patches to sendmail; the only way I know to check that is to unbundle the Red Hat source RPM and look at the spec file.

Note that my method uses access.db, and access is the source file for it. Yours references access straight up.

The -T switch is operating on sendmail's hash function, though, so we could look at the source code to find out what it does (assuming that it's comprehensible to mere mortals, that is - I wouldn't be suprised to find the code was very difficult to follow).

Might find an answer on the sendmail list....
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sendmail forward brentos Linux - Newbie 1 04-21-2004 09:13 AM
sendmail copy and forward steve_babbage Linux - Software 3 03-01-2004 06:48 AM
sendmail forward message exper Linux - Software 2 01-12-2004 01:25 AM
Sendmail .forward Help echid Linux - Newbie 2 05-29-2002 02:09 PM
Using forward in sendmail for linux uglyjoe Linux - General 2 05-22-2002 03:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration