Omega Owners Forum

Chat Area => General Discussion Area => Topic started by: Ian_D on 20 July 2009, 20:14:19

Title: IIS + SMTP + MX Records = Help!
Post by: Ian_D on 20 July 2009, 20:14:19
Firstly, I don’t even know if what I’m trying to achieve is possible.... ;D

I've got a home server running Windows 2003. It’s running IIS, and has the SMTP service running.

T'other day I put together some ASP code which I'm playing with to send emails - this works fine  :y

However, I've always wanted to know if I can receive emails through my server.

What do need to do with DNS records etc? My domain name is with 1&1. ISP is Zen with a static IP.

I’ve added an MX to my domain, which is hosted with 1&1, however I’m not sure what I should be typing in there really!  :-[

I've read somewhere that I need to set up PTR's, but the only place I can find to setup a PTR is in the DNS server settings on my server itself, or is this the correct place?

Anyone got any clues? :-/
Title: Re: IIS + SMTP + MX Records = Help!
Post by: JamesV6CDX on 20 July 2009, 20:27:08
The MX records need to point to your mail server

You should have the option to add about three addresses, in priority order...
Title: Re: IIS + SMTP + MX Records = Help!
Post by: TheBoy on 20 July 2009, 20:53:11
Right, for basic mail, you need in DNS:

A/Host record - eg mail.mydomain.com - IP w.x.y.z
MX Record pointing to A record - mail.mydomain.com

For sending mail, you may need to add a TXT record for SPF - Microsoft have a great generation wizard on their site for building SPF records. Without SPF, your mails may get bounced as spam


Using IIS SMTP service for incoming mail presents on major flaw - it has no mailbox support, so it needs to forward elsewhere to somewhere that does have mailboxes
Title: Re: IIS + SMTP + MX Records = Help!
Post by: TheBoy on 20 July 2009, 20:54:15
Quote
The MX records need to point to your mail server

You should have the option to add about three addresses, in priority order...
You have the option to create as many MX records as you like, from 1 to unlimited
Title: Re: IIS + SMTP + MX Records = Help!
Post by: JamesV6CDX on 20 July 2009, 20:56:50
Quote
Quote
The MX records need to point to your mail server

You should have the option to add about three addresses, in priority order...
You have the option to create as many MX records as you like, from 1 to unlimited

Agree - but not sure all ISP front end control panels allow you to do so?
Title: Re: IIS + SMTP + MX Records = Help!
Post by: TheBoy on 20 July 2009, 20:59:34
Quote
Quote
Quote
The MX records need to point to your mail server

You should have the option to add about three addresses, in priority order...
You have the option to create as many MX records as you like, from 1 to unlimited

Agree - but not sure all ISP front end control panels allow you to do so?
Only the gay ones limit you. You old 'local' competitor being a true example of how not to do it.

That said, some places have a single MX, but round robin the A record its pointed at
Title: Re: IIS + SMTP + MX Records = Help!
Post by: Ian_D on 20 July 2009, 21:05:54
right, so I need to create an A record for mail.domain.co.uk on my home server?

And then set the mx record with 1&1 to mail.domain.co.uk?

What would the email address be? anything@domain.co.uk, or anything@mail.domain.co.uk?

assuming the 'anything' can actually be anything since the smtp should put it all in the same folder?
Title: Re: IIS + SMTP + MX Records = Help!
Post by: TheBoy on 20 July 2009, 21:09:00
Quote
right, so I need to create an A record for mail.domain.co.uk on my home server?

And then set the mx record with 1&1 to mail.domain.co.uk?

What would the email address be? anything@domain.co.uk, or anything@mail.domain.co.uk?

assuming the 'anything' can actually be anything since the smtp should put it all in the same folder?
The a record needs to be on your authoritative dns (likely to be same place as where you put MX record

You cannot recieve mail without furthr software, as it has to be delivered to a mailbox.

Title: Re: IIS + SMTP + MX Records = Help!
Post by: Ian_D on 20 July 2009, 21:16:22
Quote
Quote
right, so I need to create an A record for mail.domain.co.uk on my home server?

And then set the mx record with 1&1 to mail.domain.co.uk?

What would the email address be? anything@domain.co.uk, or anything@mail.domain.co.uk?

assuming the 'anything' can actually be anything since the smtp should put it all in the same folder?
The a record needs to be on your authoritative dns (likely to be same place as where you put MX record

You cannot recieve mail without furthr software, as it has to be delivered to a mailbox.


Cant find anywhere to add an A record  :-?
Title: Re: IIS + SMTP + MX Records = Help!
Post by: Ian_D on 20 July 2009, 21:17:06
Ah...

Do I need to create a new sub domain then?

and stick the MX and A record under that?
Title: Re: IIS + SMTP + MX Records = Help!
Post by: TheBoy on 20 July 2009, 21:26:00
Quote
Quote
Quote
right, so I need to create an A record for mail.domain.co.uk on my home server?

And then set the mx record with 1&1 to mail.domain.co.uk?

What would the email address be? anything@domain.co.uk, or anything@mail.domain.co.uk?

assuming the 'anything' can actually be anything since the smtp should put it all in the same folder?
The a record needs to be on your authoritative dns (likely to be same place as where you put MX record

You cannot recieve mail without furthr software, as it has to be delivered to a mailbox.


Cant find anywhere to add an A record  :-?
Might be called HOST record.
Title: Re: IIS + SMTP + MX Records = Help!
Post by: TheBoy on 20 July 2009, 21:28:46
Quote
Ah...

Do I need to create a new sub domain then?

and stick the MX and A record under that?
Until you have software to provide mailboxes, you can't do anything.

Microsoft's effort is the expensive, complex, but bloody powerful Exchange Server. If you nee Exchange help, let me know ;).  But there must be plenty of freeware mail servers than can do both SMTP and POP3/IMAP
Title: Re: IIS + SMTP + MX Records = Help!
Post by: Ian_D on 20 July 2009, 23:42:09
Quote
Quote
Ah...

Do I need to create a new sub domain then?

and stick the MX and A record under that?
Until you have software to provide mailboxes, you can't do anything.

Microsoft's effort is the expensive, complex, but bloody powerful Exchange Server. If you nee Exchange help, let me know ;).  But there must be plenty of freeware mail servers than can do both SMTP and POP3/IMAP

Aye, I will use some freeware for the mail boxes.
Title: Re: IIS + SMTP + MX Records = Help!
Post by: Ian_D on 20 July 2009, 23:49:38
Quote
Quote
Quote
Quote
right, so I need to create an A record for mail.domain.co.uk on my home server?

And then set the mx record with 1&1 to mail.domain.co.uk?

What would the email address be? anything@domain.co.uk, or anything@mail.domain.co.uk?

assuming the 'anything' can actually be anything since the smtp should put it all in the same folder?
The a record needs to be on your authoritative dns (likely to be same place as where you put MX record

You cannot recieve mail without furthr software, as it has to be delivered to a mailbox.


Cant find anywhere to add an A record  :-?
Might be called HOST record.

If I select 'domain.co.uk' and click DNS settings, all I get is IP Address (A-Record) - All I can type in here is an IP.

And Mail Exchanger (MX-Record) - for MX 1 / Priority (4 of)

Thats it. So the A record is my servers IP - It always has been. So if I type in mail.domain.co.uk in the MX record, how does that link to my server? Or will 1&1 somehow change that to mail.123.123.123.123? where 123=my servers ip.

Think im getting my wires crossed somewhere  :'(
Title: Re: IIS + SMTP + MX Records = Help!
Post by: Ian_D on 20 July 2009, 23:59:03
Hmm.. not sure how / if this is working, but its getting closer... Just got this bouncing back...

This message was created automatically by mail delivery software. A message that you sent could not be delivered to one or more ofits recipients. The following addresses failed: <test@domain.co.uk> SMTP error from remote server after RCPT command:host domain.co.uk[123.123.123.123]:550 5.7.1 Unable to relay for test@domain.co.uk

So, my server must now be receiving it.
Title: Re: IIS + SMTP + MX Records = Help!
Post by: Ian_D on 21 July 2009, 00:22:52
Right... after more messing, ive now got them to deliver the messages to the 'queue' dir.  :y
Title: Re: IIS + SMTP + MX Records = Help!
Post by: TheBoy on 21 July 2009, 16:56:06
Quote
Quote
Quote
Quote
Quote
right, so I need to create an A record for mail.domain.co.uk on my home server?

And then set the mx record with 1&1 to mail.domain.co.uk?

What would the email address be? anything@domain.co.uk, or anything@mail.domain.co.uk?

assuming the 'anything' can actually be anything since the smtp should put it all in the same folder?
The a record needs to be on your authoritative dns (likely to be same place as where you put MX record

You cannot recieve mail without furthr software, as it has to be delivered to a mailbox.


Cant find anywhere to add an A record  :-?
Might be called HOST record.

If I select 'domain.co.uk' and click DNS settings, all I get is IP Address (A-Record) - All I can type in here is an IP.

And Mail Exchanger (MX-Record) - for MX 1 / Priority (4 of)

Thats it. So the A record is my servers IP - It always has been. So if I type in mail.domain.co.uk in the MX record, how does that link to my server? Or will 1&1 somehow change that to mail.123.123.123.123? where 123=my servers ip.

Think im getting my wires crossed somewhere  :'(
Thats right - the relay sending to you firstly looks up MX for mydomain.com, which it gets back a normal DNS name, which it then attempts to connect to (doing a 2nd dns lookup to convert to IP).
Title: Re: IIS + SMTP + MX Records = Help!
Post by: TheBoy on 21 July 2009, 16:57:31
Quote
Right... after more messing, ive now got them to deliver the messages to the 'queue' dir.  :y
The freeware software providing mailboxes will most likely do the receiving, rather than IIS's SMTP.  IIS SMTP isn't really a full blown, robust relay.
Title: Re: IIS + SMTP + MX Records = Help!
Post by: Ian_D on 21 July 2009, 20:00:41
Quote
Quote
Right... after more messing, ive now got them to deliver the messages to the 'queue' dir.  :y
The freeware software providing mailboxes will most likely do the receiving, rather than IIS's SMTP.  IIS SMTP isn't really a full blown, robust relay.
Righto, Will have a have a search and see what’s available for free out there!  :y You got any recommendations?
Title: Re: IIS + SMTP + MX Records = Help!
Post by: Ian_D on 21 July 2009, 20:13:24
Oh shit... think i've got a slight problem...

I've got 1249 objects in my mailroot/queue folder  >:(

And I should only have 15-20 max - somthing makes me think I've got it set VERY wrong :-[
Title: Re: IIS + SMTP + MX Records = Help!
Post by: Ian_D on 21 July 2009, 20:21:58
Just found another 2137 emails in the 'badmail' folder too... eeek.

Ive disabled SMTP now  :-X What did I do wrong then  ::)

My guess is it was an open relay? cant believe its had all that crap go through it! All been sent in the last 3 and a bit hrs!  :o
Title: Re: IIS + SMTP + MX Records = Help!
Post by: Turk on 21 July 2009, 21:06:08
 :-/ :-? 
Title: Re: IIS + SMTP + MX Records = Help!
Post by: TheBoy on 21 July 2009, 22:11:14
Quote
Just found another 2137 emails in the 'badmail' folder too... eeek.

Ive disabled SMTP now  :-X What did I do wrong then  ::)

My guess is it was an open relay? cant believe its had all that crap go through it! All been sent in the last 3 and a bit hrs!  :o
mail queue would be due to open relay, but it was unable to relay at that time (probably because its relayed millions ;D).  bad mail is stuff it cannot or does not want to deal with (usually destined for your domain, but no mailbox to put it in).

Welcome to the world of spam ;)
Title: Re: IIS + SMTP + MX Records = Help!
Post by: Ian_D on 22 July 2009, 14:55:47
Quote
Quote
Just found another 2137 emails in the 'badmail' folder too... eeek.

Ive disabled SMTP now  :-X What did I do wrong then  ::)

My guess is it was an open relay? cant believe its had all that crap go through it! All been sent in the last 3 and a bit hrs!  :o
mail queue would be due to open relay, but it was unable to relay at that time (probably because its relayed millions ;D).  bad mail is stuff it cannot or does not want to deal with (usually destined for your domain, but no mailbox to put it in).

Welcome to the world of spam ;)

So I guess it will have attempted to send 10000's of emails then  ::) Woops!  ;D