Gmail – auto forward email but change subject line

gmail

I'm trying to set up an integration with a help desk system that allows for us to automatically assign it to certain queues by either parsing the subject header or if it comes from a specific address.

Ideally I'd like people to be able to email a specific address and then this get forwarded to the helpdesk system's email address which can then add it to a specific queue.

However, I can't seem to find a way to both preserve the original sender (so the original user can be directly contacted and assigned to the ticket) and change the subject to add something that can be parsed by the system.

Using Gmail's auto forwarder will preserve the sender but I have no control of the subject header (or anything actually). Using Apps Script or IFTTT I can change the subject of the email and then forward it on to the right email address but then the email will be sent from the forwarding address rather than the original sender.

Is there a way to preserve the original sender's address but change the subject header? I was half hoping that I could fake the from: header using Apps Script but that doesn't appear to be possible other than from aliases of the Gmail account.

Best Answer

Short answer

Sending an email with an email from another user, in other words that you don't know they SMTP settings, is not possible with Gmail.

Explanaition

The feature of sending email messages from other addresses through the Google email servers was removed so, at this time, it's required that you know the email SMTP settings of the account that you want to use to send email messages.

By the other hand, if the email SMTP is not secure enough could be blocked by Gmail security filters (anti-spam, anti-spoofing, anti-impersonation, etc.). Example of security features of modern email services:

Alternatives

The "right way" is to use/build a help desk solution or CRM that includes features to assign email messages to variable pipelines without using SMTP. Further details on these are out of the scope of this site.

It's worth to say that there other sites in the StackExchange network that could be help you

References

Spam takes another hit: email authentication now available to millions of Google Apps customers - Official Google for Work Blog