I am running a cron job that checks for new email on a Gmail account every minute. If any new mail is found, it triggers a receive function that begins as follows:
def receive(email)
# REPORT SOME INFORMATION ABOUT INBOUND EMAIL RECEIPT
puts "SUBJECT: #{email.subject}"
puts "#{email.class}"
puts email.to.inspect
puts email.bcc.inspect
puts email.from.inspect
...
end
I would like to process only email that addresses the system in the TO or BCC fields. The idea is that users should not disclose the various destination email addresses to others.
The problem is that this function cannot seem to pull BCC information from the TMail object that is passed as the "email" parameter to this object. TO addresses come through fine, but not BCCs.
Anyone know why this might be the case?