Keeping it Small and Simple


Alfresco, business and community

Filed under: Open Source — Tags: , , — Lorenzo E. Danielsson @ 20:25

Thank you Russ for responding to my concerns regarding your previous post. Your reply fills in a lot of gaps and shows that our positions may not be quite as polar as my first response implies.

A few quick comments follow.

Is it good or bad for society when companies get this large? IMO, it depends — transparency matters at scale.

I understand that certain types of companies need to be large because of the massive investment required to even begin operations. And I agree the transparency is important. Whether or not businesses overall are transparent today is something that only time will tell. Enron, to take but one example, certainly was not.

First. I don’t work for Alfresco. I’m a community member. My opinions are my own.

Okay, cleared. Not that it would really have mattered much. I wouldn’t stop using Alfresco because of personal opinions. I would be afraid to use Alfresco if I felt that it belittled the community supporting it. More on that below.

I absolutely believe that open source has the potential to create both economic and vast social benefit.

Exactly what I hope and believe as well. I just happen to panic anytime I fear that community is being sidelined.

I like many have trepidation with large amounts of centralized power but this is because “absolute power corrupts absolutely. “ We can’t count of the benevolence of individuals or organizations because it is almost always temporal. In our industry IBM, Microsoft, Google have all struggled or continue to struggle to maintain the balance of scale and public perception. Be transparent, focus on the customer.

Well put. On an individual level I will claim that we can safely assume that within each and every one of us the ability to be both selfish and selfless, greedy and sharing, mean and kind. Often several urges exist within us simultaneously. That is why it is so flawed to divide people into good or bad, virtuous or immoral, etc.

We are also all moral agents. As human beings we can understand the consequences of our actions (if we reflect upon them). If I right about what I said in the previous paragraph, then there will be a constant struggle among different urges. In moral terms, we could say that there is an internal fight to do the “right” thing instead of the “wrong” thing. Sometimes one urge wins, at other times another in each individual, leading us all to have some degree of unpredictability.

With corporations things are very much different. Corporations, at least if we mean the modern business corporation, exists primarily to seek profit. It may have other functions as well, but the struggle for higher profits always take the upper hand.

Further, corporations are not moral agents. One could argue that the individuals behind the corporation are moral agents. But with a board of directors, CEO, stock holders, employees, etc., who decides? The shareholders ultimately want profits, which means that a business is forced to seek the path of profit, no matter what. IBM, Microsoft, Monsanto, Enron, Chevron, Exxon, Shell, Bechtel are just a few examples of businesses that have blood on their hands in the search for profits. Blackwater is an example of a company that is extremely disturbing because of the types of activities it involves itself in order to get more for its shareholders.

The System that is Open Source would not survive on community alone. “It’s not about community” is meant to say that open source is not a hierarchy of components but a network and that community alone does not make open source what it is.

It would be very easy for me to nitpick here and rip this apart, but I don’t think that will achieve anything, because I am sure that I understand what you mean, not what you wrote. Open source in some form could survive even without much business support. But that is not a form that neither you nor I would like to see. We want to see open source thrive and that will require a wide array of interests, including commercial ones.

I like Lorenzo believe that the community should be strong via its rights (example: right to fork, right to vote on direction) and diverse.

Obviously this is the core issue for me. It is what gives the open source community its anarchic nature.

When it comes to software development, I favor the model that is used by the Linux kernel hackers, among others. Each developer is essentially working on his or her own project, each of which happens to be a “fork” of Linux. Linus Torvalds studies each of these different forks and pulls in changes that he feels will benefit Linux itself. Very few people actually use Linux however. Most people use one or more of the “forks”.

This is a highly decentralized model. It ensures the liberty of each developer to work on exactly what they want to work on (obviously within the framework of the kernel). It could be validly argued that this can lead to inefficiencies as developers may be stepping on each others’ toes on some parts of the kernel, while parts are not worked on at all. But I would argue that liberty is more important than efficiency. We are human beings, not ants.

Also, assuming that the Linux kernel generates enough interest and thereby enough developers, in theory each part of the kernel should get worked on.

If my developers want to work on MySQL or other open source software (that is contextual to my business) on their own time – more power to them.

Thanks for a good response to something that became a bit of an unnecessary rant from my side. Part of my comments were not really fair, now that I look at them again. I do have a question about the that is contextual to my business. I hope that does not imply that you would be unhappy if they worked on, say, Battle for Wesnoth on their own time. After all, their own time is their own time.

I believe Alfresco should look for community partnership in core development, but I also believe that it will be rare that they find it. Development is expensive business and both sides must find ways to leverage each other in a fashion, which is symbiotic.

I think you are hitting on something here. The are relatively new relationships, at least on a larger scale. Sure companies like Red Hat have been around for quite some time now, but I think it will take a while before community and business in general learn to coordinate activities, to accept and take advantage of each others’ existence.

I remember a few years ago there was a lot of talk about “bounties” where developers solve specific problems for a company, present their solution and get paid. I kind of liked the idea, since I am a notoriously bad employee. It has since got quiet. I am not sure why. Does the model itself not work? Is it not being done right? Did Google Summer of Code kill it?

Open Source and in general the ideas put forward in Clue Train bring balance to the system by empowering the members of the market with a voice and a recognized lion share of the power. It rightly positions the companies in a position of service rather than in a position of supreme power with the potential for the kind of abuse that is associated there.

I have to admit, I didn’t read Clue Train yet. I will do so. Limiting corporate power, as well as any other form of power that cannot demonstrate itself to be legitimate, is very important to me.

Should people be compensated for their work? Yes, without a doubt in my mind. Should we have a social conscious? Yes Absolutely. I think that open source is capable of accomplishing both.

Difficult not agree with that. Note, however, my comments earlier, about the inability of organizations to be moral agents.

I believe in strong leaders who see social interests as commercial interests hence the Peter Drucker quote.

That one will take a bit of pondering. As you would expect, I ultimately do not believe in leaders at all, strong or weak. Or at least, only a few leaders in very specific circumstances who are forced to be accountable for every action they take.

I think that it would be a very good thing if we could get businesses to be socially aware at the same time as the seek profit. We probably differ on priorities. I would say that social responsibility should always take priority. You are probably of a different mind. At least I guess that you would want to get rid of the word “always”. Today, the general idea in most of the business community is the opposite: commercial interests should always take priority, for reasons I have already mentioned. I am very much opposed to that as I see it to be destructive on several different levels: environmentally, socially etc.

At the foundation, we differ in political beliefs. Not necessarily all. I believe that government and the legal system should be totally or largely eradicated, as I think they do far more harm than good. I believe we humans form societies naturally and that within a society there need to be rules. But I think communitarian forms of deciding an maintaining its own rules are better than laws that are dictated by elites (who also have the power to bypass those very laws).

I also believe that capitalism must be smashed. You will disagree here, no doubt, but I cannot find any way to justify a system that is founded on the principle of “individual greed leads to the common good”. History has shown that individual greed leads mostly to individual wealth. A system that does not put up any limits will by necessity migrate into more and more areas in search for more profits. Hence the assault on labor unions, the attempts to destroy any form of social welfare, the rise of large-scale corporate capitalism, global capitalism, war capitalism and disaster capitalism. New areas where profits can be found, while the individual is trampled upon.

In short, the capitalist system will destroy us all if we don’t dismantle it. I have given relatively little thought to how economic life would be organized. I would not want a situation where everything gets collectively owned (especially not if that collective owner is the state). It must be something that guarantees the freedom from working under anybody, individual, organization or the state.

This was hastily put together. Some of your comments deserve more thought. I am also not certain about exactly how open source can aid and promote social change by itself. I have a bunch of loose ideas, but there is nothing even resembling coherence among those ideas. I will touch upon this more at a later date.



Open source as social change

Filed under: Open Source — Tags: , , , , , — Lorenzo E. Danielsson @ 14:43

On alfresco blogs, Russ Danner writes a rather disturbing post. Russ is interested in what the open source community can learn from big business. This is of course very important, at least if we begin with an assumption that we as humans exist to serve big business. Needless to say, this is the prevailing belief among the ruling elites. And, needless to say, the victims of this system, the vast majority of the world’s population, do not agree.

I, on the other hand, am interested in open source as a model for social change. That is not to say that open source “belongs” to one or the other side. Open source is a method for developing software the focuses on the universal right to view, modify and redistribute the source code underlying the software. I won’t go into the details here. Enough has been written on that already.

Open source didn’t exist in the beginning. What did exist was a nameless form of sharing of code and ideas which was probably very healthy for the software development community. Just like the academic community, where researchers share what they write so that it can be analyzed and improved upon, the early software developers shared their code. The code got looked at and improved upon. The original developer also benefited as she or he got access to those improvements. In short, knowledge in the early software development community was accumulated through sharing.

Eventually, business put its dirty hands into the bowl, and all of a sudden the fruit of people’s labor turned into the property of corporations. Programmers came to be seen, not as creators of software, but as labor. Users no longer had access to the source code itself, only the final compiled version of the software. As a reaction to that, the open source movement (or as some prefer, the free software movement) was born as a reaction to the attempts of business to restrict the rights of computer users to freely share software.

It is important to recognize where the open source movement originated. It didn’t start off with companies all off a sudden deciding to share their source code and allow others to modify it for their own and others needs. No. It started as a grassroots movement that was opposed to losing the right to view, modify and share source code. Business only got involved when it realized that it could make big profits.

I think that the world of open source will be yet another battleground between the haves and the have nots. The elites will use the methods that they are historically noted for, fear, intimidation, threats and the legal system (which they control). The masses have resisted in a number of ways: strikes, boycotts, sabotage etc. All justified methods of response to the intimidation by the bosses. Much can also be achieved by forming alternative communities that by-pass the rigid hierarchical structures of the capitalist system, still working within that system, a form of “societies within a society”. A friend of mine once remarked that these could act as cancers that destroy the capitalist system from within. I cannot comment as I have not given much thought to the possibility of that happening.

I am not opposed to the ability for individuals and organizations to be able to earn an income out of their software skills. I myself, do not survive on air. We live in a system where the majority of us, against our will, are forced to become wage slaves in order to survive. What I am against is big business, that thing that ensures that the vast majority of the worlds wealth remains in the hands of a very small group of families. Of course, those families are overwhelmingly white, Christian and have a special set of values that they feel the whole world should accept.

History teaches us that the elites groups have few, if any, inhibitions when it comes to what is allowed in order to get the dumb masses to understand the God-given right of the elites to rule. Bombing Vietnam to bits, causing death a devastation was considered legitimate. Destroying the American labor movement is seen as a good thing. Privatizing water, a foundation of life itself, is considered fully legitimate. (Obviously the market potential for something that none of us can survive without is staggering.) I could mention so many examples, but it will take me off-course.

Russ Danner is a self-proclaimed capitalist (although he never states exactly what capital he owns) and thus sees the elitist system as good, and who can argue. After all, it has helped 0.1% of the world’s population to amass an enormous amount of wealth, at the expense of the rest, the insignificant have-nots that make up the vast majority. They exist merely to serve the rich. The working classes are themselves to blame, for not picking the right parents, as the liberal theory goes.

So what is Russ Danner’s take on open source? He states:

Open Source is not about the bits, it’s not about the community, and it’s not about licenses. It’s about a better way to do business (read: make money via serving customers.)

It’s not about community, because community implies those ungrateful masses who are supposed to serve the elites. The elites have built up a system called wage slavery which is how things are supposed to be done. Community is the start of dangerous dissent against the ruling order. Never mind that those communities wrote the software. Once the labor is done, business can take over.

Licenses are equally insignificant since the elites control the legal system. If these open source licenses cause the masses to actually believe that they can form egalitarian communities without bosses and without being controlled by those who rule, the legal system can be changed. Imaginative lawyers can invent just about anything they want. Like intellectual property. Never mind how mind-bogglingly ridiculous the whole idea is. Once you control the legal system, you decide. The dumb masses, the “uncontrollable herd” have just to obey. That is their lot in life.

It is about a better way to do business. Business is good, because most people are practically barred from entering that field. Very few have the financial means to start a business, especially in a sector like IT. The liberal propaganda system of course tells us differently. It can safely do so since in practical terms the ability for anybody to set up a business is like the “rags to riches” myth: not a practical possibility.

So, in summary, Russ Danner sees in open source the possibility for big business to take the work of various open source communities and use it to make huge profits. The communities themselves are, as we have seen, irrelevant. Any claims they make equally so (remember, licenses are irrelevant). So Russ sees open source as yet another way for the rich to bleed to poor. And that is good.

He goes on to say:

I would be sorely upset if I found my development staff was hacking MySql code.

I guess development staff means “wage slaves”. What does sorely upset mean? That you deny your developers the freedom to work on what they want to work on? Does it mean that the right to choose only exists for the capitalist class, the bosses? If one of your developers worked on MySQL code on his free time, would you punish him or her for that? What if the changes the developer made to MySQL was beneficial to Alfresco in some way, would that developer be credited for that? Or still punished for their insubordination against the elite way?

But could the open source movement work for social change? Well, not in isolation. But it can play a part. One must be careful not to see all open source users or open source developers as a part of a coherent whole. The only thing that connects us all is the fact that we work on or with software that fits the criteria of being called open source or free software. Otherwise you have the full spectrum of political beliefs, including Russ Danner’s capitalist ones, or the outright racist viewpoints of Eric S. Raymond.

A computer is a wonderful machine. It doesn’t do much. But it does have one particular feature: it can be programmed to do a large variety of things. Big business wants to control the programming part. They want a situation where the computer becomes like a television set. You don’t program that. Business gives you a set of channels to choose from. Business wants to give you a set of software applications to choose from. You should not be developing anything by yourself, let alone share your creations with anybody else. That would be bad. That would be evil. Then you become an enemy of the powerful people you are to serve.

But open source communities can revolt against these injustices. Individual groups of loosely-knit developers and users, without any hierarchical structure, that just develop software for themselves and others to enjoy, can challenge the system. Imagine the joy of working on something that you are interested in, without a boss breathing down your neck all the time, issuing threats and intimidation. Imagine the joy of giving freely, not because it gives you “do-goody” points, but because you are a part of a system of gift-giving. Wouldn’t that be so much better than being constrained by a narrow conception of humans as being “dogs in a jungle, locked up in a fight to death over a single bone”?

The fact is that we the people, have the ultimate power. If you oppose the system in any way you can, we can bring it to its knees. Gain and share knowledge. Share the creations of your mind. Build communities based on equality rather than inequality. Read and gain wisdom. Don’t limit yourself. Learn how to program, learn your history, learn about the political system and how it is used to oppress us all. Learn about why we as human beings are divided, see for yourself who’s interests it serves. And against who.

Don’t apply arbitrary barriers to community membership. The other should be equally welcome regardless of color, gender, educational background, language etc. He or she still laughs like you do, cries like you do, has hopes, dreams and fears like you do. They are being controlled, just like you are being controlled. They are taught to fear you and despise you, just like you are taught to fear them, to despise them. They are being fucked in the ass, just like you are being fucked in the ass.

I wonder if these are Russ Danner’s personal opinions or the opinions of the Alfresco team as well. I have been using Alfresco for some time (not the enterprise version, and I never will). I would not mind being able to sell Alfresco and make some money off that. I would of course then want to donate a part of the proceeds to Alfresco, not because there is a contract that states that I must do so, but because it is the right thing to do. That seems a much better foundation for mutual understanding than the implied threat of the legal system.

Of course, there are alternatives to Alfresco in the open source arena. If Alfresco wants to unleash the destructive force of big business on the movement then I will have to look into alternatives. Or start something new. Re-inventing the wheel isn’t necessarily a bad thing, especially if the current wheel is trying to run you over.


Alfresco on Debian: using MySQL

Filed under: Alfresco — Tags: , , , , — Lorenzo E. Danielsson @ 16:44

Yesterday I blogged about how to perform the most basic possible installation of Alfresco on a Debian system. That setup included using Hypersonic SQL as the database backend. Eventually you will want to migrate to using MySQL instead. Let us look at how to set it up.

I am assuming that you have grabbed the Alfresco Tomcat bundle (the community version). I am also assuming that you are running Debian Etch or beyond (if you are running experimental and things don’t work, that’s your mess to sort out). You should also have MySQL installed and up and running. I have MySQL 5.0.45 here and that works fine.

Setting it up

Before you start, make sure the Alfresco server is not running. Shut it down if it is. Then you need to run an SQL script that will create the MySQL database for Alfresco to use. Do this (as root):

# cp /opt/alfresco/extras/databases/mysql
# mysql --user root -p < db_setup.sql

You should be prompted for the password of the MySQL root user. If you don’t have a password for the root user, you should leave out the -p option. Of course, you are already aware of the security implications of not having a password set, so I won’t go over that here. Your server, your choice.

Next, you need to edit two files located in /opt/alfresco/tomcat/shared/classes/alfresco/extension. The first one is where you need to comment out the lines relating to HSQL and uncomment the MySQL ones.
Here is the part of the file that needs to be modified with the changes made.

# HSQL connection

# MySQL connection (This is default and requires mysql-connector-java-5.0.3-bin.
jar, which ships with the Alfresco server)

The other file that needs to be edited is Again, un-comment the line that relates to MySQL and comment out the one relating to HSQL. Look at the very top of the file and you will find the lines to modify.

# HSQL dialect

# MySQL dialect (default)

If this was a completely new Alfresco installation and you have never run it before you should be good to go. Start the Alfresco server and wait. It does take a little longer to start Alfresco when you are using MySQL. You could follow along by doing:

# tail -f /opt/alfresco/alfresco.log

That will give you Alfresco’s log output in the terminal.

If it doesn’t work

If the Alfresco server has been started at least once before migrating to MySQL, Alfresco will probably not start. You will be able to start Tomcat, but the Alfresco application will not be available. If this is the case, look inside the log file and you should find a few lines like this:

Caused by: More than one root node i
n index: 2

This fix for that, which is available here is:

  1. # cd /opt/alfresco
  2. # ./alfresco stop
  3. # rm -rf alf_data/lucene_indexes
  4. # cd tomcat/webapps/alfresco/WEB-INF/classes/alfresco
  5. # vim

Make the following changes to the file:

# The index recovery mode (NONE, VALIDATE, AUTO, FULL)

# Change the failure behaviour of the configuration checker

Now you can start Alfresco again. Hopefully it will work. If it doesn’t, stop Alfresco again, drop the database and re-create it, remove the /opt/alfresco/alf_data/lucene-indexes directory again and start. Then it *should* work.

Once you have been able to start Alfresco successfully and gone to http://localhost:8080/alfresco to confirm that it is indeed working, you can revert the changes that you made in /opt/alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/ If you don’t, Alfresco will attempt a full index recovery every time you start Alfresco.

The best option is probably that you configure Alfresco to use MySQL instead of HSQL before you start it the first time. That way you should not have any issues (at least I never have).

Other thing that could go wrong

Occasionally you see error messages like this one in your log file: Cannot bind to URL [rmi://localhost:50500/alfresco/jmxrmi]:
 javax.naming.NameAlreadyBoundException: alfresco/jmxrmi [Root exception is java
.rmi.AlreadyBoundException: alfresco/jmxrmi]

They will show up if you try to start Alfresco when its already running. But there are a few other circumstances as well. One is if you shut it down and restart it without giving it enough time to fully shut down. You can do:

# ps ax | grep java

to see if there are any java processes related to Tomcat and/or Alfresco still alive. If you find any, give them a minute or two to terminate.

While you are trying to migrate to MySQL, it sometimes happens that some processes refuse to close (I have waited for over twenty minutes without them croaking). In that case, just use ps to find the PID of the process and manually kill it.

For example, suppose I find this:

# ps ax | grep java
11180 pts/0    Sl     0:40 /usr/lib/jvm/java-6-sun/bin/java -Xms128m -Xmx512m -server -XX:CompileCommand=exclude,org/apache/lucene/index/IndexReader$1,doBody -XX:CompileCommand=exclude,org/alfresco/repo/search/impl/lucene/index/IndexInfo$Merger,mergeIndexes -XX:CompileCommand=exclude,org/alfresco/repo/search/impl/lucene/index/IndexInfo$Merger,mergeDeletions -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=/opt/alfresco/tomcat/conf/ -Djava.endorsed.dirs=/opt/alfresco/tomcat/common/endorsed -classpath :/opt/alfresco/tomcat/bin/bootstrap.jar:/opt/alfresco/tomcat/bin/commons-logging-api.jar -Dcatalina.base=/opt/alfresco/tomcat -Dcatalina.home=/opt/alfresco/tomcat org.apache.catalina.startup.Bootstrap start
11362 pts/0    R+     0:00 grep java

The process with PID 11180 is an Alfresco process. If I have waited long enough for this to terminate, but it isn’t, step in and be the executioner:

# kill 11180


Migrating Alfresco to MySQL involves a little more work than just using HSQL, but not much more. It really isn’t that complex, just that it can be a bit frustrating when you keep trying to get it up and running and it keeps refusing. But just monitor you log file and you should be okay.

Next time I’ll look at how to set Alfresco using only the WAR file, into your own Tomcat installation. This is a good idea if you already have Tomcat installed. There are a few additional things you will have to do if you use your own Tomcat installation instead of the bundled one. But, on the other hand, using our own gives us the opportunity to experiment with Alfresco on Tomcat 6.


Setting up Alfresco on Debian (Tomcat bundle)

Filed under: Alfresco — Tags: , , , — Lorenzo E. Danielsson @ 23:09

I have been playing around a lot with Alfresco of late. I’ll write some posts about what I have learned up to now, just in case it helps somebody out there.

Before we begin, here is what I’m using:

  • Debian Etch. For most part, these instructions should work on any Linux system.
  • Sun Java 6 (packages from Sid repository)


In this post I am going to use the Alfresco Tomcat bundle, which is available here. I will start by using all the defaults, which will use Hyperonic SQL as a backend database. This may not be a good idea in the “real world”, but is acceptable for testing. Most importantly, we should make sure that works before moving on.

Once you have downloaded Alfresco, you need to extract it. Perform the following (as root):

# mkdir /opt/alfresco
# cd /opt/alfresco
# tar zxf /home/lorenzod/dl/alfresco-community-tomcat-2.1.0.tar.gz

Of course, you will need to change the path in the last line to wherever you downloaded Alfresco to. If everything went well, ls should give you the following files (and directories):


Starting the server

Before you can start the Alfresco server, you need to set JAVA_HOME if you have not already done so. On my system, I did the following:

# export JAVA_HOME=/usr/lib/jvm/java-6-sun

(Check to make sure where your JDK is installed.) To save yourself from having to type this over and over again, add that line to file such as /etc/profile. That way JAVA_HOME will automatically be set for you.

Now you should be able to start Alfresco. Type (still as root):

# ./ start

Hopefully you will see this message:

Using CATALINA_BASE:   /opt/alfresco/tomcat
Using CATALINA_HOME:   /opt/alfresco/tomcat
Using CATALINA_TMPDIR: /opt/alfresco/tomcat/temp
Using JRE_HOME:       /usr/lib/jvm/java-6-sun

If, on the other hand, you get this message:

Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program

Then JAVA_HOME hasn’t been set properly. Go back and follow the instructions, properly this time. Once Alfresco is up and running, open a browser and go to http://localhost:8080/alfresco if you are browsing from the same machine that you installed Alfresco to, or http://your-server:8080/alfresco if you are browsing from a different machine.

If that doesn’t work, try http://localhost:8080 to make sure Tomcat itself is up. Depending on your hardware, it make take a while for Alfresco to fully pull itself up, so give it a little time and try again. Otherwise look at the log file (/opt/alfresco/alfresco.log), something you should do even if Alfresco does run properly.

Once you see the Alfresco dashboard in your browser, you can click around a little to familiarize yourself with the interface. At the top you will see a login link. Click there and you can log in. The only user that exists by default is admin with password admin.

Peeking at the log file

When you look at the log file there are some errors and warnings that you might see. I will try to explain them as we go along.

With the current set-up the only error you are likely to see is:

21:31:17,079 ERROR [org.alfresco.smb.protocol.netbios] NetBIOSNameServer setup e
rror: Address already in use

This indicates that you already have Samba running. This will prevent Alfresco’s own CIFS server from starting. To prevent this, stop the Samba server before running Alfresco. Note that this error will not prevent Alfresco itself from running, but you will not be able use its CIFS server.

Shutting down the server

To shut down Alfresco, go to /opt/alfresco and type ./alfresco stop. If anything goes wrong during shutdown, there may be some running Java processes on the system. Use ps to locate them, and kill them manually. Normally you shouldn’t have any problems shutting Alfresco down.


As you have seen, getting Alfresco up and running on Debian is not difficult. Next time, I will show you how to migrate the database to MySQL, and some of the common issues you are likely to encounter along the way.


Alfresco: Sending mails with Gmail

Filed under: Alfresco — Tags: , , , , — Lorenzo E. Danielsson @ 12:04

I’ve been struggling with this for some time, in part no doubt, due to my limited knowledge of JavaMail. But, I always make up for lack of (knowledge, intelligence, experience) with pure stubbornness. Anyways, just thought I’d record it here, since it seems there are others struggling with it as well.

I had set up a Gmail account that I wanted to use to with an Alfresco installation. Here is some basic information (not that I think it matters).

  • Server: Debian Etch (odd packages from lenny and sid)
  • Alfresco: Alfresco Tomcat Community 2.1.0
  • JDK 6: package from Sid (aptitude search/show it to get the gory details)

There are exactly two files you need to edit to get STMP with Gmail to work. They are both located in /opt/alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco (assuming that you installed Alfresco in /opt/alfresco.

The first is Open in your favorite vi clone and search for mail: Modify to look like this:

# Email configuration =
mail.port = 465
mail.transport.protocol = smtp
mail.username =
mail.password= asecretpassword
mail.smtp.auth = true
mail.smtp.socketFactory.port = 465
mail.smtp.socketFactory.class =
mail.smtp.socketFactory.fallback = false
mail.smtp.timeout = 25000
mail.smtp.starttls.enable = true

There, half the job is done. You will obviously need to modify the username and password (no will not work).

Now vi core-services-context.xml, find the section on mail (you can search for MAIL to find it quickly). Modify it to look as follows.

<!—                        —>
<!— MAIL SERVICE           —>
<!—                        —>

<bean id="mailService" class="org.springframework.mail.javamail.JavaMailSenderImpl">
  <property name="host">
  <property name="port">
  <property name="protocol">                            
  <property name="username">
  <property name="password">
  <property name="defaultEncoding">

  <property name="javaMailProperties">
      <prop key="mail.smtp.auth">${mail.smtp.auth}</prop>
      <prop key="mail.smtp.socketFactory.port">${mail.smtp.socketFactory.port}</prop>
      <prop key="mail.smtp.socketFactory.class">${mail.smtp.socketFactory.class}</prop>
      <prop key="mail.smtp.socketFactory.fallback">${mail.smtp.socketFactory.fallback}</prop>
      <prop key="mail.smtp.timeout">${mail.smtp.timeout}</prop>

You should now be set.

Test it

  1. Create a user for yourself if you haven’t already done so. Make sure you entered a valid email address in the email field (modify user if you didn’t).
  2. Select an existing space or create a new one. View space details.
  3. Find the option Manage Space Users and select it
  4. Invite a user. Select your user, and whatever role you want. Make sure you say Yes to sending an email to the user.
  5. When you are done and click finish, your user should have been added as a space user. If Alfresco freezes for a long time here then something is wrong and you need to go back and fix things.
  6. Check your personal email. There should be a mail from your Alfresco email user.

Good you are done, go and collect your money. Buy yourself a beer. And buy one for me too!

Create a free website or blog at