how to read the mail.log file via web interface

Discussion in 'General' started by voltron81, Mar 26, 2010.

  1. voltron81

    voltron81 New Member

    Good morning all,
    I'm using ISPConfig and it's working perfectly.
    In the monitor section there is a possibility to read the mail.log file, but just few lines.
    I know that I can read it via command line... anyway there is a way to read it with a web interface? Maybe searching for keywords...

    Any suggestions?
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    No, as the ispconfig interface can not read the whole log directly. And reading in the whole log file into the ispconfig database continiously uses too much space in the database.
  3. voltron81

    voltron81 New Member

    Hi till,
    I understand the problem...
    Anyway do you have an external product that I can install in the system, so that I'll be able to read the log file with a web interface?

  4. falko

    falko Super Moderator ISPConfig Developer

    Maybe with Webmin, but please note that you should use Webmin only for reading the logs because otherwise it might interfere with ISPConfig.
  5. voltron81

    voltron81 New Member

    Hi falko,
    that's why I'm scarie to install webmin just to read the log.

    I was thinking there was other programs that with a web interface was giving me the opportunity to read the log... :confused:
  6. yoplait

    yoplait Member

    Can't you try to do a little script to make an html file with a cron job ?
  7. voltron81

    voltron81 New Member

    Hi yoplait,
    unfortunately I don't think I'll be able to do it...
    I'll think about it anyway... but I was thinking that there was already a solution at this problem...
  8. yoplait

    yoplait Member

    I'm really not a good "scripter", but, I think about a thing like :
    echo "<html> <head><title> My mail logs </title></head>" > $INDEX_FILE
    tail -n 1000 /var/log/mail.log >> $INDEX_FILE
    echo "</html>" >> $INDEX_FILE
    chown userweb:groupweb $INDEX_FILE
    But it could be really better !! :p

    edit :
    after that, you have to put a cronjob as you want to launch it.
  9. voltron81

    voltron81 New Member

    Hi to everybody.
    I'm still looking to find a solution to this issue... Anybody can give me an hand?

    The webmin installation could be a solution, but sounds like a bit dangerous to try on a live server...

    Thanks a lot
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    I check my logs always on the shell. have you considered to do it on the shell as well, its quite easy.

    1) Connect to your server with a terminal client like putty.

    2) To view the logs, use the command tail:


    show the last 100 lines:

    tail -n 100 /var/log/mail.log

    Show all new lines continiously:

    tail -f /var/log/mail.log

    (to quit this, press [ctrl] + c)

    If you like to find lines for a specific recipient, use e.g.:

    grep [email protected] /var/log/mail.log
  11. voltron81

    voltron81 New Member

    Hi Till,
    generally I'm doing it with a shell.
    But could happen that I'm not in the office and some of my collegue have to read a log file... and they are not really familiar with linux and command lines.

    That's why for me it's nice to find a web oriented solution to read logs.
    Before that I made the new mailserver with ISPConfig 3, they was using another mailserver with webmin and there was the feature to read the log file with web interface...


Share This Page