• blog
  • gmail Auto Bcc

gmail Auto Bcc

gmailAutoBcc is a greasemonkey script that automatically BCCs (or CCs) all outgoing gmail emails to a specified email address.

Why?

Quite a few of us use gmail as a secondary email access tool. The common use is to forward all incoming email to a gmail address. Gmail already has custom from addresses, this allows you to use your gmail account to send and respond to emails using your old, primary (non-gmail) email address. The only limitation of this is that you wouldn’t have a copy of the emails you send from your gmail account at your primary email access location.

Where?

Install greasemonkey, then, right-click gmailAutoBcc to install. It’ll ask you for an email address the first time you click on ’send’ through gmail. If you’re on the newer version of gmail (Nov 2007), use gmailAutoBcc 2.0.

Tips, Tricks and Gotchas!

  • If you want it to cc an address instead of BCC, set the preference gBccHeader to cc
  • If you want it to prompt every time, set the preference gBccPopup to true
  • If you want to disable gmailAutoBcc, set the preference gBccEnabled to false
  • If someone else uses your browser to send emails from gmail, you might get a copy of their outgoing emails. (Cool ain’t it?)
  • Oh yeah, firefox only of course!

Setting Preferences in Firefox

To change any firefox preference, type about:config in the address bar and press enter. In the filter field, type the name of the preference. Double click on the result to change it.

Update (15th June 2006):

gmailAutoBcc now supports bcc/cc based on identities. i.e., it can bcc or cc to different addresses based on the from address being used. To enable this, toggle the preference gBccMapFromAddress to true. You’re prompted for a new bcc/cc address everytime you use a new “Identity” (from address). This is based on José’s request.

To remove bcc/cc for a particular identity (say, from@address.com), search for the preference gBccMail_from@address.com and change it to the string disabled.

If you do enable this feature, be prepared for a pop up the first time you send email from every one of your addresses.

Update (2nd November 2007):

It appears that gmailAutoBcc fails with “gmail 2.0″. I’m not on gmail 2.0 yet, but I promise to work on a fix as soon as I am.

Gmail 2.0 update (16th November 2007):

If you’re on the newer version of gmail a.k.a. “gmail 2.0″ (Nov 2007), use gmailAutoBcc 2.0.

82 Responses to “gmail Auto Bcc”

  1. I introduced this method in my website in Japanese.

  2. Thanks, Great!
    I introduced this method in my website in Japanese.

  3. Please explain:
    1. where can I find [set the preference]?

    2. can I “gmailAutoBcc” to more than 1 outside accounts?

  4. Elites1,

    1. Type about:config in your firefox addressbar to see preferences.
    2. You can enter multiple comma separated email addresses

  5. This doesn’t seem to do anything for me.

    Since the indicated prefs didn’t show up in about:config after installation, I experimented with manually adding the prefs á la

    user_pref (”gBccEnabled”,”true”);
    etc.

    to user.js in my Profile folder, but alas still no dice.

    The script seems not to respond to the “send” action in Firefox.


    Firefox 1.5.0.1 (Mac), GM 0.6.4

  6. Don’t know if its a Mac specific issue, can you try adding the following to user.js?
    user_pref("greasemonkey.scriptvals.http://jaidev.info/home/projects/gmailAutoBcc/Gmail Auto BCC.gBccEnabled", true);
    user_pref("greasemonkey.scriptvals.http://jaidev.info/home/projects/gmailAutoBcc/Gmail Auto BCC.gBccHeader", "bcc");
    user_pref("greasemonkey.scriptvals.http://jaidev.info/home/projects/gmailAutoBcc/Gmail Auto BCC.gBccMail", "email@address.here");
    user_pref("greasemonkey.scriptvals.http://jaidev.info/home/projects/gmailAutoBcc/Gmail Auto BCC.gBccPopup", true);

  7. Doesn’t work for me either in Windows Firefox 1.5.0.1 and GM 0.6.4

    Nothing happens when send is pressed and none of the listed preferences exist in about:config.

    Script said it installed correctly.

  8. No longer working for me either in Windows Firefox 1.5.0.1 (although it was working for a while - not sure what has changed). I tried removing and reinstalling it, but it never asked me for an email address the first time I clicked on “Send”. And none of the listed preferences appear for me either in about:config. Feel free to email me if you would like additional info. Thanks.

  9. Okay, I think I’ve got it.

    Gmail changed the id of the send button from “send” to “snd”. This broke the script.

    I’ve updated the scripts now.

  10. Excellent! Works correctly now - thanks for the quick fix!

  11. Thanks for the update. Works perfectly now.

  12. Actually, gmail didn’t change the ID of the send button in the french version, so Gmail auto BCC works only with the English interface. :-(

    I wrote a suggestion in the Gmail help, but I’m not sure weather it’s the right place for this or not… and I don’t know when they’re gonna fix it, so in the script, you should change :

    if (event.target.getAttribute(”id”) == “snd”) {
    to:
    if (event.target.getAttribute(”id”) == “snd” || event.target.getAttribute(”id”) == “send”) {

    Thanx for the script. It’s quite nice!

  13. Okay, didn’t guess that they’d not update the French version. Fixed it now.

    Thanks a lot Georges.

  14. Is it possible to have AutoBCC working with several different from: idendities?

    As far as I can argue, I only have the chance to set one (or more) BCC addresses, which cannot be changed according to the identity I am writing the email from under GMail…

    Cheers

  15. José, that’s a good idea, let me see what I can do about it.

  16. José, gmailAutoBcc now has bcc/cc based on identities. See update in the post above.

  17. Could it be that Google changed something again? I did the Firefox update and I can confirm that the (all) scripts does not work properly. Do I need to do the settings again?
    I doublechecked “about:config” and all settings for AutoBCC are set properly…how to activate them again?

    Cheers
    José

  18. I also updated GreaseMonkey. Could that be the cause?
    Can anybody please check?

    Thanks in advance.

    Cheers
    José

  19. Thanks again José, it was indeed a change in FF. I’ve updated the script now.

  20. Hi

    doesn’t work for me with Firefox 2.0.0.3

    Anyone else?

  21. Roger,

    What happened when you first clicked the send button?

  22. nothing at all. i tried manually editing the script as well but it had no effect.

  23. note that about:config doesn’t report any of the variables from the script. i’ve rebooted, restarted FF, and made sure GM is enabled, as is the script. any clues?

  24. another update after more probing; i don’t think my issue is specific to your script since after installing other GM script, they aren’t running either. so there must be an issue with my GM running in FF 2.0.

    suggestions appreciated.

  25. fixed! why GM was installed and enabled form the pull down menus, the icon in the lower right wasn’t highlighted. i clicked on the monkey and tried again. thanks and sorry for the multiple posts.

  26. Thanks for the clarification Roger!

  27. CAN YOU PLEASE INFORM STEP BY STEP PROCEDURE TO INSTALL GREASE MONKEY- REGARDS

  28. HOW CAN I SEE BCC ADDRESS IN MY INCOMING MAILS.

  29. Hello Jaidev,

    Now the Gmail has update to new vertion, on which the gmailautobcc can not work well.
    Wish you fix the code. Thank you.

  30. Hi Totoro,

    I’ll update the script when I am able to use the new version. As of now, I’m still stuck with the old version.

  31. Does this work with gmail for domain? I have tried to edit the website without much success. Is there a trick I’m missing.

  32. By my understanding, the “gmail for your domain” users are still on the older version. So you’ll probably have to install the older version.

    You’ll also have to change the line in the script which says http*://mail.google.com/* to your own domain.

    Again, I haven’t tried this nor do I have access to such accounts. But it should work.

  33. > If someone else uses your browser to send emails
    > from gmail, you might get a copy of their outgoing
    > emails. (Cool aint it?)

    I got caught by this one.
    Could the extension be modified to make the bcc: target (if any) dependent on who is the logged-in user?

    Thanks for considering it (& for providing this great script).

  34. I wrote:
    > Could the extension be modified …
    Sorry, I meant script not extension.

  35. Jason, you can enable gBccMapFromAddress to bcc only based on the sender address.

  36. For some reason the script isn’t working for me for the past few days, in Windows XP SP2 and Mac OS X (Leopard). I’ve tried older version and newer version, have tried to reinstall the script, etc., and no dice.

    Firefox 2.0.0.11 on the windows machine; I can check which version of FF 2 on the mac.

    Any ideas?

  37. I really like the idea, but cant get it to work. I am using Firefox 2.0.0.11 on Win XP SP2. First time it runs, it asks for the address, but nothing is ever sent.

  38. It looks like the update to gmail (which added colored labels) broke this script’s functionality… any chance on an update?

  39. @Claudio:

    Have you tried the new version? It works for me and I have gmail’s coloured labels.

    It could be an update by gmail that I am not seeing yet. In that case, I’ll have an update as soon as I see the new version.

  40. Mine was also working for many months, then suddenly stopped recently. Reinstalling didn’t work. Jaidev, do you still suppose you don’t have a recent gmail update?

    Thanks for the great script.

  41. PS: It still works on my Google Apps gmail account, which recently was upgraded. It seems as if there is a newer rev on Gmail….

  42. I last saw an update by gmail in the first week of Feb. That update didn’t affect gmailAutoBcc. (It still works for me).

    If and when I see an update on my gmail account, I’ll be able to fix the script.

  43. Thanks. Do you know of any way I can check my version to see if it’s different from yours, or otherwise figure out why mine isn’t working? It’s hard for me to believe it takes Google over a week to roll updates out to its user community.

  44. @zebra, I only figure out version changes by looking at the DOM layout, gmail’s source is quite complex otherwise. I assume you’re already using the new version — http://jaidev.info/downloads/gmailAutoBcc2.user.js.

    BTW are you on any locale other than english?

  45. Yes, I have been on the new version if your script for months. It was working until recently. I am only on the English locale. If there is anything I can send you (don’t know what “DOM” is) let me know. Thanks.

  46. Today my account (german) was updated to the new gmail (coloured labels) and I don’t get any bccs anymore, even with the new version of the script. If I enable popups, I get asked, but I don’t get bccs. :-(

  47. Same with me here: not working since the German Googlemail was updated. Please update your script quickly - it’s great!

    Oh, and can you please leave a comment here as soon as the script is updated:

    http://www.saphod.net/2007/04/26/no-permanent-bcc-in-googlemail/

    Thanks!

  48. hmmm.. GREAT idea indeed.. yet for some reason after following info on configs.. my gmail now faithfully.. as described.. popsup and confirms if i want to BCC the configured email address..
    THEN PROMPTLY DOES NOTHING?
    just seems to go nowhere?
    cant buy a clue here mates.. any clues appreciated & thanks for a great script.. MAKE MORE ;]]

  49. please adapt this script for work with opera.
    error console says:

    message: Statement on line 26: Undefined variable: unsafeWindow
    Backtrace:
    Line 26 of User JS script
    if (unsafeWindow.gmonkey) {

  50. Jaidev,

    It seems many people’s Gmail has changed versions now. Has yours? I’m looking forward to having a working script again. Thanks.

  51. Unfortunately, my version of gmail hasn’t changed and the script still works. Let me see what I can do.

  52. Let me know if I can be of any help - just tell me what I have to look for.

  53. I’d be happy to provide assistance on this - not working for me now for several weeks and I’d love to get it going again. I’ve got a programming background so would be able to help by getting you info or testing.

  54. the script stopped working for me a few days ago, although I had the colored label thing going for a while now. I hope you manage to fix the problem, since this script is very useful for me.

  55. There’s something really weird. I received an update and gmailAutoBcc still works. Are you guys on Firefox 3.0 or something?

  56. Not me. I have been on Firefox 2.x and have had problems with the script since I first posted. I have a Google Apps account; Gmail there gets updates more slowly. That account still works with the script, but my plain Gmail account does not.

  57. Hello. I’m using gmailAutoBcc 2.0 with FireFox 2.0.14 and newer gmail. The symptom I experienced was when I press “Cancel” at gBccPopup dialog, the dialog appears again and again until I press “OK”. After I changed line 71 of gmailautobcc.user.js from:
    > if (!(dst_field && (dst_field.getAttribute (”gid”) != “gBccDone”) || dst_field.value == “”)) {

    to:
    > if (!(dst_field && (dst_field.getAttribute (”gid”) != “gBccDone”))) {

    (that is, removed last condition), everything is working fine for me.

    Just a report.

  58. > everything is working fine for me.

    Sorry. I still have a problem. When I leave “compose” mode by “discard” button, gBccPopup dialog appears. That’s a little bit annoying. Maybe you should use button id (1etz and 1ety)??

  59. Thanks MAEDA. Yeah, there is a problem with the popup mode. The others seem to have a different issue. I’m trying to see if I can get access to an account that has received the gmail update.

  60. Could somebody tell me how to get this working for Google Apps for your Domain?

    Thanks for your help,

    Brendan

  61. Brendan,

    Just change the “Included pages” setting to:
    http*://mail.google.com/*

    That will encompass both regular Gmail and the Apps Gmail URLs.

    The only remaining issue is that your regular Gmail and Apps Gmail might be different versions, so the script will only work on one. Currently, my regular Gmail doesn’t work (newer version), but my Apps one does. A few months ago, it was the other way around (Apps Gmail version was too old). The two might always be playing leapfrog with versions. Hopefully Jaidev will find a fix for this.

    Speaking of which, Jaidev, any luck with that? Thanks.

  62. Ok, not sure what happened, but now the script is working for me again. I upgraded to Firefox 3 Pre 1, and then upgraded to the new version of greasemonkey. I also uninstalled the script and re-installed it, and now it works. I have no idea which of all my actions did the trick or what was wrong before.

  63. Two things I forgot to mention: when I posted my first comment I was still using firefox 2. Also, thanks Jaidev for the great script and the work you invest maintaining it. It makes my life better.

  64. @Yug, thanks for confirming the behavior and thanks for the compliments! Its a simple script and I need it on a daily basis. Thats the motivation ;-)

    @zebra et al, I’ve been trying on all machines / combinations / accounts that I can get my hands on - but I haven’t managed to get gmailAutoBcc to fail as you mention. I now believe gmail’s version has not changed (they never take this long to roll out updates to all users). Could you check if a greasemonkey update fixes things? You could also check the JavaScript console for any errors.

  65. A Greasemonkey update did not help. I have a Java console, which shows just a list of commands. I can’t find a Javascript console. Should I have one? Where is it?

    I have the following in the “Included Pages” box:
    http*://mail.google.com/*

    Will doing that duplicate the behavior on your end?

  66. I also tried reinstalling the script. Didn’t help. Then I tried the default “Included Pages” setting. Didn’t help. I tried enabling the Popup option in about:config. It did pop up, but clicking OK didn’t result in BCC being populated. Something must be failing after that stage.

  67. Ok, I just installed the script on another computer and got it to work, but it wasn’t trivial. I installed it on Firefox 3 and opened my gmail inbox in a tab. After trying several options, I finally did the following: I started composing a message, and while the composition window was open I closed the firefox application. A pop-up came out asking if I am sure I want out of this page - I confirmed.

    Since firefox was configured to remember previous tabs, when I then re-opened firefox it went back to composition mode in gmail, and before I could say Jack Robinson the autobcc script popup was asking me where I would like to bcc my messages.

    Zebra, can you try this out too?

  68. Yug,

    Before I try, can you confirm that the e-mail was actually sent with the BCC? I ask because I have no trouble with the popup if I have that option enabled. It’s just that it doesn’t actually add the BCC address to the message.

  69. ok, Zebra, I checked: it works for me, but perhaps you first need to quite firefox and restart.

  70. It’s not working for me either. It asked for the email address the first time but has never sent anything. The settings in about:config look correct (it has the email address I typed when it first ran). I’m using firefox 3, newer gmail (apps edition) and the new version of the script. Any suggestions?

  71. Yug,

    Well, I don’t know why I didn’t think of this before, but your approach absolutely should not work as you descrive.

    I tried your approach (even though it’s impractical to close Firefox each time I want to send a message). Of course it didn’t work as it did for you, since when reopening Firefox I am asked for a Gmail logon prompt. In fact, I’m puzzled that you weren’t too, since that implies a major security issue. After loging back into Gmail, it does not pull my composed e-mail back up, since after all I elected to discard it by navigating away from the page. Perhaps I don’t understand what exactly you did.

    Either way, we still have multiple people with this problem. Jaidev - is there any diagnostic I can run for you to help you figure this out?

  72. Zebra, the script works for me all the time, with no need to close and reopen firefox. I meant that you (may) need to do this once. Also, I don’t need to re-login into gmail every time I open firefox since I have it on ‘remember me on this computer’ - this puts a cookie that enables me to keep my login across several sessions. Can your problem be partly a cookie issue?

    In any case, there definitely seems to be something weird going on with that script and its interaction with gmail..

  73. [this damn security code!!!] :-)

    If this one works, it might help you to find the bug: http://userscripts.org/scripts/show/25195

    Dunno if that one works because I never used it.

    Sorry, Jaidev… normally, I would not point to a competitive script - but I want yours to work so that I can use it again! Please: find the bug SOON! :-)

    [man... get a different Captcha, please!] :-)

  74. Well, since this seems to affect very few users, it could be another greasemonkey script interfering with gmailAutoBcc. Could you guys let me know if you’re using any other scripts?

    Also, zebra, you could try looking at the JS console (a.k.a. error console) but you’d have to sift through a lot of chatter.

  75. Also, I’m sure most of you have tried this. But could you uninstall the script, clear all ‘gBcc*’ config items from ‘about:config’, reinstall the script and try?

    I’m fairly certain this is not a gmail update. The script continues to work for me and quite a few others, the issue must be something local to the users.

    If you guys could create a dummy gmail account and still see this issue, I could take a look if you send me the login.

  76. Well, what do you know….

    …recently my Google Apps Gmail address stopped working with the script, when it had been for months before. I changed nothing - still using the same script and settings, still using Firefox 3. I tested my Google Apps account functionality when I installed the Firefox 3 release, and it worked. It has stopped working since then. So now, both my accounts don’t work.

    It seems like Google upgraded Google Apps to match Gmail again. Jaidev - I have no other explanation. Have you added a dummy Google account? Can you try? I will try by adding a dummy account on my Google Apps domain.

  77. Thanks to Zebra, I was able to figure out the subtle change in gmail that caused the script to fail for a few of you. The problem doesn’t show up if you use multiple identities to send from gmail. The updated script is available at the usual URL.

  78. Thanks for fixing it! Both my Google Apps and regular Gmail account work great now.

  79. I get the following error on Firefox 3 using the latest Greasemonkey version:

    Script could not be installed [Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIChannel.open]” nsresult: “0×80520012 (NS_ERROR_FILE_NOT_FOUND)” location: “JS frame :: chrome://greasemonkey/content/utils.js :: getContents :: line 244″ data: no]

  80. Found this website dealing with the error mentioned above, but haven’t tried yet…

  81. Works! Yeah, I have it back! Thanks!

Leave a Reply