Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've been scratching my head for about a week to try to figure out this.
I'm running Mailscanner/Mailwatch server that filters spam for 4 domains.The server is wokring beaufitully... the only down side is that the clients would like some reports for what it's doing. I succsffuly created a Monthly Report filter for each domain and it's coming back with the results i want.
I would like to know if somebody have figured out a way to mail MailWatch reports out to clients. I tried to play with the report php code but it's not coming back with successull results.
Any help on this will be highly appreciated.
I've written a PHP script that will do the job (thanks for Linux Questions users who put me on the right path). Not quit done yet, but for right now the script will give statistics for Total message usage for the current month (Total, Clean, Spam , Virus ... etc) , Monthly average usage statistics per mailbox and daily average usage statistics per mailbox.
The part I'm stuck on is how to mail the script out ... i'm a super PHP newbie obviously ...
Last edited by waelaltaqi; 10-21-2007 at 09:24 AM.
I would be interested in your php script. Would it be possible for you to share what you already did ?
If you want to send a mail, you can just use the mail() function in php which will use the sendmail command of your box. Before it works you have to configure the php.ini file so to fill in the fields STMP, smtp_port, sendmail_from and sendmail_path.
Then what i would do is use the php linux command to execute the php script you just did. Put that command in a crontab and run it every sunday for weekly report for example.
I'm a PHP/HTML beginer. I'm more of a networking guy than a programming guru. So please feel free to point out any mistakes and feel free to use the script the way you like. I kind of got involved in managing MailScanner for many domains and i needed to some reports working; that's way i had to learn php/mysql.
I couldn't find a way to mail the ouput of the script from the script itself; i'm sure that there is a way but i didn't feel like screwing with it. i used another shell script with metasend to mail the script out. If you figure out a native PHP way of doing it, please post.
You have to change three things on the script then put it on your webserver:
1- Chance the <img> tag to your company's logo.
2- change $domain to the domain you want a report for.
3- Change the password for your root mysql account
4- point your browser to it and it will generate a report for the entire month.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.