Liferay Portal Enterprise can integrate with Washington IMAP+Sendmail,
Cyrus IMAP+Postfix, and Dovecot+Postfix. Support for integration with
Microsoft Exchange and other IMAP servers are planned and will be
implemented in the near future.
The portal synchronizes with the mail server's user authentication
by adding a mail server account when a portal account is added,
deleting a mail server account when a portal account is deleted, and
updating a mail server account when a portal account is updated. To do
this, the portal must have privileges to modify and to update the mail
server's user database.
The portal must also keep track of how
email addresses map to certain accounts. For example, in the default
installation, the portal maps the user id liferay.com.1 to the email address test@liferay.com.
One
possible deployment scenario is to run the mail EJBs on the mail server
and run the portal EJBs on the web server. In this case, the mail
server and web server are two different machines. The portal EJBs will
give abstract commands (add/delete/update user) to the remote mail EJBs
to carry out. The mail EJBs then run the appropriate system commands
for the specific mail server and operating system.
Another
possible deployment scenario is to have the mail EJBs and portal EJBs
run on the same machine. This can all be configured by editing portal.properties.
Users
access their email through an IMAP server. Access is limited to IMAP so
that the portal does not have to be programmed to know where to persist
the mail.
-
Washington IMAP+Sendmail
-
Cyrus IMAP+Postfix
-
Dovecot+Postfix
-
Microsoft Exchange
-
Washington IMAP+Sendmail
- Install and
on your mail server. Expect allows you to add, delete, or update users
in one command. An example script for Red Hat is included in
/mail-ejb/scripts/redhat.
- Configure /portal-ejb/classes/portal.properties for your mail server.
- Follow the instructions from this on our forums.
-
Cyrus IMAP+Postfix
- Install .
For
a minimal installation, choose to install a custom server. Deselect all
packages groups. Select the package groups: Text-based Internet, Mail
Server, DNS Name Server, FTP Server, MySQL Database, Network Servers,
Development Tools, Legacy Software Development, Administration Tools,
and System Tools.
Make sure the following RPMs are also
selected. The packages cyrus-imapd and cyrus-imapd-utils are only
available in Fedora Core 2 and Fedora Core 4. They were not part of
Fedora Core 1 and needed to be compiled manually. In Fedora Core 4,
they were moved to Extras and you will need to use yum to install these
packages.
Mail Server: +cyrus-imapd, +cyrus-imapd-utils
MySQL Database: +mysql-server
Development Tools: +expect
- Update Fedora. This may take a while even if you have a fast connection.
rpm --import /usr/share/rhn/RPM-GPG-KEY-fedora
yum list
yum upgrade
- Turn off Sendmail.
chkconfig --level 3 sendmail off
/etc/rc.d/init.d/sendmail stop
- Edit /etc/sysconfig/saslauthd.
Replace MECH=shadow with MECH=pam.
Turn on Cyrus SASL.
chkconfig --level 3 saslauthd on
/etc/rc.d/init.d/saslauthd start
- Download Cyrus IMAP. If you are using Fedora Core 2 or later, you
can use the RPMs from Fedora: cyrus-imapd and cyrus-imapd-utils. If you
are using Fedora Core 1 or an earlier version of Red Hat, download and build the RPM for your environment from the source distribution.
Build Cyrus IMAP.
rpmbuild --rebuild cyrus-imapd-2.1.16-6.src.rpm
Install Cyrus IMAP.
rpm -i cyrus-imapd-2.1.16-6.i386.rpm
rpm -i cyrus-imapd-utils-2.1.16-6.i386.rpm
Turn on Cyrus IMAP.
chkconfig --level 3 cyrus-imapd on
/etc/rc.d/init.d/cyrus-imapd start
- Download the source distribution of .
Install Postfix with support for MySQL and Cyrus SASL.
rpm -ivh postfix-2.1.6-1.src.rpm
cd /usr/src/redhat/SOURCES
bash
export POSTFIX_MYSQL_REDHAT=1
export POSTFIX_SASL=2
export POSTFIX_TLS=1
sh make-postfix.spec
exit
cd /usr/src/redhat/SPECS
rpmbuild -ba postfix.spec
cd /usr/src/redhat/RPMS/i386
rpm -i --force postfix-2.1.6-1.mysql.sasl2.tls.fc4.i386.rpm
- Download the source distribution of .
Install PAM MySQL.
rpm -ivh pam_mysql-0.5-0.src.rpm
cd /usr/src/redhat/SPECS
rpmbuild -ba pam_mysql.spec
cd /usr/src/redhat/RPMS/i386
rpm -i pam_mysql-0.5-0.i386.rpm
- Copy /mail-ejb/scripts/fedora/cyrus/mysql_virtual.cf to
/etc/postfix/mysql_virtual.cf. Modify mysql_virtual.cf to point to your
MySQL database.
Edit /etc/postfix/virtual. Add the line yourdomain.com anything
for each virtual domain that Postfix will manage. A correspending entry
is needed in the MySQL database so that email to
postmaster@yourdomain.com can be delivered to a Cyrus IMAP account.
Transform /etc/postfix/virtual to a format Postfix can read.
postmap /etc/postfix/virtual
Edit /etc/postfix/master.cf. Replace the two instances of /cyrus/bin/deliver with /usr/lib/cyrus-imapd/deliver. Add these two lines:
procmail unix - n n - - pipe
flags=R user=cyrus argv=/usr/bin/procmail -t -m USER=${user} EXTENSION=${extension} /home/cyrus/procmailrc
Edit /etc/postfix/main.cf. Add these lines:
#
# Custom Settings
#
mynetworks = 127.0.0.0/8, 192.168.0.0/16, 128.135.12.7/32
mailbox_command = /usr/bin/procmail -t -a "$EXTENSION"
mailbox_transport = procmail
virtual_maps = hash:/etc/postfix/virtual, mysql:/etc/postfix/mysql_virtual.cf
smtpd_recipient_restrictions = permit_mynetworks, check_client_access hash:/etc/postfix/pop-before-smtp, check_relay_domains
Set mynetworks to the IPs that are allowed to connect to Postfix.
Turn on Postfix.
chkconfig --level 3 postfix on
/etc/rc.d/init.d/postfix start
- Copy /mail-ejb/scripts/fedora/cyrus/procmailrc to /home/cyrus/procmailrc. Make sure the cyrus user can access the script.
chown cyrus:mail /home/cyrus
chown cyrus:mail /home/cyrus/procmailrc.
Copy /mail-ejb/scripts/fedora/cyrus/cyrus_adduser to /usr/bin/cyrus_adduser. Edit cyrus_adduser and replace localhost with the mail server's host name. Make sure the script can be executed.
chmod u+x /usr/bin/cyrus_adduser.
Copy /mail-ejb/scripts/fedora/cyrus/cyrus_userdel to /usr/bin/cyrus_userdel. Edit cyrus_userdel and replace localhost with the mail server's host name. Make sure the script can be executed.
chmod u+x /usr/bin/cyrus_userdel.
Note: If you copy cyrus_adduser and cyrus_userdel from a Windows environment to a Linux environment, you need to run dos2unix cyrus_adduser to convert the file so that Linux can read the file correctly.
- Edit /etc/pam.d/pop so that POP authentication is checked via MySQL. Remove the current lines and add these lines:
#%PAM-1.0
auth sufficient pam_mysql.so
user=dbuser passwd=dbpassword host=127.0.0.1 db=cyrus table=CyrusUser
usercolumn=userId passwdcolumn=password_ crypt=0
account
required pam_mysql.so user=dbuser passwd=dbpassword host=127.0.0.1
db=cyrus table=CyrusUser usercolumn=userId passwdcolumn=password_
crypt=0
Edit /etc/pam.d/imap so that IMAP authentication is checked via MySQL. Remove the current lines and add these lines:
#%PAM-1.0
auth sufficient pam_mysql.so
user=dbuser passwd=dbpassword host=127.0.0.1 db=cyrus table=CyrusUser
usercolumn=userId passwdcolumn=password_ crypt=0
account
required pam_mysql.so user=dbuser passwd=dbpassword host=127.0.0.1
db=cyrus table=CyrusUser usercolumn=userId passwdcolumn=password_
crypt=0
- Turn on MySQL.
chkconfig --level 3 mysqld on
/etc/rc.d/init.d/mysqld start
Configure MySQL so that it can be accessed by the username dbuser and password dbpassword.
use mysql;
insert
into user values ('127.0.0.1', "dbuser", password("dbpassword"), "Y",
"Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y");
Create the database and tables that will be used to authenticate IMAP users.
create database cyrus;
use cyrus;
create table CyrusUser (
userId varchar(75) not null primary key,
password_ varchar(75) not null
);
create table CyrusVirtual (
emailAddress varchar(75) not null primary key,
userId varchar(75) not null
);
The Expect scripts cyrus_adduser and cyrus_userdel that are used to add and delete Cyrus IMAP users require a default cyrus user to authenticate with.
insert into CyrusUser (userId, password_) values ('cyrus', 'cyrus_password');
Every
virtual domain requires a postmaster@yourdomain.com entry so that email
to postmaster@yourdomain.com can be delivered to a Cyrus IMAP account.
insert into CyrusVirtual (emailAddress, userId) values ('postmaster@yourdomain.com', 'your_domain_1');
Create a default account for your_domain_1.
insert into CyrusUser (userId, password_) values ('your_domain_1', 'your_password');
insert into CyrusVirtual (emailAddress, userId) values ('joe.blogs@yourdomain.com', 'your_domain_1');
quit;
cyrus_adduser cyrus_password your_domain_1
- Turn on SpamAssassin.
chkconfig --level 3 spamassassin on
/etc/rc.d/init.d/spamassassin start
- Download .
Install ClamAV.
rpm -i clamav-0.86.1-1.i386.rpm
Turn on ClamAV.
chkconfig --level 3 clamd on
/etc/rc.d/init.d/clamd start
Download .
Install ClamAssassin.
gunzip clamassassin-1.2.2.tar.gz
tar xvf clamassassin-1.2.2.tar
cd clamassassin-1.2.2
./configure
cp clamassassin /usr/local/bin
Edit /usr/local/bin/clamassassin.
Set SUBJECTHEAD to "[VIRUS] ".
- Copy /mail-ejb/scripts/fedora/cyrus/procmail_vacation to /usr/local/bin/procmail_vacation. Make sure the script can be executed.
chmod u+x /usr/local/bin/procmail_vacation.
Download .
Install SendEmail.
gunzip sendEmail-v1.52.tar.gz
tar xvf sendEmail-v1.52.tar
cd sendEmail-v1.52
chmod u+x sendEmail
chown cyrus:mail sendEmail
cp sendEmail /usr/local/bin
- Download the source distribution of .
Pop-before-smtp requires perl-TimeDate and perl-Net-Netmask.
Install perl-TimeDate from the distributed RPM.
Install perl-Net-Netmask.
perl -MCPAN -e 'install Net::Netmask'
Install Pop-before-smtp.
gunzip pop-before-smtp-1.38.tar.gz
tar xvf pop-before-smtp-1.38.tar
cd pop-before-smtp-1.38
chown root:root *
cp pop-before-smtp.init /etc/rc.d/init.d/pop-before-smtp
cp pop-before-smtp /usr/sbin/
cp pop-before-smtp-conf.pl /etc
Edit /etc/pop-before-smtp-conf.pl by uncommenting and modifying certain sections so it matches the following information.
$dbfile = '/etc/postfix/pop-before-smtp';
$grace = 120*60;
# Set the log file we will watch for pop3d/imapd records.
$file_tail{'name'} = '/var/log/maillog';
# For Cyrus (including a tweak for IP addrs that don't resolve):
$pat = '^(... .. ..:..:..) S+ (?:pop3d|imapd)[d+]: ' .
Turn on Pop-before-smtp.
chkconfig --level 3 pop-before-smtp on
/etc/rc.d/init.d/pop-before-smtp start
- Restart your mail server.
shutdown -r now
-
Dovecot+Postfix
- Follow the instructions from this on our forums.
-
Microsoft Exchange
阅读(3618) | 评论(0) | 转发(0) |