OSX / Using Google Apps as a SMTP server

Scenario: You’re working from a home ISP connection or traveling, but would like to have your Mac send emails for jobs that have completed or other misc. notices without having to reconfigure each time. Since many ISPs block outbound SMTP servers on standard ports, forcing you to use their servers, this can be a headache.

I decided to use Google’s App/SMTP server to get around this as it uses a non-standard SMTP port and requires authentication. There are tons of guides on how to do this online, but none of them seemed to work for my setup. So, without further ado, here’s how to setup your mac, leveraging Google servers as a relay via Postfix:

First edit /etc/postfix/main.cf:

$ sudo vi /etc/postfix/main.cf

Add this to the end of the file:

myhostname = _HOSTNAME_
relayhost = [smtp.gmail.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_use_tls = yes
smtp_sasl_mechanism_filter = plain

Also, edit this line and adjust it to your preference, default is 1MB. I changed mine to 100MB since I send large logfiles:

message_size_limit = 100000000

Edit/create /etc/postfix/sasl_passwd. You’ll need to login to your Google account and create an app password. Spaces from this password are not required in this file:

$ sudo vi/etc/postfix/sasl_passwd

The format of the file should look like this:

[smtp.gmail.com]:587 user@domain:app_password

Modify the permissions of the password file to protect the contents:

$ sudo chmod 600 /etc/postfix/sasl_passwd

Next, hash the password. This will create a sasl_passwd.db file:

$ sudo postmap /etc/postfix/sasl_passwd

Restart the postfix services for the change to take effect:

$ sudo launchctl stop org.postfix.master
$ sudo launchctl start org.postfix.master

And finally, run a test:

$ date | mail -s "test 1 again” you@yourdomain.com

Check the queue for errors. Should report “Mail queue is empty” if everything went well.

$ date && postqueue -p

If you received the message, then you’re all set. Your OS can now send mail from anywhere in the world without having to worry about reconfiguring for local SMTP servers due to blocked ports.

Happy mailing!

Good ping, poor speed

I miss my home wifi. The hotel we’re in has horrible internet. And I’m gonna end up spending a fortune trying to constantly tether.. It’s gotten to the point where I walk the halls looking for wireless access points and repeaters, and start resetting them just to save the front desk time. Hopefully the appartments we’ll be in next week will be better.

Airfoil FTW

airfoil-mac@2x.png

Not sure how I missed out on this, but I Just discovered Airfoil for OSX and the companion iOS app Airfoil Speakers. This is a pretty fantastic app duo, allowing me to stream music from my Mac to an old unused iPhone which is connected to the stereo in my office without a physical connection. The audio quality is very nice, with only a second or so delay from the time that I change tracks, pause, etc.

Screen Shot 2015-11-11 at 3.11.09 PM.png

justa.fyi (seriously)

No, the title of this post isn’t rhetorical, I snagged the domain name justa.fyi from namecheap tonight and have it redirecting to my blog now. Such a cool domain, shocked that it wasn’t already taken. Not sure what I’ll end up doing with it, but for now it will point here.

Had another domain in the works as well, but due to regulations from the country that holds that TLD, I need to be a citizen or have a local mailing address to register it. a12s be on the lookout for a ping in the near future.

Where “SCRAM” comes from

The control room harkens back to a more analog era, when instruments on the wall looked like not much more than a piece of spiral graph paper behind glass and there was a noticeable lack of computer screens. There’s also the all-important SCRAM button, for emergency shut-down of the reactor. A museum sign explains the history of the acronym, which comes from an earlier plant, Chicago Pile-1, and a rather rudimentary-sounding emergency system.

The Chicago plant is notable for being the first to reach a state in which its nuclear-fission chain reaction was self-sustaining. Despite that achievement, however, emergency precautions at the time weren’t very high-tech, at least by today’s standards. Those precautions included workers suspending a thin rod of cadmium from a rope so that it dangled above a hole in the reactor. They used cadmium because it can slow down or stop a nuclear reaction by absorbing neutrons, hopefully stemming a disaster. But there was no automatic mechanism to make the cadmium fall into the hole. Instead, a museum sign explains, a “sturdy young male physicist stood by the rope, holding an axe.” (You can’t make this stuff up.) If something went wrong, he’d “swing his axe and cut the rope, plunging the rod into its hole and shutting down the reaction instantly.” That earned him the name “Safety Control Rod Axe Man,” now SCRAM for short.

Add this to the list of jobs I never want to have! Tour the World’s First Nuclear Power Plant via The Smithsonian Magazine.