MySQL - SELECT INTO OUTFILE, with a UNION
Give this a Try 

SELECT * FROM
((SELECT email FROM table WHERE createdate &gt;= date_sub(now(), interval 1 year))
UNION DISTINCT
(SELECT email FROM table WHERE createdate &lt; date_sub(now(), interval 1 year) AND email not like '%@gmail.com')) A
INTO OUTFILE '/tmp/emailDump.txt' FIELDS TERMINATED BY "," LINES TERMINATED BY "\n";