Mail quota warnings issue

Discussion in 'General' started by Ovidiu, Nov 2, 2015.

  1. Ovidiu

    Ovidiu Active Member

    Running latest ISPCFG3 on Debian8

    So in the server configs I have checked:
    Send quota warnings to client
    Send quota warnings to admin

    I grep the mail log files and see both emails have been sent out.

    BUT
    the sender seems to be my Gmail address and not the usual ISPCFG3 sender.
    Neither I nor the client have received this email.

    Is there any AUTh going on here or does ISPCFG3 simply set my Gmail address as sender?
    Where does ISPCFG3 get this email address from which it uses as sender? I mean its mine but where would I replace it...


    ###edit###
    I have foudn the ticket where it was implemented: http://bugtracker.ispconfig.org/index.php?do=details&task_id=2203
     
    Last edited: Nov 2, 2015
  2. Ovidiu

    Ovidiu Active Member

    @Priya Sharma:
    ahm, I have a problem and several questions, what are you talking about?
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    @Ovidiu: The message you responded to was spam :)
     
  4. Ovidiu

    Ovidiu Active Member

    Anyone able to shed some light onto this?
    I see the cron job ran and apparently sent out those emails but they never arrived.
    Any feedback highly welcome!

    This is the log part but these emails never arrive:
    Code:
    Nov  3 00:30:02 h2118175 dovecot: pop3-login: Disconnected (no auth attempts in
    0 secs): user=<>, rip=127.0.0.1, lip=127.0.0.1, secured, session=<EKZzUZYjwQB/AA
    AB>
    mail() on [/usr/local/ispconfig/server/cron_daily.php:694]: To: [email protected]
    -- Headers: MIME-Version: 1.0 Content-type: text/plain; charset=utf-8 Content-T
    ransfer-Encoding: 8bit From: [email protected] Reply-To: [email protected] Subject
    : Mailbox quota notification  The mailbox [email protected] is near or over quot
    a.  Mailbox:                    [email protected] Name:
    test Used space:                        982.7813 KB Quota:
            1 MB Usage ratio:                       95.97%
    mail() on [/usr/local/ispconfig/server/cron_daily.php:694]: To: [email protected] -- Headers: MIME-Version: 1.0 Content-type: text/plain; charset=utf
    -8 Content-Transfer-Encoding: 8bit From:[email protected] Reply-To:
    [email protected]
    Subject: Mailbox quota notification  The mailbox [email protected] is near
    or over quota.  Mailbox:                        [email protected] Name:
                    test Used space:                        982.7813 KB Quota:
                            1 MB Usage ratio:                       95.97%
    
     
    Last edited: Nov 3, 2015
  5. Jesse Norell

    Jesse Norell Active Member

    check your mail log (eg. /var/log/mail.log) and see what it says
     
  6. Ovidiu

    Ovidiu Active Member

    ahm, as I said above: that is an excerpt from my mail.log
     
  7. Jesse Norell

    Jesse Norell Active Member

  8. Ovidiu

    Ovidiu Active Member

    yes, exactly. the rest of my logs looks like they always do except they are interrupted by these 2 weird looking ones. I did a grep, that is how I found these two occurrences in the first place :)

    You can test it yourself, setup a client, check the box that says send notifications about quotas, create a 1mb mailbox, send enough emails to fill it, wait for the next day and check your mail logs.

    Code:
    (3:1026)# grep -i 'helpdesk' /var/log/mail.*
    /var/log/mail.log.1:mail() on [/usr/local/ispconfig/server/cron_daily.php:694]: To: [email protected] -- Headers: MIME-Version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: [email protected] Reply-To: [email protected] Subject: Mailbox quota notification  The mailbox [email protected] is near or over quota.  Mailbox:                      [email protected] Name:                         test Used space:                        982.7813 KB Quota:                              1 MB Usage ratio:   95.97%
     
  9. Jesse Norell

    Jesse Norell Active Member

    That's not written by syslog (eg. no leading time stamp); almost like php mail() is writing debug output directly to mail.log. Check your php.ini, you don't have mail.log set to /var/log/mail.log by chance?
    Code:
    >> excerpt from /etc/php5/cli/php.ini <<
    
    ; The path to a log file that will log all mail() calls. Log entries include
    ; the full path of the script, line number, To address and headers.
    ;mail.log =
    ; Log mail to syslog (Event Log on Windows).
    ;mail.log = syslog
     
  10. Ovidiu

    Ovidiu Active Member

    well spotted, thank you so much!
    Code:
    mail.log = /var/log/mail.log
    is inside
    but if I didn't have that, I wouldn't have caught this problem :)
    Now that we know this, the problem remains why the emails never arrive and how can I change the sender.
     
  11. Jesse Norell

    Jesse Norell Active Member

    maybe set mail.log = syslog, then see what gets logged? (perhaps php's debug message was wiping out a message syslog had already written or ?)

    You could write a simple php script to test sending mail from so you don't have to wait for a nightly cronjob, and make sure it works.
     
  12. Ovidiu

    Ovidiu Active Member

    could you please expand upon: "You could write a simple php script to test sending mail from so you don't have to wait for a nightly cronjob, and make sure it works."
     
  13. Jesse Norell

    Jesse Norell Active Member

    Use something like this to test that php can send mail from the commandline:
    PHP:
    #!/usr/bin/php
    <?php

    $to
    =[email protected]';
    $from=$to;
    $subject='test message';

    $message="
    This is a test message.
    If you got this, php is sending mail from the command line.

    message from: 
    $from
    message to: 
    $to

    "
    ;

    $headers "From: $from";

    mail($to$subject$message$headers);
    ?>
    If it sends, the problem is specific to ispconfig. If it doesn't, troubleshoot until it does (look at php.ini settings, check syslog and php mail.log debug messages, etc.).
     
  14. Ovidiu

    Ovidiu Active Member

    That worked but I'm not surprised, after all all hosted websites can send emails via contact forms and the likes and that works through php cli too, right?

    Anyway, I sent a message without modifying this line
    mail.log = /var/log/mail.log
    and surprisingly, inside mail.log I saw "proper" logging happening, not like the above output produced by ISPCFG3

    weird. Thanks for the assistance so far, I'll see what I can figure out on my own.
     
  15. Jesse Norell

    Jesse Norell Active Member

    for php's mail.log setting, just point it to something else, say /var/log/php-mail.log
     

Share This Page