Thursday, July 08, 2004

Fetchmail for one domain and multiple users.

Fetchmail one of the complex system under linux.

I was looking for a mailing system for our LAN as below.

All the mails on server should be downloaded to our local gateway machine.

and then mails should be distributed to each user.

Again mails from our local system to local domain should also go to corresponding user.

One more thing is i have to catch the mails going to our own remote server domain and distribute it to corresponding local server user

At first all was looking as not my cup of tea but

The important part was to download the mail from server and distributed to each user on lan.

I found the solution using the fetchmail, sendmail, and local-mail-domains

The .fetchmailrc file i configured as below.

 

defaults
poll mailserver.com with protocol pop3
user username1@mailserver.com with password pwd1 is localusername1

user username2@mailserver.com with password pwd2 is localusername2

 

And added the domain names of local and server machine to file

/etc/mail/local-host-names

 

so that all mails destined to the domains listed in /etc/mail/local-host-names will be trapeed at the local machine only.

 

But running fetchmail for regular interval was also needed to download mails from server so i ran the fetchmail in daemon mode and specifying the interval.

The command used for that was

fetchmail -d 300 -v -f '/home/kirant/.fetchmailrc'

 

again few thing like

To Allow mails to be send by foreign clients (machines on lan) from this server Change following line

    DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
To
    DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl

 

Inside the Webmin an entry for trusted user is added.

And is working cool now.

Still few things are remaining like custom messages for mails going to nonexistant user and running fetchmail automatically

Hope fullly next few days i will be through this and having a Great experience of setting up one LAN Mail server.

And waiting for next project to start.

 

 

 

 

2 Comments:

Anonymous Anonymous said...

Excellent, love it!
» »

6:42 PM  
Anonymous Anonymous said...

That's a great story. Waiting for more. Us refinance rates Aeg dishwasher oko favorit gay hardcore What is allegra 3f

2:43 AM  

Post a Comment

<< Home