It's not just UPS and FedEx.
It's any US Flag carrier. They all have contracts to handle US Mail.
The most succinct info comes from the FedEx website.
Candidates for jobs involving handling or access to U.S. mail cannot be considered for employment if they have resided outside the U.S., Guam or Puerto Rico for more than (6) six months during the last (5) years prior to today's date, other than the following verifiable exceptions: active duty in the U.S. Uniformed Service; trailing spouse or dependent of someone working for the U.S. government (military or civilian); missionary; student attending school in a foreign country; Peace Corps participant; employee of a U.S. based employer/company or other extraordinary circumstances.
i.e., if you left to fly for Emirates for the last 3 years, you are not eligible for a job at ANY US Flag carrier until you have been in the US for 5 continuous years.
http://ctlr.msu.edu/cotravel/FlagAirCarriersUS.aspx