Mail server configuration with "The Perfect Server" for Ubuntu 10.10

Discussion in 'Installation/Configuration' started by SacreBleu, Jan 29, 2011.

  1. SacreBleu

    SacreBleu New Member

    Hello all,

    I've just freshly registered to this community, couldn't find a proper introduction forum so I'll just post something nice here.

    I am a Dutch student at the Rotterdam University studying to become a teacher, I love photography and always shared a passion with anything IT-related.
    This passion brought me the idea to host a website myself, something which I've been doing successfully for some time now.
    I felt it was time to get a bigger project started so I bought a domain-name and wanted to see what kind of 'cool stuff' I could do with it.

    The basic concept what I have now, is just to host "a bunch of websites" be it Wordpress, Joomla! or Drupal anything and everything just as a huge experimentation.

    To cut a long story short, I followed this excellent tutorial: http://www.howtoforge.com/perfect-server-ubuntu-10.10-maverick-meerkat-ispconfig-3 to the letter, copied and pasted as much as I could and trying to Google what the heck I was exactly doing.

    Now, one of my greatest desires is to have my own mail-server, so being able to send and receive mail to other domains.
    As I said, I followed the tutorial to the letter, and made some quick configurations in ISPconfig.

    However, I don't have the ability to receive or send mail to domains outside my own, I've taken it upon myself to start a new leaf, format and start over.
    For this to be successful I have a few enquiries which I hope people will be able to help me with.



    I have the ability to change my DNS settings by a third-party provider, I've deleted all the records, save for two:

    Code:
    A brothersonline.nl →    
    A localhost.brothersonline.nl → 127.0.0.1  
    CNAME www.brothersonline.nl → brothersonline.nl           
    
    Starting a new leaf, first things first, how should I name my server?
    The first time I went through the guide I choose server1.brothersonline.nl is this suitable or should it be (e.g mail.brothersonline.nl)

    I know I have to make an MX-record to whatever my mailserver is, so this will likely be:

    Code:
    MX-xx     brothersonline.nl  -->   xx.16x.2xx.xx  
    To send mail to certain hosts, gmail in particular, I probably should create a PTR record too, my DNS provider allows me to create a PTR record. so this should probably be:

    Code:
    PTR        brothersonline      -->   xx.16x.2xx.xx  
    When we're done with that, I will resume my guide.
    After I am done, how do I configure my mail-server to receive and send mail to other domains?

    I received this error everytime I tried to send a mail to damien@brothersonline.nl

    Code:
    Delivery to the following recipient failed permanently:
    
        damien@brothersonline.nl
    
    Technical details of permanent failure:
    Google tried to deliver your message, but it was rejected by the recipient domain. We recommend contacting the other email provider for further information about the cause of this error. The error that the other server returned was: 550 550 5.7.1 <damien@brothersonline.nl>... Relaying denied (state 14).
    
    ----- Original message -----
    
    Received: by 10.216.162.84 with SMTP id x62mr3805903wek.106.1296284765224;
     Fri, 28 Jan 2011 23:06:05 -0800 (PST)
    MIME-Version: 1.0
    Sender: xxxxxxxxxxxxxxxxxxx
    Received: by 10.216.23.20 with HTTP; Fri, 28 Jan 2011 23:05:45 -0800 (PST)
    From: xxxxxxxxxxxxxxxn <xxxxxxxxxxxxxxx>
    Date: Sat, 29 Jan 2011 08:05:45 +0100
    X-Google-Sender-Auth: CiqsmDbD3LQsVFZYaNHeIu2E1R4
    Message-ID: <AANLkTi=SLxhqLsBAA97n5mOUcAQWTrGfHfQ=2hcgW-a0@mail.gmail.com>
    Subject: test
    To: damien@brothersonline.nl
    Content-Type: multipart/alternative; boundary=001636458010f58022049af6d0b2
    I've also tried sending e-mails to: dxxxx@server1.brxxxxthersonline.nl and dxxxx@mail.brxxxxsonline.nl.

    I'm pretty new to this level of hosting, and I know I might be lacking some basic understanding, but I am dead in the water about now, so if anybody could give some pointers, be it explanations or just even hints, I will gladly try to follow up on them and see if it fixes my particular problem.

    Thank you kindly for any help you might be able to provide me with.
     
    Last edited: Jan 30, 2011
  2. pititis

    pititis Member

    Hello SacreBleu,

    Code:
    dig mx brothersonline.nl
    
    ; <<>> DiG 9.7.1-P2 <<>> mx brothersonline.nl
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 826
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0
    
    ;; QUESTION SECTION:
    ;brothersonline.nl.		IN	MX
    
    ;; ANSWER SECTION:
    brothersonline.nl.	11302	IN	MX	20 mx1.cyso.net.
    brothersonline.nl.	11302	IN	MX	30 mx2.cyso.net.
    
    ;; Query time: 33 msec
    ;; SERVER: 8.8.8.8#53(8.8.8.8)
    ;; WHEN: Sat Jan 29 21:59:07 2011
    ;; MSG SIZE  rcvd: 83
    
    
    I think your MX record is not set properly or dns is not updated yet
     
  3. SacreBleu

    SacreBleu New Member

    Thanks,

    Let me update those MX-records, since right now I haven't got any since I wanted to start over, although I haven't formatted the server and followed the guide to the letter, is there anything (hostname?) that I might've done wrong?

    Or could it just be the MX records not being properly updated?

    Updated my MX record it says:

    Code:
    MX-10 brothersonline.nl → mail.brothersonline.nl
    My complete DNS table:


    Code:
    A brothersonline.nl → 62.163.251.35  
    A localhost.brothersonline.nl → 127.0.0.1  
    A mail.brothersonline.nl → 62.163.251.35 
    MX-10 brothersonline.nl → mail.brothersonline.nl    
    CNAME www.brothersonline.nl → brothersonline.nl 
     
    Last edited: Jan 29, 2011
  4. pititis

    pititis Member

    Well done.

    Are your using dynamic ip???
     
  5. SacreBleu

    SacreBleu New Member

    Internally the server has a static IP, yes.

    My internet/external IP is not static but we have an unlimited lease until you reset the modem, which we do about every two years (or longer when our connection stays stable, we have a pretty reliable ISP, so that's not much of a problem.

    I created a client (myself) in ISPconfig, created a domain for e-mail (brothersonline.nl) and created an e-mail box.
    Should everything work correctly now? -- Or is there something I still need to do to send mail to outside domains?

    Checked my status with dig:


    Code:
    ; <<>> DiG 9.7.1-P2 <<>> mx brothersonline.nl
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 37816
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
    
    ;; QUESTION SECTION:
    ;brothersonline.nl.             IN      MX
    
    ;; ANSWER SECTION:
    brothersonline.nl.      86328   IN      MX      10 mail.brothersonline.nl.
    
    ;; ADDITIONAL SECTION:
    mail.brothersonline.nl. 86328   IN      A       62.163.251.35
     
    Last edited: Jan 30, 2011
  6. pititis

    pititis Member

    Yes. But dynamic ip addresses are normally blacklisted...

    Check it
     
  7. SacreBleu

    SacreBleu New Member

    How can I check, whether it is blacklisted?

    Shouldn't a PTR record, get rid of that problem?

    Used: http://www.mxtoolbox.com/
    To check for blacklist, out of many only 4 reported me as blacklisted and I could automatically remove myself from one of them.

    When I launched a SMTP scan I received the following report:

    Code:
    smtp:brothersonline.nl		    smtp    
    220 server1.brothersonline.nl ESMTP Postfix (Ubuntu)
    
    
     OK - 62.163.251.35 resolves to a251035.upc-a.chello.nl
     Warning - Reverse DNS does not match SMTP Banner
     0 seconds - Good on Connection time
     Not an open relay.
     1.217 seconds - Good on Transaction time
    
    Session Transcript:
    HELO please-read-policy.mxtoolbox.com
    250 server1.brothersonline.nl [140 ms]
    MAIL FROM: <supertool@mxtoolbox.com>
    250 2.1.0 Ok [172 ms]
    RCPT TO: <test@example.com>
    554 5.7.1 <test@example.com>: Relay access denied [140 ms]
    QUIT
    221 2.0.0 Bye [156 ms]
     
    Last edited: Jan 30, 2011
  8. pititis

    pititis Member

    Last edited: Jan 30, 2011
  9. SacreBleu

    SacreBleu New Member

    Thank you,

    I am unable to set a SPF and rDNS record in the panel I use that is provided by the DNS provider.

    I reckon I could remove this issue by hosting my own DNS server, but I am not sure whether or not I run into the same problems regarding my blacklisted IP.

    However, despite of the blacklist, shouldn't I at least be able to receive e-mail?
     
  10. pititis

    pititis Member

    No.
    If you can set cname and A records you should can set TXT records.
    Try to run new test when your will done. rdns had nothing to do with your dns control panel, it's a isp issue.
     
  11. SacreBleu

    SacreBleu New Member

    Yup, I am able to create a TXT record, but what should it say?

    PTR records seem to be the equivalent of an rDNS, so I just created one, but it could take several hours before it's updated.

    I used an online wizard, and came up with this for a SPF record:

    Code:
    v=spf1 ip4:62.163.251.35 a mx ~all
    Should be correct, no?
     
    Last edited: Jan 30, 2011
  12. pititis

    pititis Member

  13. SacreBleu

    SacreBleu New Member

    Intentional Double-post.

    Currently I've setup my DNS table like this:


    Code:
    A *.brothersonline.nl → 62.163.251.35 
    A brothersonline.nl → 62.163.251.35  
    A localhost.brothersonline.nl → 127.0.0.1  
    A mail.brothersonline.nl → 62.163.251.35 
    MX-10 brothersonline.nl → mail.brothersonline.nl 
    CNAME www.brothersonline.nl → brothersonline.nl  
    TXT brothersonline.nl → v=spf1 ip4:62.163.251.35 a mx ~all   
    PTR server1.brothersonline.nl → 62.163.251.35 
    
     
  14. pititis

    pititis Member

    Be careful with " " It must be present
     
    Last edited: Jan 30, 2011
  15. SacreBleu

    SacreBleu New Member

    Edited it, it has the quotes now.

    Reading that article, it says that PTR records are used for reverse DNS Lookup, which is what we're aiming for right?

    The A record translates my domain into an IP
    The PTR record translates my IP into my domain.

    Why wouldn't a PTR record be able to do the job?

    SUCCESS!

    I was succesful in sending an e-mail from gmail to my domain!
    Now I need to wait for the PTR record to update so I should be able to send mail from my domain to other domains.

    Issue by trying to send mail from my domain to gmail:


    Code:
    This is the mail system at host server1.brothersonline.nl.
    
    I'm sorry to have to inform you that your message could not
    be delivered to one or more recipients. It's attached below.
    
    For further assistance, please send mail to postmaster.
    
    If you do so, please include this problem report. You can
    delete your own text from the attached returned message.
    
                       The mail system
    
    <IronSight@gmail.com>: mail for brothersonline.nl loops back to myself
    Fixed the issue by updating my postfix virtual_alias_domains
     
    Last edited: Jan 30, 2011
  16. pititis

    pititis Member

    Great! See you tomorrow. Don't waste your time dude, ask your isp for rdns ok?

    Cheers!
     
  17. SacreBleu

    SacreBleu New Member

    Yeah, I'll contact them.

    Haven't been able to send any mail, though.
    Not even from one user on the domain to another:

    a@brothersonline.nl
    b@brothersonline.nl

    Tried vice-versa mail does not arrive.

    Thank you so far for helping me, you've been a great aid!
     

Share This Page