SOURCECODEBD.NET

Live Experience

Home

Webmail Squirrelmail

[root@www ~]# yum -y install squirrelmail
[root@www ~]# cd /usr/share/squirrelmail/plugins/
[root@www plugins]# wget http://www.squirrelmail.org/plugins/compatibility-2.0.14-1.0.tar.gz
[root@www plugins]# wget http://www.squirrelmail.org/plugins/empty_trash-1.4-1.2.2.tar.gz
[root@www plugins]# wget http://www.squirrelmail.org/plugins/secure_login-1.4-1.2.8.tar.gz
[root@www plugins]# tar zxvf compatibility-2.0.14-1.0.tar.gz
[root@www plugins]# tar zxvf empty_trash-1.4-1.2.2.tar.gz
[root@www plugins]# tar zxvf secure_login-1.4-1.2.8.tar.gz
[root@www plugins]# rm -f *.tar.gz
[root@www plugins]# cd
[root@www ~]# /usr/share/squirrelmail/config/conf.pl   # run config script


SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Main Menu --
1. Organization Preferences
2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books
7. Message of the Day (MOTD)
8. Plugins
9. Database
10. Languages
 
D. Set pre-defined settings for specific IMAP servers
 
C Turn color off
S Save data
Q Quit
 
Command >>1
 
# select

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Organization Preferences
1. Organization Name  : SquirrelMail
2. Organization Logo  : ../images/sm_logo.png
3. Org. Logo Width/Height : (308/111)
4. Organization Title  : SquirrelMail $version
5. Signout Page   :
6. Top Frame   : _top
7. Provider link  : http://www.squirrelmail.org/
8. Provider name  : SquirrelMail

R Return to Main Menu
C Turn color off
S Save data
Q Quit
 
Command >>5
 
# select
 
When users click the Sign Out button they will be logged out and
then sent to signout_page. If signout_page is left empty,
(hit space and then return) they will be taken, as normal,
to the default and rather sparse SquirrelMail signout page.
 
[]:/webmail
  
# change

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Organization Preferences
1. Organization Name   : SquirrelMail
2. Organization Logo   : ../images/sm_logo.png
3. Org. Logo Width/Height  : (308/111)
4. Organization Title   : SquirrelMail $version
5. Signout Page    : /webmail
6. Top Frame    : _top
7. Provider link   : http://www.squirrelmail.org/
8. Provider name   : SquirrelMail
 
R Return to Main Menu
C Turn color off
S Save data
Q Quit
 
Command >>r
 
# back

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Main Menu --
1. Organization Preferences
2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books
7. Message of the Day (MOTD)
8. Plugins
9. Database
10. Languages
 
D. Set pre-defined settings for specific IMAP servers
 
C Turn color off
S Save data
Q Quit
 
Command >>2
 
# select

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings
 
General
-------
1. Domain    : localhost
2. Invert Time    : false
3. Sendmail or SMTP   : Sendmail

A. Update IMAP Settings   : localhost:143 (uw)
B. Change Sendmail Config  : /usr/sbin/sendmail
 
R Return to Main Menu
C Turn color off
S Save data
Q Quit
 
Command >>1
 
# change domain name

 
The domain name is the suffix at the end of all email addresses. If
for example, your email address is This email address is being protected from spambots. You need JavaScript enabled to view it. , then your domain
would be example.com.
 
[localhost]:sourcecodebd.net   # input domain name

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings
 
General
-------
1. Domain   : server-linux.info
2. Invert Time   : false
3. Sendmail or SMTP  : Sendmail

A. Update IMAP Settings  : localhost:143 (uw)
B. Change Sendmail Config : /usr/sbin/sendmail

R Return to Main Menu
C Turn color off
S Save data
Q Quit
 
Command >>3
 
# select

 
You now need to choose the method that you will use for sending
messages in SquirrelMail. You can either connect to an SMTP server
or use sendmail directly.
 
1. Sendmail
2. SMTP
Your choice [1/2] [1]:2
 
# change to SMTP

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings
 
General
-------
1. Domain   : sourcecodebd.net
2. Invert Time   : false
3. Sendmail or SMTP  : SMTP

A. Update IMAP Settings  : localhost:143 (uw)
B. Change Sendmail Config : localhost:25

R Return to Main Menu
C Turn color off
S Save data
Q Quit
 
Command >>A
 
# select

 
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings
 
General
-------
1. Domain   : server-linux.info
2. Invert Time   : false
3. Sendmail or SMTP  : SMTP
 
IMAP Settings
--------------
4. IMAP Server   : localhost
5. IMAP Port   : 143
6. Authentication type  : login
7. Secure IMAP (TLS)  : false
8. Server software  : uw
9. Delimiter   : /
 
B. Update SMTP Settings  : localhost:25
H. Hide IMAP Server Settings
 
R Return to Main Menu
C Turn color off
S Save data
Q Quit
 
Command >>4
 
# select

 
This is the hostname where your IMAP server can be contacted.
[localhost]:mail.sourcecodebd.net
 
# specify your IMAP server

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings
 
General
-------
1. Domain  : server-linux.info
2. Invert Time  : false
3. Sendmail or SMTP : SMTP
 
IMAP Settings
--------------
4. IMAP Server  : mail.sourcecodebd.net
5. IMAP Port  : 143
6. Authentication type : login
7. Secure IMAP (TLS) : false
8. Server software : uw
9. Delimiter  : /
 
B. Update SMTP Settings : localhost:25
H. Hide IMAP Server Settings
 
R Return to Main Menu
C Turn color off
S Save data
Q Quit
 
Command >>8
 
# select

 
Each IMAP server has its own quirks. As much as we tried to stick
to standards, it doesn't help much if the IMAP server doesn't follow
the same principles. We have made some work-arounds for some of
these servers. If you would like to use them, please select your
IMAP server. If you do not wish to use these work-arounds, you can
set this to "other", and none will be used.
bincimap  = Binc IMAP server   
courier   = Courier IMAP server
cyrus     = Cyrus IMAP server
dovecot   = Dovecot Secure IMAP server
exchange  = Microsoft Exchange IMAP server
hmailserver  = hMailServer
macosx   = Mac OS X Mailserver
mercury32   = Mercury/32
uw       = University of Washington's IMAP server
other    = Not one of the above servers

[uw]:  dovecot
 
# select dovecot

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings
 
General
-------
1. Domain   : sourcecodebd.net
2. Invert Time   : false
3. Sendmail or SMTP  : SMTP
 
IMAP Settings
--------------
4. IMAP Server   : mail.sourcecodebd.net
5. IMAP Port   : 143
6. Authentication type  : login
7. Secure IMAP (TLS)  : false
8. Server software  : other
9. Delimiter   : /
 
B. Update SMTP Settings  : localhost:25
H. Hide IMAP Server Settings
 
R Return to Main Menu
C Turn color off
S Save data
Q Quit
 
Command >>9
 
# select

 
This is the delimiter that your IMAP server uses to distinguish between
folders. For example, Cyrus uses '.' as the delimiter and a complete
folder would look like 'INBOX.Friends.Bob', while UW uses '/' and would
look like 'INBOX/Friends/Bob'. Normally this should be left at 'detect'
but if you are sure you know what delimiter your server uses, you can
specify it here.
 
To have it autodetect the delimiter, set it to 'detect'.
 
[/]:detect
 
# detect

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings
 
General
-------
1. Domain   : server-linux.info
2. Invert Time   : false
3. Sendmail or SMTP  : SMTP
 
IMAP Settings
--------------
4. IMAP Server   : mail.sourcecodebd.net
5. IMAP Port   : 143
6. Authentication type  : login
7. Secure IMAP (TLS)  : false
8. Server software  : other
9. Delimiter   : detect
 
B. Update SMTP Settings  : localhost:25
H. Hide IMAP Server Settings
 
R Return to Main Menu
C Turn color off
S Save data
Q Quit
 
Command >>B
 
# select

 
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings
 
General
-------
1. Domain   : sourcecodebd.net
2. Invert Time   : false
3. Sendmail or SMTP  : SMTP
 
SMTP Settings
-------------
4. SMTP Server   : localhost
5. SMTP Port   : 25
6. POP before SMTP  : false
7. SMTP Authentication  : none
8. Secure SMTP (TLS)  : false
9. Header encryption key :
 
A. Update IMAP Settings  : mail.server-linux.info:143 (other)
H. Hide SMTP Settings
 
R Return to Main Menu
C Turn color off
S Save data
Q Quit
 
Command >>4
 
# select

 
This is the hostname of your SMTP server.
[localhost]:mail.sourcecodebd.net
 
# specify your SMTP server

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings
 
General
-------
1. Domain   : sourcecodebd.net
2. Invert Time   : false
3. Sendmail or SMTP  : SMTP
 
SMTP Settings
-------------
4. SMTP Server   : mail.sourcecodebd.net
5. SMTP Port   : 25
6. POP before SMTP  : false
7. SMTP Authentication  : none
8. Secure SMTP (TLS)  : false
9. Header encryption key :
 
A. Update IMAP Settings  : mail.sourcecodebd.net:143 (other)
H. Hide SMTP Settings
 
R Return to Main Menu
C Turn color off
S Save data
Q Quit
 
Command >>7
 
# select

 
If you have already set the hostname and port number, I can try to
automatically detect the mechanisms your SMTP server supports.
Auto-detection is *optional* - you can safely say "n" here.
 
Try to detect auth mechanisms? [y/N]:y
 
# yes

Trying to detect supported methods (SMTP)...
Testing none: SUPPORTED
Testing login: SUPPORTED
Testing CRAM-MD5: NOT SUPPORTED
Testing DIGEST-MD5: NOT SUPPORTED
 
What authentication mechanism do you want to use for SMTP connections?
none - Your SMTP server does not require authorization.
login - Plaintext. If you can do better, you probably should.
cram-md5 - Slightly better than plaintext.
digest-md5 - Privacy protection - better than cram-md5.
 
*** YOUR SMTP SERVER MUST SUPPORT THE MECHANISM YOU CHOOSE HERE ***
If you don't understand or are unsure, you probably want "none"
 
none, login, cram-md5, or digest-md5 [none]:login
 
# login

Would you like to use other login and password for all SquirrelMail
SMTP connections? [y/N]:n

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings
 
General
-------
1. Domain    : sourcecodebd.net
2. Invert Time    : false
3. Sendmail or SMTP   : SMTP
 
SMTP Settings
-------------
4. SMTP Server    : mail.sourcecodebd.net
5. SMTP Port    : 25
6. POP before SMTP   : false
7. SMTP Authentication   : login
8. Secure SMTP (TLS)   : false
9. Header encryption key  :
 
A. Update IMAP Settings   : mail.sourcecodebd.net:143 (other)
H. Hide SMTP Settings
 
R Return to Main Menu
C Turn color off
S Save data
Q Quit
 
Command >>r
 
# back

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Main Menu --
1. Organization Preferences
2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books
7. Message of the Day (MOTD)
8. Plugins
9. Database
10. Languages
 
D. Set pre-defined settings for specific IMAP servers
 
C Turn color off
S Save data
Q Quit
 
Command >>4
 
# select

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
General Options
1. Data Directory  : /var/lib/squirrelmail/prefs/
2. Attachment Directory  : /var/spool/squirrelmail/attach/
3. Directory Hash Level  : 0
4. Default Left Size  : 150
5. Usernames in Lowercase : false
6. Allow use of priority : true
7. Hide SM attributions  : false
8. Allow use of receipts : true
9. Allow editing of identity : true

Allow editing of name  : true
Remove username from header : false

10. Allow server thread sort : true
11. Allow server-side sorting : true
12. Allow server charset search : true
13. Enable UID support  : true
14. PHP session name  : SQMSESSID
15. Location base  :
 
R Return to Main Menu
C Turn color off
S Save data
Q Quit
 
Command >>7
 
# select

Hide SM attributions (y/n) [n]:y
 
# Yes

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
General Options
1. Data Directory  : /var/lib/squirrelmail/prefs/
2. Attachment Directory  : /var/spool/squirrelmail/attach/
3. Directory Hash Level  : 0
4. Default Left Size  : 150
5. Usernames in Lowercase : false
6. Allow use of priority : true
7. Hide SM attributions  : true
8. Allow use of receipts : true
9. Allow editing of identity : true

Allow editing of name  : true
Remove username from header : false

10. Allow server thread sort : true
11. Allow server-side sorting : true
12. Allow server charset search : true
13. Enable UID support  : true
14. PHP session name  : SQMSESSID
15. Location base  :
 
R Return to Main Menu
C Turn color off
S Save data
Q Quit
 
Command >>r
 
# back

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Main Menu --
1. Organization Preferences
2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books
7. Message of the Day (MOTD)
8. Plugins
9. Database
10. Languages
 
D. Set pre-defined settings for specific IMAP servers
 
C Turn color off
S Save data
Q Quit
 
Command >>8
 
# select

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Plugins
Installed Plugins
1. delete_move_next
2. squirrelspell
3. newmail
 
Available Plugins:
4. listcommands
5. filters
6. fortune
7. mail_fetch
8. message_details
9. compatibility
10. calendar
11. translate
12. sent_subfolders
13. empty_trash
14. spamcop
15. bug_report
16. abook_take
17. info
18. secure_login
19. administrator
 
R Return to Main Menu
C Turn color off
S Save data
Q Quit
 
Command >>9
 
# add plugin ( compatibility )

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Plugins
Installed Plugins
1. delete_move_next
2. squirrelspell
3. newmail
4. compatibility
 
Available Plugins:
5. listcommands
6. filters
7. fortune
8. mail_fetch
9. message_details
10. calendar
11. translate
12. sent_subfolders
13. empty_trash
14. spamcop
15. bug_report
16. abook_take
17. info
18. secure_login
19. administrator
 
R Return to Main Menu
C Turn color off
S Save data
Q Quit
 
Command >>13
 
# add plugin ( empty_trash )

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Plugins
Installed Plugins
1. delete_move_next
2. squirrelspell
3. newmail
4. compatibility
5. empty_trash
 
Available Plugins:
6. listcommands
7. filters
8. fortune
9. mail_fetch
10. message_details
11. calendar
12. translate
13. sent_subfolders
14. spamcop
15. bug_report
16. abook_take
17. info
18. secure_login
19. administrator
 
R Return to Main Menu
C Turn color off
S Save data
Q Quit
 
Command >>18
 
# add plugin ( secure_login )

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Plugins
Installed Plugins
1. delete_move_next
2. squirrelspell
3. newmail
4. compatibility
5. empty_trash
6. secure_login
 
Available Plugins:
7. listcommands
8. filters
9. fortune
10. mail_fetch
11. message_details
12. calendar
13. translate
14. sent_subfolders
15. spamcop
16. bug_report
17. abook_take
18. info
19. administrator
 
R Return to Main Menu
C Turn color off
S Save data
Q Quit
 
Command >>q
 
# quit

 
You have not saved your data.
Save? [Y/n]:y
 
# save

Data saved in config.php
 
Exiting conf.pl.
You might want to test your configuration by browsing to
http://your-squirrelmail-location/src/configtest.php
Happy SquirrelMailing!
 
[root@www ~]# cd /usr/share/squirrelmail/plugins/secure_login
[root@www secure_login]# cp config.sample.php config.php
[root@www secure_login]# vi config.php

# line 24: change
$change_back_to_http_after_login =0;
 
[root@www secure_login]# /etc/rc.d/init.d/httpd reload

Last Updated on Saturday, 22 October 2011 06:55

Install Dovecot

[root@mail ~]# yum -y install dovecot
[root@mail ~]# vi /etc/dovecot.conf

# line 20: make valid
protocols = imap imaps pop3 pop3s
 
# line 224: make valid and add it
mail_location = maildir:~/Maildir
 
[root@mail ~]# /etc/rc.d/init.d/dovecot start

Starting Dovecot Imap: Info: If you have trouble with authentication failures,
enable auth_debug setting. See http://wiki.dovecot.org/WhyDoesItNotWork
 
[  OK  ]

[root@mail ~]# chkconfig dovecot on

Last Updated on Saturday, 22 October 2011 06:46

Install Postfix

[root@mail ~]# yum -y install postfix
[root@mail ~]# vi /etc/postfix/main.cf

# line 76: specify hostname
myhostname = mail.sourcecodebd.net

# line 83: specify domain name
mydomain = sourcecodebd.net
 
# line 99: make valid
myorigin = $mydomain
 
# line 116: change
inet_interfaces = all

# line 164: add
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
 
# line 264: specify LAN
mynetworks = 127.0.0.0/8, 10.0.0.0/24
 
# line 419: make valid (use Maildir)
home_mailbox = Maildir/
 
# line 545: make valid
header_checks = regexp:/etc/postfix/header_checks
 
# line 546: add
body_checks = regexp:/etc/postfix/body_checks

# bottom: add (limit an email 5M)
message_size_limit = 5242880

# bottom: add (limit an email-box 100M)
mailbox_size_limit = 104857600

# these 4 lines are for SMTP-Auth

smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
smtpd_recipient_restrictions = permit_mynetworks, permit_auth_destination, permit_sasl_authenticated, reject

 
[root@mail ~]# vi /etc/postfix/header_checks

# add at the head of file
# reject empty address email

/^From:.*<#.*@.*>/ REJECT
/^Return-Path:.*<#.*@.*>/ REJECT
# hide Received section

/^Received:/ IGNORE

[root@mail ~]# vi /etc/postfix/body_checks

# reject email that includes example.com

/^(|[^>].*)example.com/ REJECT

 
[root@mail ~]# /etc/rc.d/init.d/sendmail stop
[root@mail ~]# chkconfig sendmail off
[root@mail ~]# alternatives --config mta

There are 2 programs which provide 'mta'.
 
Selection      Command
-----------------------------------------------
*+ 1  /usr/sbin/sendmail.sendmail
2  /usr/sbin/sendmail.postfix

Enter to keep the current selection[+], or type selection number:2
 
[root@mail ~]# /etc/rc.d/init.d/postfix start
[root@mail ~]# /etc/rc.d/init.d/saslauthd start
[root@mail ~]# chkconfig postfix on
[root@mail ~]# chkconfig saslauthd on

Last Updated on Saturday, 22 October 2011 06:44

Install ClamAV

[root@dlp ~]# yum -y install clamav clamav-update
[root@dlp ~]# vi /etc/freshclam.conf

# line 8: make it comment
#Example

[root@dlp ~]# freshclam   # update policy file
ClamAV update process started at Wed Jun 10 20:18:53 2009
main.cvd is up to date (version: 51, sigs: 545035, f-level: 42, builder: sven)
Downloading daily.cvd [100%]
daily.cvd updated (version: 9454, sigs: 27600, f-level: 43, builder: acab)
Database updated (572635 signatures) from database.clamav.net (IP: 219.94.128.99)

[root@dlp ~]# clamscan --infected --remove --recursive /home

----------- SCAN SUMMARY -----------
Known viruses: 654487
Engine version: 0.95.2
Scanned directories: 3
Scanned files: 3
Infected files: 0
Data scanned: 0.00 MB
Data read: 0.00 MB (ratio 0.00:1)
Time: 1.691 sec (0 m 1 s)

# try to download trial virus
[root@dlp ~]# wget http://www.eicar.org/download/eicar.com
[root@dlp ~]# clamscan --infected --remove --recursive .
./eicar.com: Eicar-Test-Signature FOUND
./eicar.com: Removed.
 
----------- SCAN SUMMARY -----------
Known viruses: 654487
Engine version: 0.95.2
Scanned directories: 1
Scanned files: 11
Infected files: 1  # just detected

Data scanned: 0.05 MB
Data read: 0.02 MB (ratio 2.00:1)
Time: 1.613 sec (0 m 1 s)

Last Updated on Saturday, 22 October 2011 06:50

Congigure SSL

[root@mail ~]# vi /etc/postfix/main.cf
 
# add them at the bottom
smtpd_use_tls = yes
smtpd_tls_cert_file = /etc/pki/tls/certs/server.crt
smtpd_tls_key_file = /etc/pki/tls/certs/server.key
smtpd_tls_session_cache_database = btree:/etc/postfix/smtpd_scache

[root@mail ~]# vi /etc/postfix/master.cf
# line 17-18: make valid
smtps       inet   n       -       n       -       -       smtpd
  -o smtpd_tls_wrappermode=yes
 
[root@mail ~]# vi /etc/dovecot.conf
# line 89: make valid
ssl = yes

# line 95: specify cert file
ssl_cert_file = /etc/pki/tls/certs/server.crt

# line 96: specify key file
ssl_key_file = /etc/pki/tls/certs/server.key
 
[root@mail ~]# /etc/rc.d/init.d/postfix restart
[root@mail ~]# /etc/rc.d/init.d/dovecot restart

Last Updated on Saturday, 22 October 2011 06:49

Mail Log Analyger

[root@mail ~]# yum -y install postfix-pflogsumm
# display summary of yesterday's maillogs

[root@mail ~]# perl /usr/sbin/pflogsumm -d yesterday /var/log/maillog  [Detail Mail LOG]
 
Postfix log summaries for Nov 21
 
Grand Totals
------------
messages
2 received
2 delivered
0 forwarded
0 deferred
0 bounced
2 rejected (50%)
0 reject warnings
0 held
0 discarded (0%)

14379 bytes received
14379 bytes delivered
 1 senders
 1 sending hosts/domains
 2 recipients
 1 recipient hosts/domains
 
Per-Hour Traffic Summary

time received delivered deferred bounced rejected
................
.............
.........


[root@mail ~]# crontab -e
 
# send summary of maillog at AM 1:00 everyday to root

00 01 * * * perl /usr/sbin/pflogsumm -e -d yesterday /var/log/maillog | mail -s 'Logwatch for Postfix' root

Last Updated on Saturday, 22 October 2011 06:53

Virtual Hosting

Set config on SMTP Server.

[root@mail ~]# vi /etc/postfix/main.cf

# add these lines at the bottom
virtual_alias_domains = virtual.host
virtual_alias_maps = hash:/etc/postfix/virtual

[root@mail ~]# vi /etc/postfix/virtual

# add at the head
This email address is being protected from spambots. You need JavaScript enabled to view it.  userB
 
[root@mail ~]# postmap /etc/postfix/virtual
[root@mail ~]# /etc/rc.d/init.d/postfix restart

Last Updated on Saturday, 22 October 2011 06:52

Mail Graph

[root@mail ~]# yum -y install mailgraph
[root@mail ~]# vi /etc/httpd/conf.d/mailgraph.conf
 
#
# Mailgraph: An postfix/sendmail log file analyzer
#
Alias /mailgraph /usr/share/mailgraph
 
AddHandler cgi-script .cgi
 
<Directory /usr/share/mailgraph/>
   AllowOverride None
   Options +ExecCGI
   DirectoryIndex mailgraph.cgi
 
   Order Deny,Allow
   Deny from all
   Allow from 127.0.0.1
10.0.0.0/24
# add IPs you permit

</Directory>
 
[root@mail ~]# /etc/rc.d/init.d/mailgraph start
[root@mail ~]# /etc/rc.d/init.d/httpd restart
[root@mail ~]# chkconfig mailgraph on


http://server-address/mailgraph

Last Updated on Saturday, 22 October 2011 06:54

Run with ClamAV

[root@mail ~]# yum -y install amavisd-new
[root@mail ~]# vi /etc/freshclam.conf

# line 55: make valid
AllowSupplementaryGroups yes
 
[root@mail ~]# vi /etc/amavisd/amavisd.conf

# line 21: specify domain name
$mydomain= 'sourcecodebd.net';

# line 152: specify FQDN
$myhostname= 'mail.sourcecodebd.net';

# line 154: make valid
$notify_method = 'smtp:[127.0.0.1]:10025';
$forward_method = 'smtp:[127.0.0.1]:10025';

[root@mail ~]# vi /etc/postfix/main.cf
# add at the bottom
content_filter=smtp-amavis:[127.0.0.1]:10024
 
[root@mail ~]# vi /etc/postfix/master.cf
 
# add at the bottom

smtp-amavis unix -       -       n      -     2 smtp
      -o smtp_data_done_timeout=1200
      -o smtp_send_xforward_command=yes
      -o disable_dns_lookups=yes
127.0.0.1:10025 inet n     -     n     -     - smtpd
      -o content_filter=
      -o local_recipient_maps=
      -o relay_recipient_maps=
      -o smtpd_restriction_classes=
      -o smtpd_client_restrictions=
      -o smtpd_helo_restrictions=
      -o smtpd_sender_restrictions=
      -o smtpd_recipient_restrictions=permit_mynetworks,reject
      -o mynetworks=127.0.0.0/8
      -o strict_rfc821_envelopes=yes
      -o smtpd_error_sleep_time=0
      -o smtpd_soft_error_limit=1001
      -o smtpd_hard_error_limit=1000

[root@mail ~]# /etc/rc.d/init.d/clamd.amavisd start
[root@mail ~]# /etc/rc.d/init.d/amavisd start
[root@mail ~]# /etc/rc.d/init.d/spamassassin start
[root@mail ~]# /etc/rc.d/init.d/postfix restart
[root@mail ~]# chkconfig amavisd on
[root@mail ~]# chkconfig spamassassin on
[root@mail ~]# chkconfig clamd.amavisd on

Last Updated on Saturday, 22 October 2011 06:51

Make SSL certificate.

[root@www ~]# cd /etc/pki/tls/certs
[root@www certs]# make server.key

umask 77 ; \
/usr/bin/openssl genrsa -des3 1024 > server.key

Generating RSA private key, 1024 bit long modulus
......................................................++++++
.............++++++
e is 65537 (0x10001)
Enter pass phrase:    # set pass phrase
Verifying - Enter pass phrase:   # verify
 

# remove pass phrase from private key
[root@www certs]# openssl rsa -in server.key -out server.key

Enter pass phrase for server.key:   # input pass phrase
writing RSA key

[root@www certs]#
[root@www certs]# make server.csr

umask 77 ; \
/usr/bin/openssl req -utf8 -new -key server.key -out server.csr

You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [GB]:JP    # country State or Province Name (full name) [Berkshire]:Hiroshima
# state
Locality Name (eg, city) [Newbury]:Hiroshima  # city
Organization Name (eg, company) [My Company Ltd]:Server Linux  #company
Organizational Unit Name (eg, section) []:IT Solution  
# division
Common Name (eg, your server's hostname) []:www1.server-linux.info 
# server's FQDN
Email Address []: This email address is being protected from spambots. You need JavaScript enabled to view it.   # email address
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:     # Enter
An optional company name []:    # Enter

[root@www certs]#
[root@www certs]#openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 3650   # make Certificate File

Signature ok
subject=/C=JP/ST=Hiroshima/L=Hiroshima/O=Server Linux/OU=IT Solution/CN=www.server-linux.info/emailAddress= This email address is being protected from spambots. You need JavaScript enabled to view it.
Getting Private key

[root@www certs]# chmod 400 server.*

Last Updated on Saturday, 22 October 2011 06:47

Related Articles

You are here: Home / Fedora_Mail