# Simple Mail Admin (analogue postfixadmin)



## ProFTP (Jul 19, 2009)

Simple Mail Admin

*About*:
Simplemail Admin facilitates management of virtual domains in Exim, Postfix, and other mail servers. It allows the user to analyze and search in logs. 

(analogue postfixadmin)

(Ð£Ð¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ðµ Ð²Ð¸Ñ€Ñ‚ÑƒÐ°Ð»ÑŒÐ½Ñ‹Ð¼Ð¸ Ð´Ð¾Ð¼ÐµÐ½Ð°Ð¼Ð¸ postfix/exim/etc)

*Download:*

ftp://ftp.lissyara.su/users/ProFTP/simplemailadmin-1.0.tar.gz
ftp://ftp.lissyara.su/users/ProFTP/simplemailadmin-1.0.zip
ftp://ftp.lissyara.su/users/ProFTP/simplemailadmin-1.0.7z



*demo:*
http://unixforum.org.ua/simplemail/index.pl



```
useradmin: Admin
    pass: Jeinahm7
```


```
user: postfix
    pass Ub6oyig7f
```


*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 
...........


   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
```
 

*   FreeBSD:*

```
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 simplemailadmin-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';
```
 

  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. If will not begin to work ask, all other questions,
   development of existent and additional possibilities, etc:

http://unixforum.org.ua/index.php?topic=17604.0


```
[b]config.pl[/b]

[b]
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;
[/b]
```
*screenshots*:

ftp://ftp.lissyara.su/users/ProFTP


----------



## DutchDaemon (Jul 20, 2009)

> for the page conclusion of information
> Ð£Ð¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ðµ Ð²Ð¸Ñ€Ñ‚ÑƒÐ°Ð»ÑŒÐ½Ñ‹Ð¼Ð¸ Ð´Ð¾Ð¼ÐµÐ½Ð°Ð¼Ð¸
> Ravines in real time (search to on by him /var/log/maillog)
> HTML a code goes separately from scripts
> ...



Sorry, this is all total gibberish. Please post this stuff in correct, understandable English (and only English), or this thread will be deleted.


----------



## ProFTP (Jul 25, 2009)

why did nobody comment?
that there to add? who what did want, what wishes?
or is it necessary nobody?


----------



## DutchDaemon (Jul 25, 2009)

Nobody understands your English. The first post is unreadable, your post above is unreadable. Again: if it stays that way, this thread will be deleted.


----------



## ProFTP (Jul 25, 2009)

and what then to translate?

translate.google.com is it better it will be to translate?


----------



## DutchDaemon (Jul 25, 2009)

All translation software sucks, the web-based ones even more. It can only be used for short messages, like "Where is the train station?" (the translation software will likely produce "The station of the trains, where is it to be at?"). I'm afraid there's no better translation option than good old professional education or a language course. Participating in these forums will be almost impossible without a decent grasp of the English language.


----------



## ProFTP (Jul 25, 2009)

and how many will it occupy time? 5 years?


----------



## DutchDaemon (Jul 25, 2009)

Five years (secondary school education level) sounds about right for learning a decent amount of English, yes. Aren't there any Ukrainian or Russian forums focusing on BSD somewhere?


----------



## ProFTP (Jul 25, 2009)

and is there a method quickly to learn a language? in  CSS (Control of State Security) USSR employees could learn any foreign language for 21 day!


----------



## DutchDaemon (Jul 25, 2009)

Well, those were happy days, I'm sure, and it's certainly done the USSR a lot of good. Good luck in finding a language course near you. I'm sure it's possible.

Thread closed.


----------



## DutchDaemon (Jul 27, 2009)

http://bsdportal.ru/index.php


----------

