Perfect Server setup not receiving mail

Discussion in 'Server Operation' started by mikeoc, Jun 2, 2013.

  1. mikeoc

    mikeoc New Member

    Hi all,

    First off, great site. Amazing tutorials and obviously a keen community, so pleased to meet you all.

    I have a question though, I followed the perfect server set up for ubuntu 12.04 tutorial. All is working well apart from the fact that I can't receive email from outside the server. Sending is no problem however.

    The server is ubuntu 12.04 running on linode. It's going to house a few of my personal drupal based websites as well as a couple of clients, so while the traffic is going to be low it's important that it is solid, which it seems to be apart from this issue.

    I'm feeling a bit stuck, I've installed and re-installed the server several times now over the last few days and this is the closest I've got to getting it working properly. I think I'm 90% there but need a little help.

    Quite likely I've missed something obvious, I'm no fool but I'm still rather green when it comes to this sort of thing.

    Thanks in advance,

    Mike
     
  2. monkfish

    monkfish New Member

    Hello Mike,

    Few things to check; in no particular order:-

    - do you have correct MX (mail exchanger) records pointing to the server for delivery of email? Something like http://www.mxtoolbox.com/ will help you determine whether or not your DNS is correct.

    - You have the mailbox created correctly in the ispconfig interface? Would assume so as you suggest you can send email, but worth checking.

    - what does the ispconfig monitor say? any problems with postfix? Is postfix running? what happens if you do a "service postfix restart"

    - what does /var/log/mail.log say - any errors in there? Do a "tail -f /var/log/mail.log" on the console and send yourself some email from outside, see what happens in the log.

    - Do a "postqueue -p" - is there anything queued awaiting delivery.

    - Is amavisd running? any errors there that might prevent delivery of email?

    HTH
     
  3. mikeoc

    mikeoc New Member

    Hi monkfish, thanks for the reply

    I have my suspicions that it is DNS/MX related. All that's a bit of a dark art to me still. Using that lookup tool the one thing that strikes me is this:
    Code:
    SMTP Reverse DNS Mismatch Warning - Reverse DNS does not match SMTP Banner
    I have NO idea of what that means.

    As far as I can tell the mailbox is set up as it should be.

    Postfix tells me it's running:
    postfix/postfix-script: the Postfix mail system is running: PID: 29434

    Postfix restarts without issue with no apparent change.

    ispconfig monitor gives the system a full bill of health

    The output of logs like this mean very little to me but in /var/log/mail.log I'm seeing this a lot:
    Code:
    Jun  2 06:40:01 vincam dovecot: pop3-login: Disconnected (no auth attempts): rip=127.0.0.1, lip=127.0.0.1, secured
    Jun  2 06:40:01 vincam postfix/smtpd[12169]: warning: database /var/lib/mailman/data/virtual-mailman.db is older than source file /var/lib/mailman/$
    Jun  2 06:40:01 vincam postfix/smtpd[12169]: connect from localhost[127.0.0.1]
    Jun  2 06:40:01 vincam postfix/smtpd[12169]: lost connection after CONNECT from localhost[127.0.0.1]
    Jun  2 06:40:01 vincam postfix/smtpd[12169]: disconnect from localhost[127.0.0.1]
    
    tail -f /var/log/mail.log shows this:
    Code:
    Jun  2 18:20:49 vincam dovecot: imap-login: Login: user=<user@example.com>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=32333, secured
    Jun  2 18:20:49 vincam dovecot: imap(user@example.com): Disconnected: Logged out bytes=79/687
    Jun  2 18:20:57 vincam postfix/anvil[31876]: statistics: max connection rate 1/60s for (smtp:79.170.40.91) at Jun  2 18:14:05
    Jun  2 18:20:57 vincam postfix/anvil[31876]: statistics: max connection count 1 for (smtp:79.170.40.91) at Jun  2 18:14:05
    Jun  2 18:20:57 vincam postfix/anvil[31876]: statistics: max message rate 1/60s for (smtp:79.170.40.91) at Jun  2 18:14:05
    Jun  2 18:20:57 vincam postfix/anvil[31876]: statistics: max cache size 1 at Jun  2 18:14:05
    Jun  2 18:22:14 vincam postfix/smtpd[32344]: warning: database /var/lib/mailman/data/virtual-mailman.db is older than source file /var/lib/mailman/data/virtual-mailman
    Jun  2 18:22:14 vincam postfix/smtpd[32344]: connect from mail91.extendcp.co.uk[79.170.40.91]
    Jun  2 18:22:14 vincam postfix/trivial-rewrite[32347]: warning: do not list domain example.com in BOTH virtual_mailbox_domains and relay_domains
    Jun  2 18:22:14 vincam postfix/cleanup[32351]: warning: database /var/lib/mailman/data/virtual-mailman.db is older than source file /var/lib/mailman/data/virtual-mailman
    Jun  2 18:22:14 vincam postfix/smtpd[32344]: A1C87B713: client=mail91.extendcp.co.uk[79.170.40.91]
    Jun  2 18:22:14 vincam postfix/cleanup[32351]: A1C87B713: message-id=<90C75C03-6D1F-4DE9-9851-E0580070998E@us3m.com>
    Jun  2 18:22:14 vincam postfix/qmgr[29436]: A1C87B713: from=<mike@us3m.com>, size=898, nrcpt=1 (queue active)
    Jun  2 18:22:14 vincam postfix/smtpd[32344]: disconnect from mail91.extendcp.co.uk[79.170.40.91]
    Jun  2 18:22:20 vincam postfix/smtpd[32355]: warning: database /var/lib/mailman/data/virtual-mailman.db is older than source file /var/lib/mailman/data/virtual-mailman
    Jun  2 18:22:20 vincam postfix/smtpd[32355]: connect from localhost[127.0.0.1]
    Jun  2 18:22:20 vincam postfix/trivial-rewrite[32347]: warning: do not list domain example.com in BOTH virtual_mailbox_domains and relay_domains
    Jun  2 18:22:20 vincam postfix/smtpd[32355]: 0E3FAB714: client=localhost[127.0.0.1]
    Jun  2 18:22:20 vincam postfix/cleanup[32351]: 0E3FAB714: message-id=<90C75C03-6D1F-4DE9-9851-E0580070998E@us3m.com>
    Jun  2 18:22:20 vincam postfix/qmgr[29436]: 0E3FAB714: from=<mike@us3m.com>, size=1395, nrcpt=1 (queue active)
    Jun  2 18:22:20 vincam postfix/smtpd[32355]: disconnect from localhost[127.0.0.1]
    Jun  2 18:22:20 vincam postfix/trivial-rewrite[32347]: warning: do not list domain example.com in BOTH virtual_mailbox_domains and relay_domains
    Jun  2 18:22:20 vincam amavis[3265]: (03265-15) Passed CLEAN, [79.170.40.91] [82.14.162.91] <mike@us3m.com> -> <user@example.com>, Message-ID: <90C75C03-6D1F-4DE9-9851-E0580070998E@us3m.com>, mail_id: d2odX4E3Y2X7, Hits: 0, size: 898, queued_as: 0E3FAB714, 5384 ms
    Jun  2 18:22:20 vincam postfix/smtp[32352]: A1C87B713: to=<user@example.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=5.4, delays=0.05/0.01/0/5.4, dsn=2.0.0, status=sent (250 2.0.0 from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 0E3FAB714)
    Jun  2 18:22:20 vincam postfix/qmgr[29436]: A1C87B713: removed
    Jun  2 18:22:20 vincam postfix/smtp[32356]: 0E3FAB714: to=<user@example.com>, relay=none, delay=0.02, delays=0.01/0.01/0/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=smtp type=AAAA: Host not found)
    Jun  2 18:22:20 vincam postfix/cleanup[32351]: 14B69B715: message-id=<20130602172220.14B69B715@vincam.timesaverads.co.uk>
    Jun  2 18:22:20 vincam postfix/bounce[32357]: 0E3FAB714: sender non-delivery notification: 14B69B715
    Jun  2 18:22:20 vincam postfix/qmgr[29436]: 14B69B715: from=<>, size=3465, nrcpt=1 (queue active)
    Jun  2 18:22:20 vincam postfix/qmgr[29436]: 0E3FAB714: removed
    Jun  2 18:22:20 vincam postfix/smtp[32356]: 14B69B715: to=<mike@us3m.com>, relay=mail.us3m.com[79.170.40.91]:25, delay=0.12, delays=0.01/0/0.07/0.03, dsn=2.0.0, status=sent (250 OK id=1UjBz2-0002kA-6q)
    Jun  2 18:22:20 vincam postfix/qmgr[29436]: 14B69B715: removed
    
    postqueue -p reports "Mail queue is empty"

    amavisd-new is running, can't see any errors.

    Any insights?

    Mike
     
  4. mikeoc

    mikeoc New Member

    Just to update, I resolved the issue with the reverse DNS through the Linode manager - to my servers FQDN, so that doesn't come up anymore.

    Still the issue persists though.

    When I send an email to an address on the server I get a bounce back with the error message:

    Diagnostic-Code: X-Postfix; Host or domain name not found. Name service error for name=smtp type=AAAA: Host not found.

    Does that ring any bells?

    Mike
     
  5. monkfish

    monkfish New Member

    Hi Mike,

    Nice update and responsive ISP by the sounds of it!

    I seem to recall that its only a warning by postfix that reverse name doesn't match banner name - this should not on its own stop mail being delivered.

    Its possible, although I'm certain on this, that could be a dns related issue. Check your /etc/resolv.conf see what nameservers you are using?
     
  6. mikeoc

    mikeoc New Member

    Hi again,

    /etc/resolv.conf holds this info:

    domain members.linode.com
    search members.linode.com
    nameserver 109.74.192.20
    nameserver 109.74.193.20
    nameserver 109.74.194.20

    I don't know if that's right or not, from what I've read elsewhere Linode tends to do things a little differently?

    Mike
     
  7. monkfish

    monkfish New Member

    Ok, so,

    Those name servers must be able to resolve the records that you have in your domain, otherwise it will probably fail.

    Where's your dns hosted for the domain? On your box? At your ISP?

    Try something like...

    Code:
    dig yourdomain.com @109.74.192.20 any
    or
    Code:
    dig yourdomain.com @109.74.192.20 mx
    to query all records or just the relevant mail exchanger records for what you believe is set up. If that or the other addresses don't return any information, points to a DNS issue I reckon.
    HTH
     
  8. mikeoc

    mikeoc New Member

    Hi, thanks for the quick reply.

    DNS is handled through the Linode DNS control panel, so on the box, as it were.

    The 'any' request outputs this:
    Code:
    dig example.com @109.74.192.20 any
    
    ; <<>> DiG 9.8.1-P1 <<>> example.com @109.74.192.20 any
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19484
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 8, AUTHORITY: 0, ADDITIONAL: 1
    
    ;; QUESTION SECTION:
    ;example.com.		IN	ANY
    
    ;; ANSWER SECTION:
    example.com.	3600	IN	SOA	ns1.linode.com. mike.us3m.com. 2013060268 14400 3600 1209600 3600
    example.com.	3600	IN	NS	ns1.linode.com.
    example.com.	3600	IN	NS	ns3.linode.com.
    example.com.	3600	IN	NS	ns4.linode.com.
    example.com.	3600	IN	NS	ns5.linode.com.
    example.com.	3600	IN	NS	ns2.linode.com.
    example.com.	3600	IN	MX	10 mail.example.com.
    example.com.	3600	IN	A	178.79.180.209
    
    ;; ADDITIONAL SECTION:
    mail.example.com. 3600	IN	A	178.79.180.209
    
    ;; Query time: 327 msec
    ;; SERVER: 109.74.192.20#53(109.74.192.20)
    ;; WHEN: Mon Jun  3 23:17:06 2013
    ;; MSG SIZE  rcvd: 232
    
    (I've replaced the sites domain name with example)

    The 'mx' request outputs:
    Code:
    dig example.com @109.74.192.20 mx
    
    ; <<>> DiG 9.8.1-P1 <<>> example.com @109.74.192.20 mx
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 49186
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 5, ADDITIONAL: 1
    
    ;; QUESTION SECTION:
    ;example.com.		IN	MX
    
    ;; ANSWER SECTION:
    example.com.	3600	IN	MX	10 mail.example.com.
    
    ;; AUTHORITY SECTION:
    example.com.	3600	IN	NS	ns1.linode.com.
    example.com.	3600	IN	NS	ns4.linode.com.
    example.com.	3600	IN	NS	ns3.linode.com.
    example.com.	3600	IN	NS	ns2.linode.com.
    example.com.	3600	IN	NS	ns5.linode.com.
    
    ;; ADDITIONAL SECTION:
    mail.example.com. 3600	IN	A	178.79.180.209
    
    ;; Query time: 150 msec
    ;; SERVER: 109.74.192.20#53(109.74.192.20)
    ;; WHEN: Mon Jun  3 23:17:32 2013
    ;; MSG SIZE  rcvd: 170
    
    I also did the same for the FQDN, which uses a separate domain, 'any':
    Code:
    ; <<>> DiG 9.8.1-P1 <<>> server1.mydomain.co.uk @109.74.192.20 any
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 63198
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 5, ADDITIONAL: 0
    
    ;; QUESTION SECTION:
    ;server1.mydomain.co.uk.	IN	ANY
    
    ;; ANSWER SECTION:
    server1.mydomain.co.uk. 86400 IN	A	178.79.180.209
    
    ;; AUTHORITY SECTION:
    mydomain.co.uk.	86400	IN	NS	ns2.linode.com.
    mydomain.co.uk.	86400	IN	NS	ns1.linode.com.
    mydomain.co.uk.	86400	IN	NS	ns5.linode.com.
    mydomain.co.uk.	86400	IN	NS	ns4.linode.com.
    mydomain.co.uk.	86400	IN	NS	ns3.linode.com.
    
    ;; Query time: 83 msec
    ;; SERVER: 109.74.192.20#53(109.74.192.20)
    ;; WHEN: Tue Jun  4 00:25:45 2013
    ;; MSG SIZE  rcvd: 159
    
    FQDN 'mx':
    Code:
    ; <<>> DiG 9.8.1-P1 <<>> server1.mydomain.co.uk @109.74.192.20 mx
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 24479
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
    
    ;; QUESTION SECTION:
    ;server1.mydomain.co.uk.	IN	MX
    
    ;; AUTHORITY SECTION:
    mydomain.co.uk.	86400	IN	SOA	ns1.linode.com. mike.us3m.com. 2013060114 14400 14400 1209600 86400
    
    ;; Query time: 95 msec
    ;; SERVER: 109.74.192.20#53(109.74.192.20)
    ;; WHEN: Tue Jun  4 00:27:53 2013
    ;; MSG SIZE  rcvd: 103
    I don't really understand the output of these, but I'm not seeing anything that screams out at me as a blatant error?

    Mike
     
  9. mikeoc

    mikeoc New Member

    Hi there, thought I'd give this a little bump.

    See anything out of the ordinary?

    Mike
     
  10. falko

    falko Super Moderator

    If you don't need IPv6, disable it in /etc/postfix/main.cf:

    Code:
    inet_protocols = ipv4 
     
  11. mikeoc

    mikeoc New Member

    Thanks Falko. I've given that a go but nothings changed I'm afraid.

    I'm beginning to think that it just doesn't work.
     
  12. mikeoc

    mikeoc New Member

    Hi guys, just so you know. I decided to wipe the server completely again and start from scratch.

    It felt like I was going round in circles and I'd probably start buggering something up if I kept on tinkering. So it's a case of fourth time lucky or bust.

    Pleased to say that so far, so good. ISPConfig 3 is working and the server hasn't fallen over - yet (I'll see what happens with it as I start to put it through its paces).

    More importantly, email is no longer the one sided conversation it used to be and thus is my problem here is essentially solved.

    As for what the issue was before, I still don't know. And probably never will, I've done everything down to the letter as before and this time it works - so perhaps it was just a case of something not quite installing correctly last tme around.

    Anyway, big thanks to you both.

    Mike
     

Share This Page