# Setting up a Mail Server

## Onion Avenger

Hello,

Sorry if this is a dupe, but I've searched and searched and it looks like everyone who talks about setting up mail servers talks about fetching mail from a POP3 server or something then ferrying it or storing it for machines on the LAN.

However, I don't want to fetch mail from another server - I want to BE that server.  :Cool: 

When the people on my company's LAN use outlook or whatever to use mail.companyname.com as their "incoming" and "outgoing" server, I need to be that server.

This will be replacing the mail hosting service some other company does for us, so what information do I need from them?

Could anyone please point me in the right direction??

Thanks in advance,

--Richie, the Onion Avenger

----------

## devon

I would check out the Virtual Mailhosting System Guide. You may not need everything in that Guide, but it will give you some direction.  :Smile: 

----------

## Onion Avenger

Thanks, I was scanning through it before, but I got really confused.  Why do they call it "Virtual" mailhosting?  It talks about using multiple domains and I think that's what it meant, but I only need to use one domain.  

It looks like in postfix's config that I can specify 

```
myhostname = $host.domain.name

mydomain = $domain.name
```

  Would this be where I would say mail.company.com ??

Thanks for the speedy reply,

--Richie, the Onion Avenger

----------

## kashani

If you just have one domain or are fine with one to one mapping of your domains (ie user@acme.com and user@acme.net go the same place) you can ignore the greater part of the Virtual Mail Guide. A general Postfix and Courier-IMAP install should get you most of what you want. In a corporate enviroment you might think about adding the following.

1. Cyrus SASL so people can send mail from anywhere if they can authenticate.

2. Some http based method to change passwords for the users to use.

3. Web mail

4. Some spam filtering.

The Virtual Guide convers 1 and 3. You're on your own for 3 and I'd recommend http://advosys.ca/papers/postfix-filtering.html for 4.

kashani

----------

## Onion Avenger

Ah, well I had a LOT of my confusion cleared up by a visit to http://computer.howstuffworks.com

After reading the articles on Web Servers, Email, and most especially the DNS servers, I feel much more enlightened and think that I now have the basic knowledge to follow the Virtual Mailhosting System Guide.  Definitely a good read for anyone.

I'll update this post on my progress and problems, thank you very much for the help!

--Richie, the Onion Avenger

----------

## uzik

There are a bunch of mail servers. I had a lot of security problems

with sendmail. I switched to postfix and had very good results.

much easier configuration and no security problems ( so far! ).

An outlook compatible (not pop3/smtp) is a different animal.

I understand a new program was recently released to replace

microsoft's email server software. I don't recall the name of

the software though, sorry.

----------

## Onion Avenger

 *Quote:*   

> An outlook compatible (not pop3/smtp) is a different animal. 

 

Our current mail server is either pop3 or imap, I think.  I'm not using M$ Exchange if that's what you're refering to.

Well, I installed postfix and courier-imap and I can send and receive messages to myself on the local machine!  Good start I think.

The mail server is connected to a LAN with all of our other workstations, which all connect to a router.  I configured the router to forward port 25 (for smtp) and 110 (for pop3) directly to the mail server.  Now to mail the mail server, (for right now) I'd shoot a mail to bob@123.456.789.100, right?

When the server is all ready, then I'd let the guy who manages the DNS servers know to change it so instead of pointing to mail.company.com, it'd point to the IP we get for the router, right?  Then when someone emails, the router forwards it to the mail server because ports 25 and 110 get forwarded just to it, right?

This seems to all make sense to me.  I'll keep on going through the Virtual Mailhosting doc and see what happens.

Thanks again for the help,

--Richie, the Onion Avenger

----------

## Onion Avenger

Okay, I think all I want to install for now is postfix and courier-imap.

I can send messages to anywhere just peachy with postfix and mutt, but I cannot receive mail.    :Crying or Very sad: 

I tried root@my.ip.address.here but it was undeliverable.

Any suggestions?  Which logs should I check?

Thanks,

--Richie, the Onion Avenger

----------

## Liathus

I woudl look at sendmail if you really want a configurable mail server.   Contrary to popular belief sendmail is a very secure solution if you keep up on patches (just like any other server application). 

We use sendmail as a mail server for our ISP, we have about 30-40 domain names that the 1 server hosts, about 1200 users.   

It's true that sendmail can be a bear to get used to, but that can be greatly eased using something like webmin.  In fact sendmail is very easy to use via webmin.

I have looked at postfix in the past but i feel it doesnt have the flexability that we require.

----------

## Onion Avenger

Ok, I can telnet the router's WAN IP on ports 25 and 110 and it is indeed forwarded to the server.  Perhaps I should double-check off-site (after all, the machine is sitting right next to me) but if I'm going out through our external IP, coming back in, connecting to a specific port, it should be okay.

Therefore it seems like emailing root@the.ip.i.use SHOULD work.  Hardware-wise, it looks good.  Therefore it's some configuration in the machine.  What should I look at?

Thanks again,

--Richie, the Onion Avenger

----------

## Onion Avenger

Thanks Liathus for the post.  (Looks like I was one minute too slow making my reply   :Wink:  )

However, it seems that the problem is not in the sending, but in the receiving.  Unless sendmail can do that too.

Any other suggestions?

Thanks,

--Richie, the Onion Avenger

----------

## Onion Avenger

Okay, I checked the /var/log/mail/current file, and it looks like the hotmail server I was sending the test message from was rejected.  Here:

```

Aug 19 15:25:04 [postfix/smtpd] connect from bay8-dav21.bay8.hotmail.com[64.4.26.125]

Aug 19 15:25:04 [postfix/smtpd] > bay8-dav21.bay8.hotmail.com[64.4.26.125]: 220 efs-server.company.com ESMTP Postfix

Aug 19 15:25:04 [postfix/smtpd] watchdog_pat: 0x808ebc0

Aug 19 15:25:04 [postfix/smtpd] < bay8-dav21.bay8.hotmail.com[64.4.26.125]: EHLO hotmail.com

Aug 19 15:25:04 [postfix/smtpd] > bay8-dav21.bay8.hotmail.com[64.4.26.125]: 250-efs-server.company.com

Aug 19 15:25:04 [postfix/smtpd] > bay8-dav21.bay8.hotmail.com[64.4.26.125]: 250-PIPELINING

Aug 19 15:25:04 [postfix/smtpd] > bay8-dav21.bay8.hotmail.com[64.4.26.125]: 250-SIZE 10240000

Aug 19 15:25:04 [postfix/smtpd] > bay8-dav21.bay8.hotmail.com[64.4.26.125]: 250-VRFY

Aug 19 15:25:04 [postfix/smtpd] > bay8-dav21.bay8.hotmail.com[64.4.26.125]: 250-ETRN

Aug 19 15:25:04 [postfix/smtpd] match_hostname: bay8-dav21.bay8.hotmail.com ~? 192.168.0.0/24

Aug 19 15:25:04 [postfix/smtpd] match_hostaddr: 64.4.26.125 ~? 192.168.0.0/24

Aug 19 15:25:04 [postfix/smtpd] match_hostname: bay8-dav21.bay8.hotmail.com ~? 127.0.0.0/8

Aug 19 15:25:04 [postfix/smtpd] match_hostaddr: 64.4.26.125 ~? 127.0.0.0/8

```

So this would be the mynetworks parameter in /etc/postfix/main.cf, right?

----------

## fimblo

just to clarify the dns and smtp part:

The outgoing mail server (smtp) gets a message from a client with a To: field saying that the email is to be sent to, say abc@domain.com. 

The mail server asks its resolver (the dns server), for the MX post for domain.com. (if it doesnt find it it continues to lookup the A and CNAME)

The resolver does a recursive lookup (unless its cached), gets an ip number (1.2.3.4), which it returns to the smtp server as a reply.

Now the smtp server knows where to send the mail. It connects to 1.2.3.4 port 25, passes the message on, and disconnects.

hmm hope that helped... oh read rfc 2821 and 2822 if you want some more juicy details  :Smile: 

----------

## fimblo

 *Quote:*   

> Therefore it seems like emailing root@the.ip.i.use SHOULD work. Hardware-wise, it looks good. Therefore it's some configuration in the machine. What should I look at?
> 
> 

 

um avoid using ip numbers to the right of the @. It might work, but its discouraged in the rfc, and both sendmail and postfix are quite rfc compliant.

but if you got it to work, well, thats another story.

----------

## Onion Avenger

Hmmmm, okay.

But I was temporarily doing root@123.456.789.012 because I wanted to make sure it was working before I tell the DNS guy to re-route mail.company.com to our router's external ip.

But it seems like it can connect....it just gets rejected or something.  At least the server knows that hotmail is trying to connect to it.

Thanks for the replies,

--Richie, the Onion Avenger

----------

## fimblo

hi!

just got home, i realised what your problem could be. I think its two separate problems you have here.

1) you're testing using abc@1.2.3.4 (or something). I tested it (using postfix) and I didnt get a error message immediately either. (I tested by telnetting to localhost, port 25, and interfacing the postfix api directly)

but, afterwards I got an error sent to my From: address, saying that the domain name 1.2.3.4 could not be resolved. So i suggest you test sending email using either a local alias (localhost) or a FQDN.

2) the other problem is receiving email. try turning off courier-imap and just using postfix. telnet in to localhost and do the following:

```
fimblo@waoh:~> telnet localhost 25

Trying 127.0.0.1...

Connected to localhost.

Escape character is '^]'.

220 waoh.pilsnet.sunet.se ESMTP Postfix

helo localhost

250 waoh.pilsnet.sunet.se

mail from: user@anything

250 Ok

rcpt to: user@domain.name

250 Ok

data

354 End data with <CR><LF>.<CR><LF>

Subject: this is my subject

This is the message payload.

.

250 Ok: queued as AAD55C7DE3

quit

221 Bye

Connection closed by foreign host.

```

Assuming that

1) the address user@domain.name is real, and

2) you have told postfix in main.cf that relaying is ok from locahost,

 this email should arrive safely.

Then at least we know that that sending part works...

/fimblo

----------

## fimblo

oh sorry another thing- you dont need to reroute dns to send mail. only to receive mail.

I, like many others, have an MTA on my laptop so that I can always send mail, no matter where I am. I dont receive email on my MTA, I connect to my courier-imap service on my stationary computer.

heh hope this isnt confusing... Im going to bed now, good luck!!!

----------

## uzik

Before you turn it on make sure you have relaying disabled.

This is default on most servers now. This will prevent spammers

from using your machine to send email.

----------

## Onion Avenger

Wow!  Thanks for the last three replies, guys!

I'll test this tomorrow and give you the status.  So if postfix sends AND receives, what exactly does courier-imap do??

I've only read the posts once, maybe if I read them again they'll make more sense, but I have to leave soon - it seems that I didn't make myself completely clear: I have no problems whatsoever sending mail from my new mail server. It's peachy.  It's just receiving mail.  If I send a mail from my hotmail account to root@123.123.123.123, it never gets delievered.  

But when I return tomorrow, I'll read your posts more carefully - it's my bad either way (not reading them better or not explaining better).

Thanks again for the help - it looks promising!

--Richie, the Onion Avenger

----------

## taskara

why don't you set up a temporary domain using dyndns.org

and then u can have a domain to test everything is working, then either stick with dyndns.org or get your dns guy you mentioned to make the changes.

dyndns.org works great  :Very Happy:  just create an account (dynamic dns) and tell your router to update, (or log in to their webpage and tell them your new ip)

instantly resolving.

----------

## Liathus

Just as a followup... Sendmail also sends and receives.  It is a very common smtp server on the internet.

----------

## splooge

Have your DNS admin make a new dns entry, test.yourdomain.com, have him point it to the external IP of the router, and then send a message to you@test.yourdomain.com

----------

## fimblo

Both sendmail and postfix (Mail transfer agents) send and receive mail, like liathus said. Your Q was What does courier-imap do?.

in example you send mail to abc@domain.com.

When you use your mua (pine, mutt) to send mail, what happens is that your mua connects to your mta, port 25 (or if they are on the same box you also can just use the command sendmail...anyway). 

Your MTA rece9ives the email and relays it to the other MTA (which belongs to domain.com), after doing all the dns stuff I wrote about (above). This second MTA has an ip number which is described in the MX post in the dns tree.

Now we've got a fork:

1) user abc could ssh to the server, and check mail on the MTA server using pine or mutt or some other MUA.

2) you could install a program which allows users to fetch mail from the MTA to their workstations. there are two popular protocols used to do this: imap (Internet Message Access Protocol) and pop3 (Post Office Protocol v3) , and their secure cousins imaps and pop3s.

courier-imap is an implementation of imap.

hmm did that explain what courier-imap does?

----------

## Onion Avenger

Wow!  So many posts over the night!  Thanks again for all the help!

Let's see:

taskara - Wow!  I didn't know that service was available!  I'm setting up a temporary domain now so I can email without relying on an IP.

Liathus - Thanks for the followup.  I wouldn't have guessed Sendmail receives from the name   :Smile: 

<EDIT=I read your post too quickly  :Embarassed:  >

splooge - Hmmm, that's a possibility.  Thanks for the suggestion.

</EDIT>

fimblo - so courier-imap will provide the protocol for a client (mutt, outlook, etc) to get the mail from the MTA?

I'm going to keep on trying today when I have the times to do so.

Thanks again for all the help!

--Richie, the Onion Avenger

----------

## Onion Avenger

Hmmm, when I email root@efs.mine.nu from my hotmail account, I still don't receive (courier-imap is disabled, postfix is enabled).

Here's some of my /var/log/mail/current:

```
Aug 20 11:17:18 [postfix/smtpd] connect from bay8-dav55.bay8.hotmail.com[64.4.26.63]

Aug 20 11:17:18 [postfix/smtpd] > bay8-dav55.bay8.hotmail.com[64.4.26.63]: 220 efs-server.emeraldforest.com ESMTP Postfix

Aug 20 11:17:18 [postfix/smtpd] watchdog_pat: 0x808ebc0

Aug 20 11:17:18 [postfix/smtpd] < bay8-dav55.bay8.hotmail.com[64.4.26.63]: EHLO hotmail.com

Aug 20 11:17:18 [postfix/smtpd] > bay8-dav55.bay8.hotmail.com[64.4.26.63]: 250-efs-server.emeraldforest.com

Aug 20 11:17:18 [postfix/smtpd] > bay8-dav55.bay8.hotmail.com[64.4.26.63]: 250-PIPELINING

Aug 20 11:17:18 [postfix/smtpd] > bay8-dav55.bay8.hotmail.com[64.4.26.63]: 250-SIZE 10240000

Aug 20 11:17:18 [postfix/smtpd] > bay8-dav55.bay8.hotmail.com[64.4.26.63]: 250-VRFY

Aug 20 11:17:18 [postfix/smtpd] > bay8-dav55.bay8.hotmail.com[64.4.26.63]: 250-ETRN

Aug 20 11:17:18 [postfix/smtpd] match_hostname: bay8-dav55.bay8.hotmail.com ~? 192.168.0.0/24

Aug 20 11:17:18 [postfix/smtpd] match_hostaddr: 64.4.26.63 ~? 192.168.0.0/24

Aug 20 11:17:18 [postfix/smtpd] match_hostname: bay8-dav55.bay8.hotmail.com ~? 127.0.0.0/8

Aug 20 11:17:18 [postfix/smtpd] match_hostaddr: 64.4.26.63 ~? 127.0.0.0/8

Aug 20 11:17:18 [postfix/smtpd] match_hostname: bay8-dav55.bay8.hotmail.com ~? 63.117.233.245/0

Aug 20 11:17:18 [postfix/smtpd] match_hostaddr: 64.4.26.63 ~? 63.117.233.245/0

Aug 20 11:17:18 [postfix/smtpd] fatal: bad net/mask pattern: 63.117.233.245/0

Aug 20 11:17:19 [postfix/master] warning: process /usr/lib/postfix/smtpd pid 2488 exit status 1

Aug 20 11:17:19 [postfix/master] warning: /usr/lib/postfix/smtpd: bad command startup -- throttling

Aug 20 11:18:19 [postfix/smtpd] match_string: mynetworks ~? debug_peer_list

Aug 20 11:18:19 [postfix/smtpd] match_string: mynetworks ~? fast_flush_domains

Aug 20 11:18:19 [postfix/smtpd] match_string: mynetworks ~? mynetworks

Aug 20 11:18:19 [postfix/smtpd] match_string: relay_domains ~? debug_peer_list

Aug 20 11:18:19 [postfix/smtpd] match_string: relay_domains ~? fast_flush_domains

Aug 20 11:18:19 [postfix/smtpd] match_string: relay_domains ~? mynetworks

Aug 20 11:18:19 [postfix/smtpd] match_string: relay_domains ~? permit_mx_backup_networks

Aug 20 11:18:19 [postfix/smtpd] match_string: relay_domains ~? qmqpd_authorized_clients

Aug 20 11:18:19 [postfix/smtpd] match_string: relay_domains ~? relay_domains

Aug 20 11:18:19 [postfix/smtpd] match_string: permit_mx_backup_networks ~? debug_peer_list

Aug 20 11:18:19 [postfix/smtpd] match_string: permit_mx_backup_networks ~? fast_flush_domains

Aug 20 11:18:19 [postfix/smtpd] match_string: permit_mx_backup_networks ~? mynetworks

Aug 20 11:18:19 [postfix/smtpd] match_string: permit_mx_backup_networks ~? permit_mx_backup_networks

```

Is this still a problem with the mynetworks setting in /etc/postfix/main.cf ??

----------

## Onion Avenger

 *uzik wrote:*   

> Before you turn it on make sure you have relaying disabled.
> 
> This is default on most servers now. This will prevent spammers
> 
> from using your machine to send email.

 

Is this the relay_domains parameter in main.cf?  If so, I'm not entirely clear as to what I should set it to...

Thanks,

--Richie, the Onion Avenger

----------

## Onion Avenger

 *splooge wrote:*   

> Have your DNS admin make a new dns entry, test.yourdomain.com, have him point it to the external IP of the router, and then send a message to you@test.yourdomain.com

 

Well, I followed taskara's suggestion and used dyndns.org to point efs.mine.nu to the external IP of our router.  I then sent a message to root@efs.mine.nu to no avail.

I can telnet efs.mine.nu on port 25, so I know that the dyndns DNS is current.  Therefore, it's still something wrong with the configuration on my machine....

Thanks,

--Richie, the Onion Avenger

----------

## Onion Avenger

Ok, I got a delivery failure back for Hotmail.  Here are the details:

```

Reporting-MTA: dns;hotmail.com

Received-From-MTA: dns;mail.hotmail.com

Arrival-Date: Wed, 20 Aug 2003 08:33:51 -0700

Final-Recipient: rfc822;root@efs.mine.nu

Action: failed

Status: 5.0.0

Diagnostic-Code: smtp;554 <root@efs.mine.nu>: Relay access denied

```

Relay access denied?  Is that the problem?  How do I fix it?

Thanks,

--Richie, the Onion Avenger

----------

## MikePikeFL

 *Quote:*   

> Relay access denied? Is that the problem? How do I fix it? 

 

Hotmail thinks you are a relay server and is denying your emails. Is your MX record set up correctly?

----------

## kashani

This help thread is a bit convoluted, let's simplify. 

1. Let's not screw around with dynamic dns crap. You have a domain, use it. Add the following records to your zone file

mailtest.domain.com IN A your router IP

Make sure you have reverse DNS as well, it'll keep some ISP's from blocking you.

2. Postfix needs to be configured properly. You should only have to edit 5 fields or so. If you did more than that, you're probably going to have trouble.

mydestination = $myhostname, localhost.$mydomain

mydomain = domain.com

myhostname = mailtest.domain.com

mynetworks = 127.0.0.0/8, 10.10.44.0/24, any other IP's you want to be able to relay

mynetworks_style = subnet

myorigin = $myhostname

3. Test, test, test. You should be able to test to the server now. Start out simple by telneting to the server directly on port 25 and making sure it will accept mail to local users. Then do the same and try to send to non local servers. Repeat both test using an external mail client from you network. Repeat both test using an external client from someone else network. Sending to a non local user should fail for the last one.

4. Add the users.

5. Change the config. This should be the only line you'll need to change.

mydestination = $myhostname, localhost.$mydomain, $mydomain, anyother domains you want to accept mail for

6. Make the new server the primary MX for your domain.

If you still have problems getting Postfix to work post the output of postconf -n.

kashani

----------

## Onion Avenger

 *kashani wrote:*   

> This help thread is a bit convoluted, let's simplify. 

 

Agreed.

I'll contact the dude that manages our DNS servers in awhile and tell him to add the mailtest entry.

I'll do the steps outlined.

So postfix (or sendmail, but I already am using postfix)  is all I need for a basic email server, right??  Basic email server defined as being able to send and receive.  

Thanks,

--Richie, the Onion Avenger

----------

## kashani

 *Onion Avenger wrote:*   

> 
> 
> So postfix (or sendmail, but I already am using postfix)  is all I need for a basic email server, right??  Basic email server defined as being able to send and receive.  
> 
> Thanks,
> ...

 

Yep, Postfix will be just fine.

kashani

----------

## fimblo

could you do a:

```
grep -v "#" /etc/postfix/main.cf | grep -v ^$ > postfix_options
```

and post your options?

Your postfix seems to be trying to see if 64.4.26.63 is a legal source address.

----------

## Onion Avenger

 *fimblo wrote:*   

> could you do a:
> 
> ```
> grep -v "#" /etc/postfix/main.cf | grep -v ^$ > postfix_options
> ```
> ...

 

Here it is:

```

queue_directory = /var/spool/postfix

command_directory = /usr/sbin

daemon_directory = /usr/lib/postfix

mail_owner = postfix

myhostname = efs-server.emeraldforest.com

mydomain = emeraldforest.com

inet_interfaces = all

mydestination = $myhostname, localhost.$mydomain $mydomain

unknown_local_recipient_reject_code = 450

mynetworks = 192.168.0.0/24, 127.0.0.0/8

alias_maps = hash:/etc/mail/aliases

alias_database = hash:/etc/mail/aliases

home_mailbox = .maildir/

home_mailbox = .maildir/

local_destination_concurrency_limit = 2

default_destination_concurrency_limit = 10

debug_peer_level = 2

debugger_command =

         PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin

         xxgdb $daemon_directory/$process_name $process_id & sleep 5

sendmail_path = /usr/sbin/sendmail

newaliases_path = /usr/bin/newaliases

mailq_path = /usr/bin/mailq

setgid_group = postdrop

manpage_directory = /usr/share/man

sample_directory = /etc/postfix/sample

readme_directory = /usr/share/doc/postfix-2.0.11

```

----------

## fimblo

aha! Check out  Proxy/NAT network addresses at http://www.postfix.org/basic.html#proxy_interfaces. I seem to rememebr that you forward port 25 from your router to your internal mailserver?

Otherwise:

* mydestination should be comma separated.

* you have two home_mailbox lines, one is enough

* You might have done this on purpose, but your myhostname contains a domain name which is non-existent: 

```
fimblo@waoh:~> dig @ns2.readyhosting.com. efs-server.emeraldforest.com

; <<>> DiG 9.2.2 <<>> @ns2.readyhosting.com. efs-server.emeraldforest.com

;; global options:  printcmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 23708

;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:

;efs-server.emeraldforest.com.  IN      A

;; AUTHORITY SECTION:

emeraldforest.com.      86400   IN      SOA     ns1.readyhosting.com. hostmaster.ns1.readyhosting.com. 2001050701 10800 3600 691200 86400

;; Query time: 191 msec

;; SERVER: 63.119.175.104#53(ns2.readyhosting.com.)

;; WHEN: Wed Aug 20 23:18:08 2003

;; MSG SIZE  rcvd: 110

```

note the NXDOMAIN.

On another note, I suggest you add a few lines to your main.cf, making it a little harder for UCE to get thru. Read about them at: http://www.postfix.org/uce.html

----------

## fimblo

Finally, I also suggest you test your system if its an open relay here:

http://www.abuse.net/relay.html

If you pass, theres a good chance that you're safe.

----------

## Onion Avenger

Thanks for the helpful reply!

I think that's how the mydestination in the Virtual Mailhosting guide looked, so I kept it like that.  I was wondering why....

Also, main.cf came by default with two home_mailbox lines.  Identical....wierd.  I'll change it.

And yes, efs-server.emeraldforest.com doesn't exist.  efs-server is the name of the server itself.  I'll change this so it corresponds to efs.mine.nu.  I didn't think it'd make much of a difference....

Thanks again fimblo,

--Richie, the Onion Avenger

----------

## Onion Avenger

Wooohooooo!!!!!

It worked!

Looks like my general network incompetence showed when I used a hostname/domain that didn't exist yet.    :Laughing: 

I also changed mydestination, the dual home_mailbox thing, and the proxy_interfaces line to my external IP of the router.

That's super!

Now it's obvious I can use this box as a simple mail server.

Now I need to implement things like SSL, maybe Squirrelmail, etc.

Should I just keep on following the Virtual Mailhosting guide?

I don't know if I want to do all the mysql stuff...

Thanks so much for everybody's help!

Thanks fimblo for your prompt (and very helpful) replies!

--Richie, the Onion Avenger

----------

## Onion Avenger

 *fimblo wrote:*   

> Finally, I also suggest you test your system if its an open relay here:
> 
> http://www.abuse.net/relay.html
> 
> If you pass, theres a good chance that you're safe.

 

Well, it looks like I pass!  Thanks!  Cool website!

--Richie, the Onion Avenger

----------

## Onion Avenger

Sorry, another post:

If I can send and receive email with mutt, why then do I need courier-imap?  Is mutt really special in that in can interface with the MTA (postfix) without using a protocol such as IMAP and POP?  If that's the case, I'd need courier-imap for my outlook users, wouldn't I?

Thanks,

--Richie, the Onion Avenger

----------

## Liathus

yes you will need a imap or pop3 server for applications such as outlook or mozilla mail to work.

----------

## fimblo

The Virtual Mailserver guide explains a heck of a lot, but I never did the mysql thing myself.  I used parts of the Desktop Configuration Guide which explained installing squirrelmail... works fine  :Smile: 

About the mut thing- postfix saves received emails in a file (could be a spool file at /var/spool/mail/user or something, or your $HOME/.maildir directory... all depending on your MTA and your configuration) When you start up your MUA, it tries look for your $MAIL environment variable or it uses instructions in the configuration file to see where the mail is saved.

So in your case a MUA doesnt get mail directly from the MTA, it gets it from file. If you install pop3 or imap, you can read mail from another system via tcp/ip.

----------

## eNut

[ ..... didn't see topic was two pages  :Sad:  ]

----------

## Onion Avenger

Sorry, another post before I go on with courier-imap:

When I receive emails from my root email (root@efs.mine.nu), everything looks good in the message header except for the from field.  It says: 

```
From: root <root@>
```

Why is that?  Where can I specify that the domain name needs to be appended there?

And thanks fimblo and Liathus - now I finally understand the need for courier-imap.  

I just don't know if I want the mysql thing and all the ssl stuff.  I don't think our existing email server has SSL (in fact, I'm almost postive it doesn't if I rmember my outlook settings right).  Is it really necessary?  I don't know if I want to install all the certificates and stuff...

--Richie, the Onion Avenger

----------

## Onion Avenger

Alright, I emerged courier-imap and IMAP and POP3 works flawlessly.  I tested with Outlook on an XP box.  I didn't do any of the SSL stuff, and frankly I'm glad I'm not - too much hassle it seems for only a minor benefit.

I'm wondering if the from: root@ is a mutt thing, because when outlook used pop3 and imap to send and receive messages I think (should've double-checked) that it said root@efs.mine.nu just fine.  I'll double-check that.

Another question: just to clarify, to add more email accounts, it's just adding more users with the adduser or equivalent commands, right?  Then each user gets a ~/.maildir, right?

Thanks,

--Richie, the Onion Avenger

----------

## kashani

A few things on creating users and maildir.

If they don't need to actually ssh to the machine it's best to give them a shell of /bin/false. Their home dir will still be created, but they won't have local access to the server. 

Also .maildir/ is not created by default upon user creation. Postfix will create .maildir/ when the first piece of mail for that users arrives. I'd suggest sending a welcome message to all users or scripting out .maildir creation to avoid interesting error from Courier when it can't find a users .maildir/

kashani

----------

## Onion Avenger

Yeah, it looks like it's a mutt thing that I got root@ without the domain name.   Outlook was just fine. 

Thanks for the info kashani.  I remember now hearing about making user's shells point to /bin/false from somewhere.

--Richie, the Onion Avenger

----------

## fimblo

Finally, I strongly recommend that you install ssl support for your courier-imap. ssl in postfix isnt quite as important, tho good to have.

courier-imap (and pop3 for that matter) are services which must be logged into. and without ssl support you're going to have users passing their username/password pairs in clear text... 

anyone on a shared medium between the client system and the server can sniff the transfer (very easy). which is... dangerous.

in any case, good luck!

/fimblo

----------

