MailWatch icon indicating copy to clipboard operation
MailWatch copied to clipboard

whishlist, add mailgraph option ( + solution)

Open thctlo opened this issue 6 years ago • 3 comments

Hai,

In my previous version i had mailgraph integrated in the mailwatch interface at "tools and links" Which would be nice also to add it for the public.

i'll try to integrate it myself first.

thctlo avatar Mar 12 '18 13:03 thctlo

in other.php

At 64,68d63

if (defined('MAILGRAPH') && MAILGRAPH === true) {   
     echo '<li><a href="/mailgraph/mailgraph.cgi">View MailGraph</a>';
}

in conf.php add the following at the end.

// If installed you can enable mailgraph also in the "tools and links" page.  
// Setup for Debian/Ubuntu: 
// apt-get install mailgraph rrdtool && a2enmod cgi && \
// cp /usr/share/doc/mailgraph/examples/mailgraph.conf /etc/apache2/conf-available/  && \
// sed -i '/Require local/a \ \ \ \ Require ip 192.168 172.20 10' /etc/apache2/conf-available/mailgraph.conf && \
// a2enconf mailgraph  
define('MAILGRAPH', true);  

And you have mailgraph also in you mailwatch.

! note, only tested on Debian. im assuming its the same on ubuntu. Someone needs to add the instructions for other Linux distro's.

thctlo avatar Mar 12 '18 14:03 thctlo

Hi thctlo!

apt-get install mailgraph && a2enmod cgi && \

You should apt-get rrdtool too.

/usr/share/mailgraph/default.conf is not an Apache conf file and with Debian /etc/default/mailgraph is used instead.

You also need to add the right conf in apache. We can also have a problem with apache right to access MTA log files. /etc/default/mailgraph need to be configured too.

stefaweb avatar Mar 14 '18 10:03 stefaweb

Yes, i notice that today to, thank you for adding it. change it above.

The apache config is correct : /usr/share/doc/mailgraph/examples/mailgraph.conf

Here : /etc/default/mailgraph i did not change anything the default is fine.

For the apache config, i only added the private ip ranges with the sed command.

cat /usr/share/doc/mailgraph/examples/mailgraph.conf

#mailgraph default Apache configuration

Alias /mailgraph /usr/share/mailgraph
<Directory /usr/share/mailgraph>
    Options +FollowSymLinks +ExecCGI
    AddHandler cgi-script .cgi

    Require local

</Directory>

maybe only one thing in the /etc/default/mailgraph IGNORE_LOCALHOST="false" some my want true here.

This should do it. apt-get install mailgraph rrdtool a2enmod cgi cp /usr/share/doc/mailgraph/examples/mailgraph.conf /etc/apache2/conf-available/ sed -i '/Require local/a \ \ \ \ Require ip 192.168 172.20 10' /etc/apache2/conf-available/mailgraph.conf a2enconf mailgraph

Pretty simple, thats why i've added it.

thctlo avatar Mar 14 '18 16:03 thctlo