This belongs in an iptables forum rather than a Moodle forum, but...
iptables operates on packets rather than on connections. When you make an SMTP connection (or any other type of connection), packets flow in both directions, so you need to make sure that you allow packet flow in both directions. You are allowing outgoing connections to the SMTP server by having an ACCEPT policy on your OUTPUT table, and not having any rules, but when the SMTP server replies, it hits the INPUT chain, sees that the packet isn't heading to the SSH, HTTP, or HTTPS port, so it gets dropped.
You'll want to use the conntrack module, and ACCEPT any ESTABLISHED packets (and it may also be a good idea to ACCEPT RELATED packets as well, though I don't think it's necessary for SMTP), which will cause iptables to realize that the incoming packets are part of the SMTP connection that you already initiated. (See also the Ubuntu iptables HOWTO.)