Koozali.org: home of the SME Server

[help] Qmail queue management (mail didn't send)

Offline Cruiser23

  • *
  • 8
  • +0/-0
[help] Qmail queue management (mail didn't send)
« on: June 05, 2017, 07:53:36 AM »
Good day,

Sir/Ma'am in our qmail lots of email are permanently stay in their, unless we delete them.
I decided to open a topic to ask on how to trace the cause of those emails.
Please guide me if this have been asked before, I tried to google/search here but no result for me.

I think one of the cause was when an email accounts in to/cc reach quotas, other than that we don't have any idea why those email didn't send.

Thank you in advance for helping and please understand that I'm just an amateur on SME Server.

Offline Daniel B.

  • *
  • 1,700
  • +0/-0
    • Firewall Services, la sécurité des réseaux
Re: [help] Qmail queue management (mail didn't send)
« Reply #1 on: June 05, 2017, 09:11:48 AM »
Are the email in queue for local or remote delivery ? Please show:

Code: [Select]
find /var/qmail/queue/remote | wc -l
find /var/qmail/queue/local | wc -l

Alos show some sample of logs from /var/log/qmail/current
C'est la fin du monde !!! :lol:

Offline Cruiser23

  • *
  • 8
  • +0/-0
Re: [help] Qmail queue management (mail didn't send)
« Reply #2 on: June 05, 2017, 11:07:38 AM »
Good day,

Sir Daniel here are the results:

find /var/qmail/queue/remote | wc -l
33
find /var/qmail/queue/local | wc -l
24

Sir I didn't use current logs of qmail but I used the previous which one email didn't send:

2017-06-02 13:28:40.884058500 new msg 34473035
2017-06-02 13:28:40.884084500 info msg 34473035: bytes 26054 from <our.user@ourDomain.Com> qp 11486 uid 453
2017-06-02 13:28:40.885411500 starting delivery 9235: msg 34473035 to remote someone@clientDomain.com
2017-06-02 13:28:40.885418500 status: local 0/20 remote 1/20
2017-06-02 13:29:00.907096500 delivery 9235: deferral: CNAME_lookup_failed_temporarily._(#4.4.3)/
2017-06-02 13:29:00.907128500 status: local 0/20 remote 0/20




And sqpsmtpd logs for that email


2017-06-02 13:28:39.063409500 11478 Accepted connection 0/200 from 192.168.1.1 / pc-00001.ourDomain.Com
2017-06-02 13:28:39.063536500 11478 Connection from pc-00001.ourDomain.Com [192.168.1.1]
2017-06-02 13:28:39.406301500 11478 (connect) tls: pass, connect via SMTPS
2017-06-02 13:28:40.407827500 11478 (connect) earlytalker: pass, not spontaneous
2017-06-02 13:28:40.408727500 11478 (connect) relay: 192.168.1.1 in norelayclients
2017-06-02 13:28:40.408750500 11478 (connect) relay: fail, disabled by norelayclients
2017-06-02 13:28:40.409874500 11478 220 mail.ourDomain.Com ESMTP
2017-06-02 13:28:40.542672500 11478 dispatching EHLO [192.168.10.53]
2017-06-02 13:28:40.544095500 11478 (ehlo) helo: pass
2017-06-02 13:28:40.544988500 11478 250-ourDomain.Com Hi pc-00001.ourDomain.Com [192.168.1.1]
2017-06-02 13:28:40.544990500 11478 250-PIPELINING
2017-06-02 13:28:40.545013500 11478 250-8BITMIME
2017-06-02 13:28:40.545060500 11478 250-SIZE 35000000
2017-06-02 13:28:40.545073500 11478 250 AUTH PLAIN LOGIN
2017-06-02 13:28:40.591154500 11478 dispatching AUTH PLAIN <hidden credentials>
2017-06-02 13:28:40.593446500 11478 (auth-plain) auth::auth_cvm_unix_local: pass: authentication for: our.user
2017-06-02 13:28:40.593654500 11478 235 PLAIN authentication successful for our.user - auth success for our.user
2017-06-02 13:28:40.639007500 11478 dispatching MAIL FROM:<our.user@ourDomain.Com>
2017-06-02 13:28:40.640064500 11478 (mail) naughty: pass
2017-06-02 13:28:40.640209500 11478 (mail) badmailfrom: skip, relay client
2017-06-02 13:28:40.640416500 11478 250 <our.user@ourDomain.Com>, sender OK - how exciting to get mail from you!
2017-06-02 13:28:40.684914500 11478 dispatching RCPT TO:<someone@clientDomain.com>
2017-06-02 13:28:40.685490500 11478 (rcpt) badrcptto: skip, relay client
2017-06-02 13:28:40.685710500 11478 (rcpt) rcpt_ok: skip, relay client
2017-06-02 13:28:40.685903500 11478 250 <someone@clientDomain.com>, recipient ok
2017-06-02 13:28:40.729103500 11478 dispatching DATA
2017-06-02 13:28:40.729466500 11478 354 go ahead
2017-06-02 13:28:40.741364500 11478 spooling message to disk
2017-06-02 13:28:40.784850500 11478 (data_post_headers) dkim: pass, we signed the message
2017-06-02 13:28:40.794329500 11478 (data_post) bogus_bounce: pass, not a null sender
2017-06-02 13:28:40.794413500 11478 (data_post) headers: skip, relay client
2017-06-02 13:28:40.794479500 11478 (data_post) naughty: pass
2017-06-02 13:28:40.872655500 11478 (data_post) virus::clamdscan: pass, clean
2017-06-02 13:28:40.873854500 11478 (queue) logging::logterse: ` 192.168.1.1   pc-00001.ourDomain.Com   [192.168.10.53]   <our.user@ourDomain.Com>   <someone@clientDomain.com>   queued      <455FC95A-F0E5-4160-9575-145387FE7202@ourDomain.Com>   
2017-06-02 13:28:40.877087500 11486 (queue) queue::qmail_2dqueue: (for 11478) Queuing to /var/qmail/bin/qmail-queue
2017-06-02 13:28:40.884843500 11478 250 Queued! 1496381320 qp 11486 <455FC95A-F0E5-4160-9575-145387FE7202@ourDomain.Com>
2017-06-02 13:29:22.179261500 11670 Accepted connection 1/200 from 192.168.1.1 / pc-00001.ourDomain.Com
2017-06-02 13:29:22.179360500 11670 Connection from pc-00001.ourDomain.Com [192.168.1.1]
2017-06-02 13:29:22.731750500 11670 (connect) tls: pass, connect via SMTPS
2017-06-02 13:29:23.733328500 11670 (connect) earlytalker: pass, not spontaneous
2017-06-02 13:29:23.734209500 11670 (connect) relay: 192.168.1.1 in norelayclients
2017-06-02 13:29:23.734234500 11670 (connect) relay: fail, disabled by norelayclients
2017-06-02 13:29:23.735367500 11670 220 mail.ourDomain.Com ESMTP
2017-06-02 13:29:23.964198500 11670 dispatching EHLO [192.168.10.53]
2017-06-02 13:29:23.965891500 11670 (ehlo) helo: pass
2017-06-02 13:29:23.966769500 11670 250-ourDomain.Com Hi pc-00001.ourDomain.Com [192.168.1.1]
2017-06-02 13:29:23.966771500 11670 250-PIPELINING
2017-06-02 13:29:23.966795500 11670 250-8BITMIME
2017-06-02 13:29:23.966844500 11670 250-SIZE 35000000
2017-06-02 13:29:23.966858500 11670 250 AUTH PLAIN LOGIN
2017-06-02 13:29:24.014147500 11670 dispatching AUTH PLAIN <hidden credentials>
2017-06-02 13:29:24.016396500 11670 (auth-plain) auth::auth_cvm_unix_local: pass: authentication for: our.user
2017-06-02 13:29:24.016604500 11670 235 PLAIN authentication successful for our.user - auth success for our.user
2017-06-02 13:29:24.024081500 11670 dispatching QUIT
2017-06-02 13:29:24.024247500 11670 221 ourDomain.Com closing connection. Have a wonderful day.
2017-06-02 13:29:24.024343500 11670 click, disconnecting
2017-06-02 13:29:24.169598500 2602 cleaning up after 11670
2017-06-02 13:29:40.888995500 11478 dispatching QUIT
2017-06-02 13:29:40.889381500 11478 221 ourDomain.Com closing connection. Have a wonderful day.
2017-06-02 13:29:40.889614500 11478 click, disconnecting
2017-06-02 13:29:41.188776500 2602 cleaning up after 11478


Offline Daniel B.

  • *
  • 1,700
  • +0/-0
    • Firewall Services, la sécurité des réseaux
Re: [help] Qmail queue management (mail didn't send)
« Reply #3 on: June 05, 2017, 11:09:37 AM »
Unfortunatly, you have obfuscated the output, so I can't check further. But, you're trying to send emails to clientDomain.com, which MX server can't be resolved by your SME Server. That's why emails to this domain stay in queue until qmail gives up (which is after 7 days)
C'est la fin du monde !!! :lol:

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: [help] Qmail queue management (mail didn't send)
« Reply #4 on: June 07, 2017, 04:51:01 PM »
If you tell us the real domain name of the message recipients, we can investigate why your system is not able to deliver the messages to its server.

It might be related to this issue - we need to know the domain name to investigate further:

https://bugs.contribs.org/show_bug.cgi?id=8362

Offline Cruiser23

  • *
  • 8
  • +0/-0
Re: [help] Qmail queue management (mail didn't send)
« Reply #5 on: June 08, 2017, 03:16:35 AM »
Good day,

Sir Daniel my apologies if the output is obfuscated I though it was enough/completed for the transaction of email.
Do you need the whole output?

Sir CharlieBrady our FQDN is mail.ddtkonstract.com, email is firstname.lastname@ddtkonstract.com (sample only).

One of the email retain in our qmail is the administrator sending about DMARC.

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: [help] Qmail queue management (mail didn't send)
« Reply #6 on: June 08, 2017, 05:22:29 AM »
It's not your domain we need to diagnose the problem. It's the domain of the people you are trying to send to, when the messages get stuck in the queue.

Offline Cruiser23

  • *
  • 8
  • +0/-0
Re: [help] Qmail queue management (mail didn't send)
« Reply #7 on: June 08, 2017, 05:59:48 AM »
Good day,

Sorry about that Sir CharlieBrady here are the domain/emails:
   1. @dataland.com
   2. @iwmiph.com
   3. @mrciglobal.com.

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: [help] Qmail queue management (mail didn't send)
« Reply #8 on: June 08, 2017, 03:46:23 PM »
Good day,

Sorry about that Sir CharlieBrady here are the domain/emails:
   1. @dataland.com
   2. @iwmiph.com
   3. @mrciglobal.com.

Just looking at the first one, dataland.com seems to have some strange dns problem. This tool can't find any name server records:

https://mxtoolbox.com/SuperTool.aspx?action=dns%3adataland.com&run=toolpage#

SME server finds the delegations at the .com name servers, but the name servers themselves don't respond.

-bash-3.00$ dig ns dataland.com.

; <<>> DiG 9.2.4 <<>> ns dataland.com.
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 17255
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;dataland.com.         IN   NS

;; ANSWER SECTION:
dataland.com.      172797   IN   NS   ns1.p11.dynect.net.
dataland.com.      172797   IN   NS   ns3.p11.dynect.net.
dataland.com.      172797   IN   NS   ns2.p11.dynect.net.
dataland.com.      172797   IN   NS   ns4.p11.dynect.net.

;; Query time: 3033 msec
;; SERVER: 192.168.1.10#53(192.168.1.10)
;; WHEN: Thu Jun  8 09:41:30 2017
;; MSG SIZE  rcvd: 116

-bash-3.00$ dig soa dataland.com.

; <<>> DiG 9.2.4 <<>> soa dataland.com.
;; global options:  printcmd
;; connection timed out; no servers could be reached
-bash-3.00$ dig @ns4.p11.dynect.net.
-bash-3.00$ host ns4.p11.dynect.net.
ns4.p11.dynect.net has address 204.13.251.11
-bash-3.00$ dig @ns4.p11.dynect.net. ns dataland.com.

; <<>> DiG 9.2.4 <<>> @ns4.p11.dynect.net. ns dataland.com.
; (1 server found)
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 33797
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;dataland.com.         IN   NS

;; Query time: 26 msec
;; SERVER: 204.13.251.11#53(204.13.251.11)
;; WHEN: Thu Jun  8 09:43:44 2017
;; MSG SIZE  rcvd: 30

-bash-3.00$

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: [help] Qmail queue management (mail didn't send)
« Reply #9 on: June 08, 2017, 03:48:40 PM »
I don't see a problem with iwmiph.com - are you sure that it is showing a CNAME lookup problem? I don't see a problem with mrciglobal.com either.

Offline Cruiser23

  • *
  • 8
  • +0/-0
Re: [help] Qmail queue management (mail didn't send)
« Reply #10 on: June 09, 2017, 02:53:29 AM »
Good day,

Sir CharlieBrady my apologies, actually I don't know if CNAME is the cause of problem. The only thing for sure is our user's are having problem when sending to iwmiph.com. We found in qmail (Qmail queue management (remote)) the message stay in their.

Offline Cruiser23

  • *
  • 8
  • +0/-0
Re: [help] Qmail queue management (mail didn't send)
« Reply #11 on: June 23, 2017, 08:55:14 AM »
Good day,

Sir can you check this?
In our logs:
2017-06-02 13:28:40.685490500 11478 (rcpt) badrcptto: skip, relay client
2017-06-02 13:28:40.685710500 11478 (rcpt) rcpt_ok: skip, relay client
And found this bugs https://bugs.contribs.org/show_bug.cgi?id=9460 .

The bug said their smeserver-qpsmtpd used version "smeserver-qpsmtpd-2.6.0-27.el7.sme.noarch"
But we used smeserver-qpsmtpd-2.4.0-37.el6.sme.noarch version.
Our server used outdated smeserver-qpsmtpd?. Upon using "yum check-update" their is no update regarding smeserver-qpsmtpd.