Debian 12 mailx not working.

Discussion in 'ISPConfig 3 Priority Support' started by pvanthony, Sep 12, 2023.

  1. pvanthony

    pvanthony Active Member HowtoForge Supporter

  2. pyte

    pyte Well-Known Member HowtoForge Supporter

    Is the mail even arriving at the destination when sending it with the mail command?
    Can you test it like this:
    Code:
    echo "Test Mail Body" | mail -s "Subject Test" [email protected]
     
  3. pvanthony

    pvanthony Active Member HowtoForge Supporter

    Just tried the the following.
    Code:
    echo "Test Mail Body" | mail -s "Subject Test" [email protected]
    Unfortunately did not receive the email.
    Checked postfix logs and there is no activity from mail. Seems like mail is not contacting postfix
    Is there some setting like altenative smtp to be setup? Or connect mail to postfix?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    No.

    You should at least either get an error in postfix mail.log or from mail command if it fails.
     
  5. pyte

    pyte Well-Known Member HowtoForge Supporter

    Can you try using the sendmail binary directly?

    Code:
    /usr/sbin/sendmail [email protected]
    To: [email protected]
    From: [email protected]
    Subject: Test Mail
    Test
    (CTRL + D to send)
    Be aware that in the maillog the from is the username with which you are logged in to the box and the domain is the hostname so for example
    [email protected] or [email protected].

    You will see something like this from the sending side:

    Code:
    Sep 13 10:54:28 mail01 postfix/pickup[3923452]: E9935E0102: uid=1000 from=<username>
    Sep 13 10:54:28 mail01 postfix/cleanup[3972660]: E9935E0102: message-id=<[email protected]>
    
     
  6. pvanthony

    pvanthony Active Member HowtoForge Supporter

    Unfortunately no error.
    Did the following.
    1. deleted all in the mail queue. (still setting up so no important emails)
    2. did "mail -s Testing [email protected]"
    3. the email appears in the mailq
    4. postfix is not picking it up. It just stays in the mailq
    5. used thunderbird to send email using smtp and it works.
    seems like a postfix config issue with local mail.
    Anything I can check in the config?
     
  7. pvanthony

    pvanthony Active Member HowtoForge Supporter

    Tried with sendmail as mentioned, the email gets into the mailq but postfix does not pickup.
    Could it be some service is not up?
    When trying to flush the mailq, got the following error.
    # postfix flush
    postqueue: fatal: Cannot flush mail queue - mail system is down
     
  8. pvanthony

    pvanthony Active Member HowtoForge Supporter

    I think this is the problem. Not sure if it is the correct thing to do.
    In the /etc/postfix/master.cf the pickup line is commented out.
    Code:
    #628       inet  n       -       y       -       -       qmqpd
    pickup    unix  n       -       y       60      1       pickup <--------- this one
    cleanup   unix  n       -       y       -       0       cleanup
    qmgr      unix  n       -       n       300     1       qmgr
    #qmgr     unix  n       -       n       300     1       oqmgr
    tlsmgr    unix  -       -       y       1000?   1       tlsmgr
    rewrite   unix  -       -       y       -       -       trivial-rewrite
    bounce    unix  -       -       y       -       0       bounce
    defer     unix  -       -       y       -       0       bounce
    trace     unix  -       -       y       -       0       bounce
    verify    unix  -       -       y       -       1       verify
    flush     unix  n       -       y       1000?   0       flush
    proxymap  unix  -       -       n       -       -       proxymap
    proxywrite unix -       -       n       -       1       proxymap
    smtp      unix  -       -       y       -       -       smtp
    
    
    Commentated it and it seems to be working.
    Safe to do that?
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Pickup should be enabled, and it is enabled by default in Debian 12 when you install Debian from official Debian 12 install media. Most likely, the person who built your Debian base image must have disabled it manually.
     
  10. pyte

    pyte Well-Known Member HowtoForge Supporter

    As you see in my example log, when sending with the mail command you need pickup to be enabled for it to work properly.
     
  11. pvanthony

    pvanthony Active Member HowtoForge Supporter

    Thank you both for helping to solve this.
    I do appreciate it very much.
     
    pyte likes this.

Share This Page