Mail that does not arrive: reading the logs and finding where it stops

Jack Green, from accounting, calls: a customer (customer-one.test) swears they wrote to invoices@johnsmith.test two days ago, and there is nothing in the mailbox. Other times the trouble is on the…

Situation

Jack Green, from accounting, calls: a customer (customer-one.test) swears they wrote to invoices@johnsmith.test two days ago, and there is nothing in the mailbox. Other times the trouble is on the other side: Julia Brown sent a quote to the customer and the customer never saw it.

A message that “does not arrive” may have stopped at seven different points, and each one leaves a trace in a precise place of the console. Follow the message’s path and at each stage look at one thing only; stop at the first one that does not add up.

For incoming mail the stages are:

  1. does the sender know where to deliver? (the public DNS: MX record);
  2. is the appliance’s port 25 reachable from the internet? (firewall and publishing);
  3. is the mail service running? (Status);
  4. does the server accept the sender? (Mail → Logs);
  5. did the antispam filter reject or mark it? (Filters and lists);
  6. can the recipient’s mailbox receive? (quota, delivery, forwarding);
  7. did the message arrive but end up in another folder or in a rule’s sorting?

For outgoing mail the stages are the last two sections of this scenario.

What you need

  • A console administrator account (lwhite).
  • From the sender (or the recipient): the exact address of the sender and the recipient, the approximate time and, if there is one, the error message the sender received back. The text of a bounce is worth more than any guess: 550 5.1.1 user unknown, 552 mailbox full, Host or domain name not found and the like already tell you which stage to look at.
  • For tests from outside, a PC outside the LAN (a phone on mobile data is enough).

Steps

1. Does the sender know where to deliver? (the MX record)

  1. Open Mail → Domains and select johnsmith.test.
  2. Press «Check again» and wait for the check to finish («Checked at <time>»).
  3. Look at the MX section («MX servers»): it must list the appliance’s internet name (in the example atlas.johnsmith.test). If instead it says «The domain has no MX records: senders fall back to its A record, if any.» or shows a server that is not yours, the world is delivering elsewhere (or nowhere). The MX record is fixed in the domain’s public DNS, at the provider: Atlas does not edit it.
  4. If the panel says «The check could not be completed.» or «Cannot be checked», the public DNS did not answer: retry in a few minutes, before drawing conclusions.

A domain with the right MX but a single recipient who does not receive is not a DNS problem: go to stage 4.

2. Is port 25 reachable from the internet?

  1. Open Network → Local firewall, «Services» block: the «Mail» row (tcp 25, 465, 587, 993) must be on with «Reachable from» «Anywhere». If port 25 is closed or limited to «LAN and VPN sites», no external server can deliver. After every change press «Apply» and, within 60 seconds, «Keep changes» (see Network).
  2. In the example company Argos sits in front of the appliance, and it must forward port 25 to 10.20.0.2: the path is checked in its console (Argos manual, chapter “Publications”). A port published on the router but closed on the local firewall, or vice versa, gives the same symptom: the senders cannot connect and after a few days they give up.
  3. Test from outside: from a PC outside the LAN (not from the site’s network) open a connection to port 25 of atlas.johnsmith.test (telnet atlas.johnsmith.test 25, or Test-NetConnection atlas.johnsmith.test -Port 25 in PowerShell). If it answers with a 220 banner, the port is there. Many providers block port 25 outbound from home lines: if the test fails only from your phone, repeat it from another carrier.

3. Is the mail service running?

  1. Open System → Status. In the «Services» panel look for «SMTP» (Postfix), «IMAP» (Dovecot) and «antispam» (Rspamd): they must have the «Uptime» column with a plausible time. A service restarted a few minutes ago is a clue: someone restarted it, or it went down.
  2. In the «Mail server» panel there are two hourly charts: «Traffic 24h» (Received, Delivered, Forwarded) and «Anomalies 24h» (Deferred, Bounced, Rejected). A «Received» chart flat for hours with the other services alive points to a closed port (stage 2); a peak of «Deferred» points to a destination that does not answer or a full mailbox (stage 6).
  3. The «Disk» panel shows the «Email» volume. With a disk at 100% mail is not delivered: see the example in System.

4. Does the server accept the sender?

  1. Open Mail → Logs and choose the «Rejected senders» view. It lists the mail refused in the last 24 hours “because the sender domain, or the name the sending server introduced itself with (HELO), failed validation”.

  2. Search for the customer’s domain, customer-one.test. If it appears, the reason column says one of these four things:

    • «Domain not found»: the domain the sender writes in the envelope does not exist in the DNS;
    • «Not fully-qualified»: the sender’s address is not a complete address;
    • «HELO name not found» or «HELO name not fully-qualified»: the sender’s server introduces itself with a name that does not exist (typical of small servers or badly configured management software).
  3. You have two ways. If it is the customer’s mistake, give them the fix (a correct DNS, a complete HELO name): it is the right solution and leaves nothing pending. If the customer cannot fix it (it is management software you cannot touch), press «Add to Always accepted senders» on the row and confirm. The question reminds you what it means: mail that declares that domain will be accepted without checks, even if forged, and the spam score does not change.

  4. If customer-one.test does not appear, the mail was not refused for this reason: go to stage 5.

Tip The text of a bounce with “Sender address rejected: Domain not found” is exactly this refusal: the customer reads it in the error message that their server sends back.

5. Did the antispam filter reject or mark it?

  1. Open Mail → Filters and lists and select «Recent messages». In the search type the sender’s domain or address (customer-one.test) or the recipient’s (invoices@johnsmith.test): the search covers senders, recipients, subjects, IPs and verdicts.

  2. If you find the message, look at the verdict label:

    Label What happened What to do
    «Delivered» The filter let it through The problem is later: stages 6 and 7
    «Marked as spam» It was delivered to the «Junk» folder Look there; if it is a trusted sender, «Trust the sender’s domain»
    «Subject marked» It was delivered with a tag in the subject As above
    «Refused» The filter rejected it: the sender received an error Look at the symbols that affected the score; see the scenario Too much spam
    «Delayed» or «Deferred» The filter asked the sender to retry later Normally solves itself at the next attempt

    A «Delayed» message from a sender not seen recently is not a fault: the filter defers messages scoring 3 or more from senders not seen in the last day, to skim off burst spam. The sender retries (normally within a few minutes or hours) and the message goes through. If the sender does not retry, its server is badly configured.

  3. If the sender is trusted and you want to stop delaying it, add its domain to «No delivery delay» in Filters and lists («Add entry» item, «Domain» field).

  4. Also check the block lists: «Refused connections» and «Refused addresses» for the IP address of the customer’s server, «Refused senders» for their domain. An entry there discards the message before any trace exists in the «Recent messages». Delete the entry with the «Remove» icon if it is wrong (the SMTP service restarts for a few seconds).

  5. If the message does not appear anywhere in stages 4 and 5, it probably never reached the server: go back to stages 1–3 (MX, port 25, service) and ask the sender for the bounce.

6. Can the recipient’s mailbox receive?

The message is «Delivered» but Jack does not see it, or the filter accepted it and Postfix cannot deposit it. Open Active Directory → Users, select jgreen, and check the «Features» block:

  1. «Mail storage»: the mailbox quota (5120 MB in the example). A full mailbox refuses mail: the sender receives a mailbox-full error (the exact text is decided by the server). In System → Status, «Mailboxes» panel, Jack’s mailbox is at 100% (red bar from 90%). Solution: empty it, or raise the value and press «Save».
  2. «Mail delivery»: if it is off, mail is not deposited in the mailbox (this is deliberate for mailboxes that forward). In «Contacts», «Mail forwarding» must have at least one address, otherwise the message is lost. Turn it back on and save.
  3. «Mailbox access»: if it is off, Jack cannot read mail with the webmail or a program, but mail keeps arriving. If Jack says “I can’t see it”, check this too.
  4. «Mail forwarding»: if it is filled in, a copy or the original goes elsewhere; if the forwarding recipient does not exist, the message bounces or stays in the queue.
  5. Mail rules (automatic reply, filters): the «Mail rules (automatic reply, filters)» button in the detail’s bar opens the rules (Groupware is required). A filter that moves the messages of customer-one.test to a subfolder or deletes them is a frequent cause of “it didn’t arrive”. Rules are not applied to messages that the antispam moves to «Junk».
  6. Does the address exist? invoices@johnsmith.test is the address of a group or an alternate email: in Groups check the «Email» and that the members have an address; in Users, the «Alternate emails». An address that does not exist gives the sender an unknown-recipient refusal.
  1. Have Jack search for the sender in all the folders of the webmail (Tools → Mail, see Groupware): «Inbox», «Junk», «Archive», «Trash». A message in «Junk» has the verdict «Marked as spam» in stage 5.

Outgoing mail: it does not reach the customer

If Julia is the one sending and the customer does not receive, the scheme changes.

  1. The daily limit. Open Mail → Logs, «Traffic» view and look at «Per-user daily sending»: if jbrown’s bar is full (250 / 250), the server refuses further sends until tomorrow. The limit is raised in the user’s page, «Mail sending limit» field (0 the default, -1 unlimited). Each recipient beyond the first counts 0.2.
  2. Is sending enabled? In the user’s page the «Sending mail» switch must be on.
  3. The recipient server’s refusals. In the «Traffic» view look at the totals «Bounced», «Deferred», «Held» and «Discarded»: a surge of «Deferred» points to a recipient server that does not answer (the message stays in the queue and Postfix retries); a surge of «Bounced» means the recipient refused. The «Top recipients» and «Top sending hosts» lists help to find out who.
  4. The sender’s authentication. If the big providers (Gmail, Microsoft) refuse or put it in spam, open Mail → Domains, the domain, and check SPF, DKIM, DMARC and the «PTR» panel: “Gmail and Microsoft refuse the mail” without reverse DNS. The fixes are in the chapter Mail and in the scenario A second mail domain.
  5. The relay. If the mail leaves through a provider relay (System → Settings → Mail server, «SMTP relay»), check «Relay host», «Relay port», the encryption and the credentials: an expired relay password blocks everything outbound and the messages pile up as «Held».

For the technician The per-message log is Postfix’s. From the shell (System → Shell, as root): journalctl -u edon-postfix -n 200 --no-pager, filtered by address with grep (for example on invoices@johnsmith.test). Every line has the final status: status=sent (delivered), deferred (will retry), bounced (bounced) or reject (refused at reception). The antispam log is journalctl -u edon-rspamd and the mailbox’s is journalctl -u edon-dovecot. The service names are those of appendix Files, services and commands.

Check

  • The customer resends the message: in Mail → Filters and lists → Recent messages it appears with the «Delivered» label and Jack finds it in «Inbox».
  • In Mail → Logs → Traffic the «Received» and «Delivered» totals go up by one.
  • If the cause was port 25 or the MX, test again from an external account to info@ and invoices@: both arrive.
  • If the cause was an entry in the lists, the list no longer contains it; if it was a quota, the «Mailboxes» bar is under 90%.

If something goes wrong

Symptom Likely cause Remedy
Nothing in «Recent messages» or in «Rejected senders» The message never reached the server Stages 1–3: MX, port 25, service
Amber label «Filter service not running» Rspamd stopped System → Status, restart «antispam»; the messages stay queued
The message is «Delivered» but not in the mailbox Mail rules, forwarding, «Mail delivery» off Stage 6
«Mail server is not configured yet. Complete the mail setup first.» Mail not installed or not configured System → Modules
The list of refusals is empty but the sender has an error The refusal is not for domain or HELO Look at «Recent messages» (filter) and the IP lists
After a change to the lists mail is “delayed” for a few seconds The SMTP service restarts Wait: the senders retry
Only one recipient does not receive, and the customer writes to everyone That mailbox is full or the forwarding is wrong Stage 6

Limits

  • Mail → Logs covers the last 24 hours. For something that happened two days ago the refusals by domain are no longer there; what remains are the «Recent messages» (as long as the filter keeps them) and Postfix’s log from the shell.
  • The console has no search for a single message in the traffic: the «Traffic» view has the totals and the rankings, not the list of messages. To follow a specific message you use «Recent messages» and, from the shell, Postfix’s log.
  • The console does not repair the public DNS or the router in front of the appliance.
LET’S TALK INFRASTRUCTURE

Control starts with a conversation.

Tell us about your infrastructure. Let’s start with what you actually need.

Talk to an engineer