jhk753 / gmail-ruby-api

Ruby interface for Gmail API
Other
26 stars 20 forks source link

.delivered_to method can't deal with multiple deliveredtos (and returns the wrong one) #24

Open Carpela opened 9 years ago

Carpela commented 9 years ago

deliveredto is quite a useful filter when you're forwarding from another email. Unfortunately, the Delivered-To header information can occur more than once. Currently, the deliveredto: returns just the first one (which tends to be the account you've forwarded 'to', where the most useful one is the account you forwarded 'from' which is where the original email was sent to.

Hope that makes sense, I'll have a look and see if it's straightforward.

Carpela commented 9 years ago

Ok. this is a serious one... Because it sets that email in reply. Ignoring the reply settings in gmail. i.e. it will send from the default send and won't send from the mail address it was coming into so behaviour is very different between gmail and the api here.

Carpela commented 9 years ago

I suspect this is likely to get ugly In order to set the reply sending email correctly you'd need to know whether the email is listed as a send_as address. For that you need the email settings api as I can't see a way of doing it through the gmail api.

You might want to put a warning on the reply docs stating that this behaviour will happen in the short term.

Carpela commented 8 years ago

Slihgt update on this. For what it's worth. With the new google api client (0.9) email settings are now accessible through the gmail API. this would make solving this a lot easier.