I've shipped several rifles for work, gunsmithing, etc. I've always put them in a gun-sock, especially if they have nice wood, and placed them in a Plano, or similar hard case, and zip-tied the case shut through the lock holes. After that, I package it in an appropriate sized box padded with packing paper, bubble wrap, etc. I'm not sure that's the best way, but it's the way I do it. If your gun has really expensive wood on it, you may want to upgrade your case. I'm not saying to go out and buy a $300.00 Pelican, but something a little more bulky/rugged than the cheap Planos.
A good source I've found for long boxes are gun departments/stock rooms at sporting goods stores like Cabelas, Bass Pro, Sportsmans Warehouse, etc., or your FFL. FFL's are always getting boxes with long guns in them, and will most likely have several they'd love to get rid of. That's where I've gotten a bunch from lately.
Also, make sure you insure your rifle for the full replacement value.
Don't let UPS, Fed-Ex, etc., give you any crap either about shipping guns for repair. It's completely legal. Handguns are a different story, but still legal as long as the rules are followed. You are supposed to tell the shipping agent what you are shipping as well. It's best not to lie about it (i.e., machine parts, etc.). One time, I had one girl at UPS argue with me about shipping my barreled action off for restocking. I finally had enough, and asked to speak to her supervisor. I pulled out UPS's policy on shipping firearms, and showed it to the supervisor who apologized, and sent it on it's way. It's always good to have a copy of the shippers policy with you...... With UPS, long guns are sent ground, or upgraded if you desire, adult signature required. Also, you have to send it via a UPS customer center. It can't go through a UPS Store. Also, if the firearm was sent for repairs, and you legally owned it, then the gunsmith can ship it directly back to your home address, not your FFL.
You may already know this, but the following are some good links to look at when shipping firearms for repair:
UPS policy:
https://www.ups.com/content/us/en/resources/ship/packaging/guidelines/firearms.html
Fed-Ex policy:
http://www.fedex.com/us/freight/rulestariff/prohibited_articles.html
http://www.nraba.org/graphics/Benefits/RevisedServiceMatrix(2).pdf
USPS:
http://pe.usps.com/text/pub52/pub52c4_009.htm
All you ever wanted to know about shipping firearms, and general information:
http://www.gunbroker.com/Support/SupportFAQView.aspx?FAQID=1118&NoCount=1
http://americanshootingjournal.com/a-ups-drivers-suggestions-for-shipping-firearms/