Posts tagged: mail

How to get postfix to deliver root’s mail locally when using a smarthost

By , 2015-12-09 10:40

When setting up Postfix on Ubuntu/Debian as “Internet Site with smarthost” to use an external smtp relay, automatic e-mails intended for “root” (such as cron job error reports) get sent out to the smarthost with a To: address of [email protected]. This can cause a problem as the smarthost doesn’t know where to deliver these messages to, since myhost.mydomain.com has no MX record.

The fix for this is (go figure) in the Postfix README:

Delivering some but not all accounts locally

A drawback of sending mail as “[email protected]” (instead of “[email protected]”) is that mail for “root” and other system accounts is also sent to the central mailhost. In order to deliver such accounts locally, you can set up virtual aliases as follows:

1 /etc/postfix/main.cf:
2     virtual_alias_maps = hash:/etc/postfix/virtual
3 
4 /etc/postfix/virtual:
5     root     root@localhost
6     . . .

Translation:

Execute the command “postmap /etc/postfix/virtual” after editing the file.

Oddly, just adding the line

root: root@localhost

to /etc/aliases doesn’t work. You really need to do the steps outlined in the manual.

Using multiple Gmail accounts with mailto: links in Firefox

By , 2012-08-19 20:36

For a while now, Google has allowed you to sign in to multiple Google accounts and switch back and forth between them quite easily. Firefox also allows you to use Gmail as the default application for mailto: links.

This is all fine and dandy, until you click a mailto: link and decide you don’t want to send that e-mail using your primary Gmail account. In my case, this happens when replying to posts on craigslist. I always assumed there wasn’t a “clean” solution, resigning myself to copying and pasting the e-mail and subject lines, or even at times clicking the mailto: link on my Android phone, which allows me to select any account on my phone to send the e-mail from.

Finally decided to do some research and found a solution on the mozillazine forums.

To summarize:

  1. Go to about:config in Firefox
  2. Set gecko.handlerService.allowRegisterFromDifferentHost = true
  3. Open the Web Developer scratchpad. (Firefox> Web Developer> Scratchpad or Tools>Web Developer > Scratchpad)
  4. In the scratchpad, type the following line of JavaScript:
navigator.registerProtocolHandler("mailto",
  "https://mail.google.com/mail/b/[email protected]/?extsrc=mailto&url=%s",
  "Description of your Gmail Account");
  1. Repeat the line as many times as necessary, once for each of your Gmail accounts.
  2. Once you have created all the necessary lines, go to Execute > Run.
  3. The “information bar” will pop up in your main Firefox window, asking you if you want to add your Gmail account as a handler for mailto: links. Accept once for each account.
  4. That’s it. Now when you click a mailto: link, you’ll be prompted which Gmail account to use.

Custom theme by me. Based on Panorama by Themocracy