Solved

1 to four mail boxes (True or False)?

Posted on 2000-05-15
18
244 Views
Last Modified: 2010-04-20
I just want to know if it is really possible:

My network provider give me one mail box and allow me to define 3 aliases to this mail box. For instance, the email account is info@mydomain.com, I can have three aliases (staff1@mydomain.com, staff2@mydomain.com, staff3@mydomain.com) to the same mail box. As a result, when I login to the smtp.mydomain.com with "info", I can get all message from these four email addresses.

Question: Can I use fetchmail and sendmail to download all messages to my local mail system, and let four users to get their messages from this mail box individually? User should login local mail server as info, staff1, staff2, staff3.

(Is it called masquerading from the sendmail handbook?)


I would be very happy to give more point for someone give me more tips to do this. Thank you very much.
0
Comment
Question by:akit
  • 10
  • 5
  • 2
  • +1
18 Comments
 
LVL 2

Expert Comment

by:ksemat
Comment Utility
if your mail server is called mydomain.com then you just simply have to create those accounts as they are and then when you run fetchmail sendmail will send this mail to the individual mail boxes.
If not then define a Cw in your sendmail.cf file defining mydomain.com as a a domain local to your host.
then your .fetchmailrc would look like this
poll isp.com protocol pop3 nodns
localdomains mydomain.com
user (account) pass (passwd) to
root
*
here
I hope this is what you wanted
0
 

Expert Comment

by:ibishop
Comment Utility
If I remember correctly from when I was doing this (many moons ago - run my own mail servers these days), you can indeed do this with fetchmail/sendmail.

In your /etc/aliases file, you will need to add some lines like :

info@mydomain.com: info
staff1@mydomain.com: staff1
staff2@mydomain.com: staff2
staff3@mydomain.com: staff3

Save the file, and execute the "newaliases" command.

Create the user accounts for info, staff1, staff2, and staff3 - these are what your staff will log into to collect their mail from your local server.

Have fetchmail poll the POP3 server at your ISP.  As the messages come in, and are passed to sendmail, those messages addressed to the staffx@ addresses should be moved to the correct mail folders during the processing.

Like I say, it's been a little while since I did this, but I'm 99% sure that's all I did.

Ian
0
 

Author Comment

by:akit
Comment Utility
Thanks a lot.

My local mail server name is now change to mydomain.com and aliases are added, send & receive messages locally are okay but all remote messages by fetchmail are send to root's mailbox.
0
 

Author Comment

by:akit
Comment Utility
Adjusted points from 5 to 50
0
 

Author Comment

by:akit
Comment Utility
I still work/try on it these hours. :(
I nearly send hundred of mail to myself :<

However, all message only send to root's mailbox..!  %[

I looked a Sendmail reference book, it said that there is a /etc/virtusertable like /etc/aliases file, I thank it may help but I don't know how to make sendmail to read it.

The book only said that I must add the "virtusertable" feature to the macro file:

FEATURE('virtusertable', 'hash /etc/virtusertable')


WHAT's THAT? Thanks.
0
 

Author Comment

by:akit
Comment Utility
So tried and sleep now.. Hope to have someone give me any hints.. Thanks..
0
 

Author Comment

by:akit
Comment Utility
.Should I use "MultiDrop" feature on fetchmail??
0
 
LVL 2

Expert Comment

by:ksemat
Comment Utility
The virtusertable is used when you want to direct that mail that comes for user x should go to account y and also to say that mail addressed to domain y should go to account z lets  say I p has a domain test.domain.com but he is not on the net full time then I can set him up in my virtusetable like this
@test.domain.com  test and add a Cwtest.domain.com to my sendmail.cf file this will direct all mail that comes to anyone at test .domain.com to the account test on my machine and thus they can poll that account and fetch their mail same with
user@test.domain.com test will direct mail to user@test.domain.com to the account test.
Now as for putting all the mail in root's account, make sure there is an entry for my.domain.com in your /etc/hosts file then you should have a localdomains line specifying that my.domain.com is a local domain
localdomains my.domain.com host.mydomain.com
where host is the host name of your box.
0
 

Author Comment

by:akit
Comment Utility
Still not work, my root mailbox full of testing messages...
May I clarify my need and situation:

1. My ISP host my domain, web address is www.mydoamin.com, mail server is mail.mydomain.com (SMTP and POP3).

2. My ISP only give me one mail login ID (info) and password (one mail box), but allow me to set three aliases to this mail box (staff1, staff2 and staff3).

3. There are four users account in my local linux box: info, staff1, staff2, staff3. The linux box host name is "fs1" and domain is "office" (fs1.office). Sendmail is working locally for any message send to @fs1 or @mydomain.com.

4. I can't send email outside the world, the local smtp say "we do not relay..."

5. I put following to the /etc/aliases and executed newaliases:
info@mydomain.com info
staff1@mydomain.com staff1
staff2@mydomain.com staff2
staff3@mydomain.com staff3

6. I removed all entries in virtusertable and makemap again

7. My fetchmailrc is simply as below:
set postmaster "postmaster"
set bouncemail
set properties ""
set daemon 1
poll mail.mydomain.com with proto POP3 nodns
       user info there with password PASSWORD is * here options
keep no rewrite


8. My /etc/hosts file is as below:
192.168.0.1   fs1.office   fs1
localdomains  mydomain.com  fs1.office

9. I don't have static IP, but eth0 can connect to the internet by the gateway device.


What is my fault?? Please help. Really thank you very much.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 40

Expert Comment

by:jlevie
Comment Utility
Since the ISP has simply created aliases for a single email account all of the email to the various accounts (info, staff1, staff2, etc.) is being delivered to that account at the ISP. When you fetch the mail from the ISP it is all going into root's mailbox as you are undoutedly running fetchmail as root. You can tell fetchmail to put the messages into some other mailbox, but they will still all go to a single mailbox.

Depending on what the headers of the email look like, it might or might not be possible to separate the stream of messages into separate streams to be sent to various local user mailboxes with procmail. The orginal "To:" header that has the aliased account name must be present to be able to separate the messages.

What you need is not a single mailbox at the ISP and multiple aliases, but multiple mailboxes, each with a separate username. Many ISP's will do this for a modest monthly charge. Then you have a way of unambiguously telling your system where the various messages are to go to.
0
 

Author Comment

by:akit
Comment Utility
The header is like below:
Delivered-to: mydomain.com%info@mydomain.com
....
Delivered-to: mydomain.com%Staff1@mydomain.com
....
To: <staff1@mydomain.com>

The "To:" header is showing the aliase, in this case, is it possible for me to deliver the message to staff1's mailbox?

I need to have 50 mail addresses for users, each mailbox cost me US$30, if I can make it one to four, that would be saved much money.

Please teach me. Thank you very much.
0
 
LVL 40

Expert Comment

by:jlevie
Comment Utility
Yes, I believe a procmail rule can be used to separate out the messages, and it should work for any number of aliases in one mailbox. It's entirely too lat to work up and test the procmail rule tonight, but I think I can have something for you tomorrow. In the meantime you could look at the man pages for procmail and procmailex any play with the concept yourself.
0
 
LVL 2

Accepted Solution

by:
ksemat earned 50 total points
Comment Utility
Yeah but you still haven't specified the localdomains line have you?
Also as for point 4 of no relaying you can solve that using the relay-domains file to allow your local network or your domain to relay through your mail server.
I will give you an example of how what I said works if it applies to you then take it up
I have a client with his domain as client.domain.name his mx records point to my.server.name and I have an account on my box called client into which I direct all this mail.
So he gives people e-mail accounts at client.domain.name say user1@client.domain.name user2@client.domain.name etc and all this goes to that one mail box called client on my box then he he has a .fetchmailrc file which he runs as root that reads
poll myserver protocol pop3 nodns
localdomains client.domain.name host.client.domain.name
user username pass passwd to
root
*
here
and his sendmail.cf has a line specifying that client.domain.name is a local domain i.e
Cwclient.domain.name
Cwlocalhost
when he runs fetchmail -va the mail is delivered to user1 user2 etc's mail boxes also there should be an entry in etc/hosts for client.domain.name.If this is the kind of setup you have then it should work if you set it up this way.
0
 
LVL 2

Expert Comment

by:ksemat
Comment Utility
so in your case I guess you can have a .fetchmailrc like this
poll mydomain.com protocol pop3 nodns
localdomains mydomain.com host.mydomain.com
user info pass passwd to
root
*
here
and add this to sendmail.cf
Cwmydomain.com
also edit hosts and add
192.x.x.x mydomain.com mydomain
then create user accounts for user1 user2 etc and remove all those aliases you set up.
run fetchmail -va and ti should work.I hope.
0
 

Author Comment

by:akit
Comment Utility
Follow with ksemat, the fetchmail work excellent.

The points will be given soon, just because I have another question about "551 we do not relay" under this situation, I want to leave this open for a moment, in case someone need to know my setting details. Thanks.

ksemat, jlevie and ibishop, would you pls join my question at:

http://www1.experts-exchange.com/Computers/Operating_Systems/Linux/Q_10354734.html

Many thanks.
0
 

Author Comment

by:akit
Comment Utility
Comment accepted as answer
0
 

Author Comment

by:akit
Comment Utility
Excellent! Thank you very much!
0
 
LVL 2

Expert Comment

by:ksemat
Comment Utility
it is good that your problem was solved but it apeears that your other question is already answered and I have to surrender two points to see the answer and maybe add a suggestion maybe if you remove that I will be able to provide more input.
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

762 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now