Mails from root never delivered - sent to deferred queue

Discussion in 'Installation/Configuration' started by snowweb, Mar 15, 2022.

Tags:
  1. snowweb

    snowweb Member

    I'm trying to identify why mails from the server (ie. from scripts or website contact forms hosted on the same machine) are always sent to the deferred queue.
    I've checked mail.log and syslog and can't see any reference to those emails. Please advise where I might see that?

    Many thanks!



    ISPConfig ver. 3.1dev
    Ubuntu 18.04LTS
     
    Last edited: Mar 15, 2022
  2. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    The mail log will tell you, search for the message's queue id.
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    Mails in the queue must have shown up in mail.log file as postfix logs when it moves emails to a specific queue. You should check mail.log again for errors.
     
  4. snowweb

    snowweb Member

    Hi Till and Jesse,
    Please don't get me wrong, but I searched in mail.log using the exact message ID shown in postqueue -p and it was not found. The message is still sitting in the maildrop queue and I even generated a fresh message to ensure that it hadn't rotated of the logs and used that message id too, but not found!
    I can find lines for all other messages but not those generated on the server.
    One thing I just noticed in main.cf was
    . Is that normal? According to this, no_address_mappings means
    Another thought, is whether it is being put in the correct queue? Postcat -q shows "maildrop as the queue name
    Code:
    *** HEADER EXTRACTED maildrop/944794011D3 ***
    . Is that correct?
     
  5. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Dunno there, I've never looked into ways to disable logging, if that's possible (perhaps the default log file could be set to /dev/null?). If you can't find where the logs end up, you could try setting ''debug_peer_list = 127.0.0.1' and send another test message, though I don't know if that catches locally sourced mail or only mail from tcp; beyond that you can trace processes with strace or ltrace and try to follow the stream (see postfix DEBUG_README for info).

    'receive_override_options = no_address_mappings' is set for amavis+spamassassin, it should not be set for rspamd systems.

    maildrop is a valid queue, it's likely correct. That particular message is probably to root or some other local account.
     
  6. snowweb

    snowweb Member

    I appreciate your help Jesse.
    I mentioned that both scripts sending mail and websites sending are both affected. I figure if I fix it to send the mail of my script then that will fix the websites too. So in the script it's using the mail command to send mail. It seems that maybe it's only the mail command which isn't being logged (and is getting deferred) but I can't find any config files for it. The man page mentions /etc/mail.rc. This is the contents:
    Code:
    set ask askcc append dot save crt
    ignore Received Message-Id Resent-Message-Id Status Mail-From Return-Path Via Delivered-To
    Like I said, all other mail is logged. I don't think it's disabled. I'm not sure where it is set though for the mail command. Most strange.
    The messages from the script are addressed to a proper full email address which exists and works and according to the output of postcat -q the sender is "root".
    I'll keep looking :)
     
  7. snowweb

    snowweb Member

    By the way, this is the output of postcat -q
    Code:
    root@s1:/# postcat -q 1F8EC4006C8
    *** ENVELOPE RECORDS maildrop/1F8EC4006C8 ***
    message_arrival_time: Tue Mar 15 23:11:35 2022
    named_attribute: rewrite_context=local
    sender_fullname: root
    sender: root
    *** MESSAGE CONTENTS maildrop/1F8EC4006C8 ***
    To: [email protected]
    Subject: s1.mydomain.info queue size: 1
    MIME-Version: 1.0
    Content-Type: text/plain; charset="UTF-8"
    Content-Transfer-Encoding: 8bit
    
    Mail count on s1.mydomain.info is 1
    *** HEADER EXTRACTED maildrop/1F8EC4006C8 ***
    recipient: [email protected]
    *** MESSAGE FILE END maildrop/1F8EC4006C8 ***
    
     
  8. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Try: grep 1F8EC4006C8 /var/log/*
     
  9. snowweb

    snowweb Member

    Code:
    root@s1:/# grep 1F8EC4006C8 /var/log/*
    grep: /var/log/apache2: Is a directory
    grep: /var/log/apt: Is a directory
    grep: /var/log/clamav: Is a directory
    grep: /var/log/dbconfig-common: Is a directory
    grep: /var/log/dist-upgrade: Is a directory
    grep: /var/log/installer: Is a directory
    grep: /var/log/ispconfig: Is a directory
    grep: /var/log/journal: Is a directory
    grep: /var/log/letsencrypt: Is a directory
     
  10. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    There are numerous packages which provide /usr/bin/mail alternatives; you might try running sendmail directly. Maybe 'postconf | grep -E maillog\|syslog' would provide further clues.
     
  11. snowweb

    snowweb Member

    Sendmail doesn't seem to be installed. I could try installing it. Will need to be weekend job I think.
    I ran the command you supplied:
    Code:
    root@s1:/# postconf | grep -E maillog\|syslog
    syslog_facility = mail
    syslog_name = ${multi_instance_name?{$multi_instance_name}:{postfix}}
    
    I'm not sure what to expect as output.
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    I doubt that as you seem to have postfix installed and postfix always provides a sendmail wrapper. Sendmail itself (which is a different MTA) ma not be installed as it's not compatible with ISPConfig, but the sendmail wrapper from postfix must be there. Run:

    which sendmail

    as root to test if a sendmail compatible wrapper program exists in the PATH.
     
  13. snowweb

    snowweb Member

    Ah yes. I've got it. Thanks.
    Code:
    root@s1:/# which sendmail
    /usr/sbin/sendmail
    
     
  14. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Yes, sorry, use the sendmail command, not the sendmail MTA.
     

Share This Page