advantages:
1) for the page conclusion of information
2) possibility addition a few domains to the users
3) Ravines in real time (search to on by him /var/log/maillog)
4) extended mode of management users
5) HTML a code goes separately from scripts
6) objective the oriented programming, more flexible possibility of integration and use
failings:
1) it is not vacation (it will be)
2) It is not Fetchmail
...........
Download:
ftp://ftp.lissyara.su/users/ProFTP/simp ... 1.0.tar.gz
ftp://ftp.lissyara.su/users/ProFTP/simp ... in-1.0.zip
ftp://ftp.lissyara.su/users/ProFTP/simp ... min-1.0.7z
Код: Выделить всё
Postfix / exim / etc,
Apache 1.3.27 / etc,
Perl (tested 5.8.8),
MySQL, SQLite, etc (tested MySQL 5.0.67)
Modules from perl:
use HTML::Template;
use Data::Validate::Domain;
use Data::Validate::Email;
use DBI;
use DBD::MySQL;
IO::Socket;
use File::Pid;
etc
cd /usr/ports/databases/p5-DBD-mysql50/ && make && make install clean
(or /usr/ports/databases/p5-DBD-mysql51/)
(or *)
cd /usr/ports/www/p5-HTML-Template && make && make install clean
cd /usr/ports/dns/p5-Data-Validate-Domain && make && make install clean
cd /usr/ports/mail/p5-Data-Validate-Email && make && make install clean
cd /usr/ports/devel/p5-File-Pid && make && make install clean
etc
It is needed to influence postfix/exim for work with virtual domains,
tuning practically identical as in postfixadmin
http://high5.net/howto/
http://sys-adm.org.ua/mail/mail-howto-p1.php
http://www.lissyara.su/?id=1015
http://google.com
Patch md5crypt cyrus-sasl:
cyrus-sasl-2.1.22_md5patch_dist.rar: http://unixforum.org.ua
Simple tuning apache:
AddHandler cgi-script .cgi .pl
DirectoryIndex index.pl
<Directory /usr/local/www/simplemail>
Options Indexes FollowSymLinks ExecCGI
</Directory>
(configuration can will differ)
1. Extract files
tar -zxvf simplemail-0.1.tgz
2. We look and place rights for access if not correctly proposed
$ cd /usr/local/www/simplemail
$ chmod 640 *.pl *.ht*
$ cd /usr/local/www/simplemail/scripts/
$ chmod 640 *.pl .ht*
$ cd /usr/local/www/simplemail/lib/
$ chmod 640 *.pl .ht* *.pm
$ cd /usr/local/www/simplemail/templates/
$ chmod 640 *.css *.html
$ cd /usr/local/www/simplemail/templates/images
$ chmod 640 *.gif *.png
$ cd /usr/local/www/simplemail
$ chmod 750 index.pl
$ chown www:www index.pl
(or Suexes user which works)
$ cd /usr/local/www/simplemail/scripts
$ chmod 700 maillog.pl
$ chown root:wheel maillog.pl
3. Creation of base and user
through phpmysql or in :
$ mysql -u root -p
> use mysql
> CREATE DATABASE IF NOT EXISTS mail_db;
> GRANT ALL PRIVILEGES on mail_db.* to mail@localhost IDENTIFIED BY 'pass_mail_mysql';
or
# DB mail_db
> USE mysql;
> INSERT INTO `user` (`Host`, `User`, `Password`)
> VALUES ('localhost','mail',password('exim'));
> INSERT INTO `db` (`Host`, `Db`, `User`, `Select_priv`)
> VALUES ('localhost','mail_db','mail','Y');
> FLUSH PRIVILEGES;
> GRANT USAGE ON exim.* TO mail@localhost;
> GRANT CREATE, SELECT, INSERT, DELETE, UPDATE ON mail_db.* TO mail@localhost;
> CREATE DATABASE `mail_db`;
> USE `mail_db`;
4. Configuration and placing of ways
(if way not /usr/local/www/simplemail/lib/config.pl
it is needed to specify
$ ee maillog.pl
require "/home/...../simplemail/lib/config.pl";
)
look /lib/config.pl for configuring
enter information of MySQL, etc
5. Install table, users
# chmod 750 install.pl
$./install.pl passwd_admin
argument of passwd_admin the real password which will be used Admin,
farther we pass on http://mydomain.tld/,
if will not begin to work look that not so
NOTE: in the table of users necessarily there must be two lines with Guest and Admin,
they must be created after the script of install.pl
6. Crontab
*/2 * * * * root /usr/local/www/simplemail/scripts/maillog.pl
(If you start first time and if a log file (/var/log/maillog) is very large,
it is recommended to start with began with the cantilever of maillog.pl then to add in crontab)
7. Delete install.pl
$ rm install.pl
8. If will not begin to work ask, all other questions,
development of existent and additional possibilities, etc:
http://unixforum.org.ua
http://unixforum.org.ua/index.php?topic=17604.0
=============================================
=============================================
Код: Выделить всё
use CGI::Carp qw(fatalsToBrowser);
%{$se} = (
# DB
'db_name' => 'db',
# user from db
'db_user' => '',
'db_pass' => '',
'db_type' => 'mysql',
'db_host' => 'localhost',
# Way to the templates, by default primary way,
# if you will change a way to to by templates, write a complete way
# or 'dirt' => 'template/',
'dirt' => '../template/',
# url
# 'url' => 'http://domain.ltd',
# Maildir
'maildir' => '/var/spool/mail/',
#maillog file
'maillog' => '/var/log/maillog',
# User from which works transport of mta
'transport_user' => 'virtual',
# How many to destroy lines on a page
'line_from_page' => '30', # 1, or 1000++
# Time of life of cookies for an administrator and user.
# For an administrator with the purpose of safety of cookies not active, you can change
# +30s 30 seconds from now
# +10m ten minutes from now
# +1h one hour from now
# -1d yesterday (i.e. "ASAP!")
# now immediately
# +3M in three months
# +10y in ten years time
# Thursday, 25-Apr-1999 00:40:33 GMT at the indicated time & date
'time_cookie_admin' => '', # +14d - 14 day, '' - Disable
'time_cookie_users' => '+14d', # +14d - 14 day, '' - Disable
# To include viewing of statistics of dens
'active_logsm' => '1', # 1 - Enable, 0 - Disable
# A number of dens is in a table, old records on expiration of time will be remote
'time_which_active_logsm' => '604800', # sec (7 day)
# to look over the ravines of postal server
'active_logmta' => '1', # 1 - Enable, 0 - Disable
#Number of lines in a table, which are written down with file ravine.
#For the loaded servers can plenty of lines.
'time_which_active_logmta' => '23000', # max line online
#type of storage of passwords.
# '0' - clean text
# 'md5crypt' - md5crypt
'type_passwd' => 'md5crypt', # 'md5crypt' or '0'
# The maximal is long password (6-9 is recommended)
'max_long_passwd' => '3', # '2', '10' ...
#maximal number of the entered not correct passwords
'max_error_login' => '5',
# time in the flow of which is blocked input of password
'max_error_login_time' => '1800', # max time bad passwd 30min
#cashing of templates, for a fast-acting
'blind_cache' => '1', # 1 - Enable, 0 - Disable
# smtp_server
'smtp_server' => 'localhost', # (recommended 'localhost')
# mailbox which official reports leave from (Can absent '')
'mail_from' => '', # '' - no email from, exemple: 'no_repley@mydomain.com'
'text_new_mailbox' => 'Welcome to your new account'
);
#unless (defined($se->{'url'})) { $se->{'url'} ='http://'.$ENV{'SERVER_NAME'}.'/index.pl';}
1;
http://unixforum.org.ua/index.php?topic=17604.0
http://forum.lissyara.su/viewtopic.php?f=20&t=12348


