The ubiquitin-associated (UBA) domain of the mRNA nuclear export receptor Mex67 helps in coordinating transcription elongation and nuclear export by interacting both with ubiquitin conjugates and specific targets, such as Hpr1, a component of the THO complex. Here, we analyzed substrate specificity and ubiquitin selectivity of the Mex67 UBA domain. UBA-Mex67 is formed by three helices arranged in a classical UBA fold plus a fourth helix, H4. Deletion or mutation of helix H4 strengthens the interaction between UBA-Mex67 and ubiquitin, but it decreases its affinity for Hpr1. Interaction with Hpr1 is required for Mex67 UBA domain to bind polyubiquitin, possibly by inducing an H4-dependent conformational change. In vivo, deletion of helix H4 reduces cotranscriptional recruitment of Mex67 on activated genes, and it also shows an mRNA export defect. Based on these results, we propose that H4 functions as a molecular switch that coordinates the interaction of Mex67 with ubiquitin bound to specific substrates, defines the selectivity of the Mex67 UBA domain for polyubiquitin, and prevents its binding to nonspecific substrates.