SELECT Receiver, Subject, Message FROM m WHERE Sender='<your_name>'
UNION ALL
SELECT Sender, Subject, Message FROM m WHERE Receiver='<your_name>'
This will simply return the list of names that had contact with given name. You can manipulate this code to also return whether it was a sender or receiver
Edit (after exchanging comments)
This will show you last message from each conversation, whether a person you're looking for was a sender or receiver. The code is based on my temporary table, you have to tweak it a little bit to suit your needs.
SELECT MAX(id), conv, message FROM (
SELECT id , CONCAT(sender,'-',receiver) AS 'conversation', message FROM t
WHERE
sender = '<person>'
GROUP BY rec
UNION
SELECT id , CONCAT(rec,'-',sender) AS 'conversation', message FROM t
WHERE
rec = '<person>'
GROUP BY sender
) as t
GROUP BY convsersation, message
Explanation
In first subquery I am getting latest message for each conversation where person you are looking for was a sender.
Second subquery gives us the result of latest message for conversations where that person was a receiver.
CONCAT is used so we can merge conversations together
We wrap it in the main query that will output only MAX(id) which is the latest message.
If you need to know whether person in question was receiver or sender, you can add another column in the subqueries:
SELECT MAX(id), conversation, message, type FROM (
SELECT id , CONCAT(sender,'-',receiver) AS 'conversation', message, 'sender' AS 'type' FROM t
WHERE
sender = ''
GROUP BY rec
UNION
SELECT id , CONCAT(rec,'-',sender) AS 'conversation', message, 'receiver' AS 'type' FROM t
WHERE
rec = ''
GROUP BY sender
) as t
GROUP BY convsersation
(for some reason I can't make a code block on this second query, could someone edit it please)