Quota warning only to admin, not client

Discussion in 'ISPConfig 3 Priority Support' started by chico11mbit, Oct 7, 2021.

  1. chico11mbit

    chico11mbit Member HowtoForge Supporter

    Hi,
    I get only a quota Warning to the admin email address. No email is been sent to the mailbox owner email account.
    is this the normal behaviour?
    ubuntu 20.05 with newest ispconfig.

    "Send quota warnings to admin" and
    "Send quota warnings to client" is activated..

    It is a migrated installation, migrated with the migration tool.
     
  2. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    There are some settings for how email is sent (server, authentication, etc) that might resolve that. Check your logs and you can probably find the reason it's not sending.
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    This has no influence on these functions.

    The email address of the client is set in the client settings, this can be but it does not has to be identical with the mailbox owner.
     
  4. chico11mbit

    chico11mbit Member HowtoForge Supporter

    Hmm, in syslog is only the notification that the mail was send to the email account of the admin. No evidence there that an error occurred when notify the client.
    Yepp. The client email address there is right, but no client email was send. Only to serveradmin. I controlled the mail.log perhaps a login error from localhost?
    The following login error is not initiated from the "ping" to postfix which comes every minute from ispconfig. This comes at another time in this minute 00:04...

    Code:
    Oct  7 00:04:31 server30 postfix/smtpd[1755497]: connect from localhost.localdomain[127.0.0.1]
    Oct  7 00:04:33 server30 postfix/smtpd[1755497]: warning: localhost.localdomain[127.0.0.1]: SASL LOGIN authentication failed: XXXXXXXXXXXXXX
    Oct  7 00:04:33 server30 postfix/smtpd[1755497]: 2A25911400EB: client=localhost.localdomain[127.0.0.1]
    Oct  7 00:04:33 server30 postfix/cleanup[1893797]: 2A25911400EB: message-id=<[email protected]>
    Oct  7 00:04:33 server30 postfix/qmgr[1456213]: 2A25911400EB: from=<[email protected]>, size=779, nrcpt=1 (queue active)
    Oct  7 00:04:33 server30 postfix/smtpd[1755497]: disconnect from localhost.localdomain[127.0.0.1] helo=1 auth=0/1 mail=1 rcpt=1 data=1 quit=1 commands=5/6
    Oct  7 00:04:33 server30 dovecot: lmtp(1893800): Connect from local
    Oct  7 00:04:33 server30 dovecot: lmtp([email protected])<1893800><ldTkLnEdXmGo5RwAPb9E2w>: sieve: msgid=<[email protected]>: stored mail into mailbox 'INBOX'
    Oct  7 00:04:33 server30 dovecot: lmtp(1893800): Disconnect from local: Client has quit the connection (state=READY)
    Oct  7 00:04:33 server30 postfix/lmtp[1893798]: 2A25911400EB: to=<[email protected]>, relay=server30.ADMINDOMAIN.COM[private/dovecot-lmtp], delay=0.63, delays=0.61/0.01/0.01/0.01, dsn=2.0.0, status=sent (250 2.0.0 <[email protected]> ldTkLnEdXmGo5RwAPb9E2w Saved)
    Oct  7 00:04:33 server30 postfix/qmgr[1456213]: 2A25911400EB: removed
     
  5. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    So sasl authentication failed, but the ISPConfig mail sender doesn't recognize or handle that, and continues on with the SMTP conversation, completing a valid, though unauthenticated, smtp session. Off the top of my head I don't know how frequently the client would get notified, if it's daily or once a week or ??; I presume that if there were no logs related to the client's email address, there was no attempt to send email to them.

    My guess is the issue comes down to setting the right values for sending mail under Main Config > Mail. I don't get those as the admin (because it's configured not to send them), but I infer that they are sent to clients, as I see a bounce on occasion.

    If needed to troubleshoot further, I'd probably enable server debug mode (both in the ui and $conf['log_priority'] = 0; in /usr/local/ispconfig/server/lib/config.inc.php), find and run the notification cron job manually (looks like it's server/lib/classes/cron.d/300-quota_notify.inc.php). You'll probably need to delete the sys_cron entry in the dbispconfig database so that it runs again (ie. "delete from sys_cron where name = 'cronjob_quota_notify'").
     
  6. chico11mbit

    chico11mbit Member HowtoForge Supporter

    How to run 300-quota_notify.inc.php manually?
    And what is the terminal code to delete the sys_cron entry?
    Sorry for my dumb questions.
     
  7. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Note, it should follow the 'Send quota warning each X days' setting in Server Config, so you might set that to 1 for your testing (and only test once per day?), or clear out the web_domain.last_quota_notification field for the test domain each time you test the cron job.
     
  8. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    I believe
    Code:
    php /usr/local/ispconfig/server/cron_debug.php --cronjob=300-quota_notify.inc.php
    The sql statement is above, run it via phpmyadmin or mysql command line util. Alternately in phpmyadmin you could navigate the sys_cron table and delete the row there.
     
  9. chico11mbit

    chico11mbit Member HowtoForge Supporter

    I set the debug level in $conf['log_priority'] = 0
    I set the debug level in ISPconfig Gui
    I ran "delete from sys_cron where name = 'cronjob_quota_notify'" (I checked that this entry was deleted)

    Result:

    This is the output in terminal
    Code:
    [email protected]:/usr/local/ispconfig/server/lib/classes/cron.d# php /usr/local/ispconfig/server/cron_debug.php --cronjob=300-quota_notify.inc.php
    Called run() for class cronjob_quota_notify
    Job has schedule: 0 0 * * *
    Called onPrepare() for class cronjob_quota_notify
    Called onBeforeRun() for class cronjob_quota_notify
    Jobs next run is 2021-10-8 0:0:0
    Date compare of 1633644000 and 1633621077 is -1
    Called onRun() for class cronjob_quota_notify
    Called onAfterRun() for class cronjob_quota_notify
    Called onCompleted() for class cronjob_quota_notify
    finished cron debug.
    In the ISPConfig GUI System Log:
    Code:
    2021-10-07 17:54    server   Debug    Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_cron_lock  
    2021-10-07 17:54    server   Debug    Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock  
    2021-10-07 17:54    server  Debug    Calling function 'check_phpini_changes' from plugin 'webserver_plugin' raised by action 'server_plugins_loaded'.
    Got no email. Not for admin nor for client.
     
    Last edited: Oct 7, 2021
  10. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    What do you have for 'Send quota warning each X days'? You might clear the web_domain.last_quota_notification field or set it to an 'old enough' time to ensure mail is sent. If you're sure it sent (eg. because admin got a copy), I don't see any errors in your output there, so might have to do more debugging.

    I still suspect that adjusting the mail related settings should get mail to go, but if that doesn't resolve things, you could try adding some debugging lines to see more indepth what's going on, eg. in server/lib/classes/cron.d/300-quota_notify.inc.php, in the send_notification_email() function in server/lib/classes/monitor_tools.inc.php or the mail() function in server/lib/classes/system.inc.php. Eg. print out when an email is sent and to who, or when it was decided not to send an email and why.
     

Share This Page