[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Mail configuration and setup LONG REPLY



At 12:09 2000/08/12 +0100, you wrote:
I was hoping someone would be able to help on this one as I have never done it
before.

I just got through doing something very similar to this, so I'll do my best.

What I am trying to do, is set up a debian box that will serve as a mailserver (both smtp and pop), dial-on-demand internet access, and fax server.

The dial on demand is solved, and works beautifully. It routes perfectly (or rather masquerades) inside the network to the outside. But I am puzzled by the mailsystem.

It can be a bit convoluted, but it's very possible to do. It was wierd for me, cause I've got filters setup and other stuff like that.

Accepting mail is on to a major server that this box will connect to once in a while to download the mail. All the mail to this office is collected in one file named as a user. I will try and explain that better;

(explanation snipped)

Ok, to download the mail, you need to run fetchmail. Depending on how you want it to work you'll probably want to write a little script for fetchmail.

1) If you want fetchmail to only try and connect when some other process has initiated the connection, put one script in your ip-up.d/ directory for when you get a connection, and another in your ip-down.d/ directory to turn off fetchmail when your connection hangs up. You'll also need to tweak diald, to make sure that fetchmail can't keep the connection up, as this would defeat the purpose of this setup, I think.

2) If you want fetchmail to connect every, say, 30 minutes, whether or not you have a connection (this SHOULD allow fetchmail to open up it's own connection whenever it needs it), just put a script in your init.d/ directory like every other service (this is what I've done on my network). I'll post a copy of my init.d/fetchmail script if you like, it's very small.

As was mentioned before, all fetchmail does is collect mail from a box, and give it to your local SMTPd, whatever happens to be running. My copy of Debian (potato 2.2.17) installed exim by default ( www.exim.org ), and that was quite easy to get running (I just ran eximconfig. It was very helpful, and got me all setup nicely). You'll probably want your system setup to relay all mail on the internal network via a smarthost (your current, upstream SMTPd, like the one used by your ISP), and then configure all local clients to use your Debian box as their SMTP gateway.

As long as all the valid e-mail addresses @yourdomainname.com have usernames or aliases setup on your Debian box, this is all I think you need to setup. Aliases can go in the /etc/aliases file, if you'd like people to have more than one valid e-mail
(jsmith, john.smith, john_smith, johns, ETC all going to the same person).

I can't think of anything else that you need to have setup. Personally, I'd run fetchmail at boot up, set it up to run every, say, 15-30 minutes (depends on how real-time you want it, and how many times you want to connect in a day), so that it can use diald to get it's connection, diald will hang up after whatever time you have set up. That way you'll be able to get your mail every 30 minutes, say, but you'll still only be on for seconds (depending on how much mail you have, of course) at a time.

Hope this helped!
Adam
Toronto, Ontario, Canada



Reply to: