I can't setup quota warning emails

Discussion in 'General' started by ThomasG, Sep 26, 2024.

  1. ThomasG

    ThomasG New Member

    Hi,
    I'm having trouble setting up my ispConfig to warn my users that their storage quota is low (ex: 80 or 90%).

    I have setup in Settings -> System settings -> email a SMTP relay to our mail server with a dedicated account.
    I have also enabled in Settings -> Server config -> email the options :
    Send quota warnings to admin
    Send quota warnings to reseller
    Send quota warnings to client
    And finally, all my cllients have an email configured in their profile.

    Is there something that i'm missing ?
    I did not enabled the integrated mail server in ISPConfig i i would like to avoid it if possible.
    I like to use this server only for web/DB hosting

    Thank you in advance for your help.
    Thomas
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    On my system quota at 90% causes warning e-mail to be sent, and I have not touched configuration about this. So it should work by default.
    Can that server send e-mails? Verify that first.
    Check if any log files have info on quota checking and e-mailing. I think the quota check happens and midnight.
     
  3. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    hmm. he could be right.. @ThomasG are you using ubuntu? although no idea why it would behave differently to debian.

    i have quota warnings set for admin, reseller and client. i have the admins email set in system -> main config -> mail.
    it's set to use smtp to send system mails, but only to localhost... the local postfix on the master server is configured to relay through our main mailserver.

    i know it's sending out the quota warning emails to admin, our ticketing system is getting them.
    but there's no evidence in the postfix logs that it's making any attempt to send the same quota warning email to any of the clients.

    complete log of mail sent for a quota warning on our ispconfig master server:

    Code:
    Sep 24 01:10:02 master postfix/smtpd[639986]: E8CF47F81A: client=localhost[127.0.0.1]
    Sep 24 01:10:02 master postfix/cleanup[640800]: E8CF47F81A: message-id=<skaj4q.qbref9@master>
    Sep 24 01:10:02 master postfix/smtpd[639986]: disconnect from localhost[127.0.0.1] helo=1 auth=0/1 mail=1 rcpt=1 data=1 quit=1 commands=5/6
    Sep 24 01:10:02 master postfix/qmgr[1633]: E8CF47F81A: from=<[email protected]>, size=672, nrcpt=1 (queue active)
    Sep 24 01:10:03 master postfix/smtp[640817]: E8CF47F81A: to=<[email protected]>, relay=mail-01.simplified.host[13.41.246.91]:25, delay=0.65, delays=0.04/0.04/0.24/0.33, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 510C77E020)
    Sep 24 01:10:03 master postfix/qmgr[1633]: E8CF47F81A: removed
    
    and on our main mailserver which the master server relays through...
    Code:
    Sep 24 01:10:03 mail-01 postfix/smtpd[333260]: connect from ec2-18-132-53-98.eu-west-2.compute.amazonaws.com[18.132.53.98]
    Sep 24 01:10:03 mail-01 postfix/smtpd[333260]: 510C77E020: client=ec2-18-132-53-98.eu-west-2.compute.amazonaws.com[18.132.53.98]
    Sep 24 01:10:03 mail-01 postfix/cleanup[485512]: 510C77E020: message-id=<skaj4q.qbref9@master>
    Sep 24 01:10:03 mail-01 postfix/qmgr[1792]: 510C77E020: from=<[email protected]>, size=947, nrcpt=1 (queue active)
    Sep 24 01:10:03 mail-01 postfix/smtpd[333260]: disconnect from ec2-18-132-53-98.eu-west-2.compute.amazonaws.com[18.132.53.98] ehlo=2 starttls=1 mail=1 rcpt=1 data=1 quit=1 commands=7
    Sep 24 01:10:03 mail-01 dovecot: lmtp(485631): Connect from local
    Sep 24 01:10:03 mail-01 dovecot: lmtp([email protected])<485631><Co+HJlsD8mb/aAcAPKQ46w>: sieve: msgid=<skaj4q.qbref9@master>: stored mail into mailbox 'INBOX'
    Sep 24 01:10:03 mail-01 dovecot: lmtp(485631): Disconnect from local: Logged out (state=READY)
    Sep 24 01:10:03 mail-01 postfix/lmtp[485630]: 510C77E020: to=<[email protected]>, orig_to=<[email protected]>, relay=mail-01.simplified.host[private/dovecot-lmtp], delay=0.43, delays=0.32/0.03/0.04/0.04, dsn=2.0.0, status=sent (250 2.0.0 <[email protected]> Co+HJlsD8mb/aAcAPKQ46w Saved)
    Sep 24 01:10:03 mail-01 postfix/qmgr[1792]: 510C77E020: removed
    
    as you can see, message is sent to admin email only.
    yet all servers are configured to warn admin,reseller and client...
     

    Attached Files:

  4. ThomasG

    ThomasG New Member

    Thank you for your answer.
    I'm using debian12 on this machine and on our previous server is was working perfectly.
    The server can indeed send email i added a bash script on the system :

    #!/bin/sh
    PERCENT=$1
    USER=$2

    cat << EOF | /usr/sbin/sendmail $USER
    Subject: Avertissement : quota de boîte mail atteint $PERCENT%
    From:[email protected]

    Bonjour,

    Votre boîte mail est actuellement remplie à $PERCENT%. Veuillez supprimer des messages anciens ou inutiles pour éviter des interruption>

    Merci.

    EOF

    And i did indeed received the email, without all the necessary security of course. but i saw it arrive.
    I set it up so there is no mail server installed but it's using our mail server (external) as our smtp server.

    Is there a way to force a test ? i did try to fill one of our webhosting but it didn't have any effects. If there is a script like that that i can call with some parameters that would be perfect for my diagnosis.
     
  5. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    if you've got a user that's over quota, you could try
    Code:
    php /url/local/ispconfig/server/cron_debug.php --cronjob=300-quota_notify.inc.php
    
    i don't know if that will actually trigger sending notification emails, or will just simply check the quota's but do nothing about them.
    after all, when debugging something like this, you probably don't want to end up spamming a client with warning emails...
     
  6. ThomasG

    ThomasG New Member

    I found out what was wrong. Postfix wasn't configured. What is weird is that i don't understand the point to have a configuration in the server settings then.
    My clients are still not receiving their emails but i have more clues.
    When i'm looking at the mail.log file i can see that ispconfig sends the emails to [email protected] instead of sending them to the ones configured in the customer tab. There for all my users i've entered the corresponding email.

    2024-10-01T14:00:01.338920+02:00 myserver postfix/qmgr[1625449]: 4238320437: removed
    2024-10-01T14:00:01.341775+02:00 myserver postfix/cleanup[1679531]: 51B5B2037F: message-id=<[email protected]>
    2024-10-01T14:00:01.396502+02:00 myserver postfix/qmgr[1625449]: 51B5B2037F: from=<[email protected]>, size=2248, nrcpt=1 (queue active)
    2024-10-01T14:00:01.396941+02:00 myserver postfix/pickup[1687128]: 60DFD20437: uid=5056 from=<[email protected]>
    2024-10-01T14:00:01.401941+02:00 myserver postfix/local[1688730]: 51B5B2037F: to=<[email protected]>, orig_to=<web117>, relay=local, delay=0.25, delays=0.24/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox)

    Thank you for your help.
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    Then you must have deactivated mail server configuration in the auto-installer, or when you installed manually you left out the steps to install the mail system.

    ISPConfig uses virtual mail users, not Linux system users like web123. maybe you had a different control panel installed before or you indeed left out the whole mail system configuration, which means mail can not work then.
     
  8. ThomasG

    ThomasG New Member

    Ok, i understand now that this configuration is only valid if i have the mail server setup.

    Yes i did intentionally left out the mail server out of the installation because we have our own. I would like to use our mail server as a relay for these messages using the users defined in the user account tab. Is that possible without having to install and setup the mail server ?
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    You can not use any functions of the ISPConfig email module when you have no mail setup in place. What should likely still work is that you set a global relay server under System > server config mail. Not sure what you mean with user account tab. If you choose not to install a mail system in ISPConfig, then all you get is a bare postfix server for local mail delivery without any configuration.
     
  10. ThomasG

    ThomasG New Member

    The service postfix is installed, i have set it up in this way:

    > /etc/postfix/main.cf
    [...
    smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
    myhostname = myserver.mydomain.com
    alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
    alias_database = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
    myorigin = /etc/mailname
    mydestination = myserver.mydomain.com, localhost, localhost.localdomain
    relayhost = [smtp.mydomain.com]:587 #my mail server
    mynetworks = 127.0.0.0/8 [::1]/128
    mailbox_size_limit = 0
    smtp_use_tls = yes
    smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
    ...]

    I have setup in /etc/postfix/sasl_passwd
    [smtp.mydomain.com]:587 [email protected]:mypassword

    then i ran : postmap /etc/postfix/sasl_passwd

    edit: i also send an email with this command : echo "Test Postfix Gmail https://mydomain.com" | mail -s "Postfix Gmail" mypersonnalemail@gmail.com and it worked perfectly

    I also configured the relay like you said in the ISPConfig GUI (see screenshot 2024-10-02_11-07.png)

    I mean this tab : (see screenshot 2024-10-02_11-10.png)

    I don't think that there is a lot missing for it to work.
     

    Attached Files:

    Last edited: Oct 2, 2024

Share This Page