Is there a limitation to the email headers that are settable from JavaMail? For instance, can you set the 'Received' header, indicating which server you're sending from?

Jeff Gay

There's no limitation as to the headers you can set using the JavaMail API. You can set any headers desired. Of course, once the message is sent, mail servers will add and change headers themselves, and ignore headers previously set. You can get more information on which "agents" set headers by reading the MIME standards.