Perfectly legal. You're not transferring it, and it's ownership isn't changing hands. Same reason why you can box up and FedEx a gun to a gunsmith; it's still yours, all he/she is doing is working on it.
However, that being said, I'd disassemble the weapon somewhat before boxing and shipping, just in case :) I had my father ship me my AR when I went out to Minnesota for a couple weeks, a while ago. Seperated it into upper and lower, boxed it up, and FedEx was more than happy to drop it off at my office. (I won't describe the looks on my officemate's faces when I opened the box to check it's contents, but anyway.)
Depending on the rifle, it'd be best to do that, simply so that if some dork X-Rays the thing looking for drugs, explosives, Usama, or a boxcutter...it won't explicitly and immeadiatly look like a rifle.