Monthly Archives: November 2012

Fedora sendmail setup. Tips for hosts/domains and masquerading.

Notes on my fedora sendmail setup.  I have had my fedora linux server setup for a couple of years with no email —  on purpose, to avoid spam hassles.  But to help my blog work better with plugins I decided to get this machine running sendmail.

I’ve done fedora sendmail setup before on another one of my servers, but it had been so long, I had to start from scratch.  I started by finding a good general setup guide.  This one on the fedora wiki was most worthy.

So the instructions were pretty straight forward.  Since I own my domain name and have a static IP address, the setup is easy.  So I followed the instructions and, well, it didn’t work. My first problem:

Fedora Sendmail setup emails bounced, because email is from user@localhost

So my first couple of test emails sent to my web account bounced back to me, they looked like this:

----- Transcript of session follows -----
... while talking to mx0.gmx.com.:
>>> MAIL From:<[email protected]> SIZE=665
<<< 550 5.1.8 Cannot resolve your domain {mx-us004}
554 5.0.0 Service unavailable

So I had to figure out why my server was putting [email protected].  I learned that my /etc/hosts file was setup wrong.  There’s lots of fedora tips on how to setup your hosts file (here’s a related posting), mine was setup wrong.  One tip, use the sendmail diagnostic tool, as follows:

# sendmail -d0.1 -bv root
[...]
 SYSTEM IDENTITY (after readcf) (short domain name) $w = myserver
(canonical domain name) $j = myserver.mydomain.net
       (subdomain name) $m = mydomain.net
            (node name) $k = myserver.mydomain.net
[...]

The above is good. Before I debugged my localhost problems, this command showed localhost in each of the domain name lines.  Also, for debugging, I recommend using the mail -vv (two v’s) command line option.  It’s easier than looking in the /var/log/maillog file.

Next problem: the emails were addressed [email protected]

The emails were working, but the From line should say [email protected].  I had to relearn how sendmail masquerading worked.  I had to setup the key parameters in the sendmail.mc file, as follows:

MASQUERADE_AS(`mydomain.net')dnl
FEATURE(masquerade_envelope)dnl
FEATURE(masquerade_entire_domain)dnl
FEATURE(allmasquerade)dnl
MASQUERADE_DOMAIN(localhost)dnl
MASQUERADE_DOMAIN(localhost.localdomain)dnl
MASQUERADE_DOMAIN(myserver.mydomain.net)dnl

But the masquerading wasn’t working.  When I went to the official sendmail man page for masquerade, it talked about the EXPOSED_USER option.  By default, sendmail assumes the root user never wants to be masqueraded.  Of course, I was troubleshooting my sendmail setup from the root login, so this option had me thinking something was wrong.  I turned of this option, and finally my fedorda sendmail setup was finished.  It took way longer than I thought it would and I felt it was worth writing up.

For reference, here’s what I changed in my sendmail.mc file:

define(`confLOG_LEVEL', `9')dnl
dnl EXPOSED_USER(`root')dnl
MASQUERADE_AS(`kozikfamily.net')dnl
FEATURE(masquerade_envelope)dnl
FEATURE(masquerade_entire_domain)dnl
FEATURE(allmasquerade)dnl
MASQUERADE_DOMAIN(localhost)dnl
MASQUERADE_DOMAIN(localhost.localdomain)dnl
MASQUERADE_DOMAIN(kozik2.kozikfamily.net)dnl
Freescale Watch Face

Freestyle Shark Watch Settings Instruction Sheet Too Small to Read

The Freestyle Shark Watch, the watch that I use for biking and kayaking is a worthy workout watch, but its physical design doesn’t always agree with me. The watch is programmed using four big knobby buttons. The buttons get accidentally set when I am doing activities that bend my wrist back and forth… easily done when paddling or riding.

I’ve had the watch get into funky modes where the time would disappear or the watch would beep every few minutes, and no combination of pressing buttons would restore the watch function, until I was able to get the instruction sheet out.

Well that brings up another issue, the instructions are printed in such small type that I can barely read it. Continue reading

Personal website now runs over https. Cheap SSL certificate from ClickSSL.

I wrote a personal single page web application and decided to setup an SSL certificate and run it over https, not http.  I setup the web server and iptables to listen to port 443. But when I accessed my application using https, I got a bright red screen warning me of security certificate issues for the web site.

(click for larger view)

I guess I don’t really need to get a certificate.  All I have to do is click “proceed anyway” and everything would still work. My app would be running over the Internet encrypted.  I didn’t like the user experience; I wanted to be able to use my app from any browser, securely.  So I decided to research registering my URL for an SSL certificate. Continue reading

Motorola-DROID-RAZR-MAXX-HD

Geotag images from Droid Razr Maxx camera. Exiftool fixes DateTimeoriginal timestamp

I was visiting South America, and I took pictures with my new Droid Razr Maxx.  To help me geotag the images, I also took along my GPS device; I know the camera has a GPS, but when you are traveling, Android data plans are too much, so I shut off the data service and only use voice+text. You can use voip phones melbourne for your business.

My usual photo work flow is to take the track file from my GPS device and  apply geotags to the jpg’s from my camera.  I have done this with my old phones, point and shoot, and fancy DSLR camera.  I love geotagging photos. Geotags remind me where the picture taken so that I can do a better job of putting captions on photos.

There are several opensource or commercial programs that can do the tagging function.  My favorite is the tool is Geosetter.  You load a track file (*.gpx) into Geosetter, you point the program at a directory of photos, and it matches the photo’s time stamp to the closest timestamp in the track file — that’s where it finds the lat/long coordinates.  Those are then inserted into the EXIF text of the image.

Just one problem:

the Droid Razr’s jpg files don’t have the DateTimeoriginal timestamp field populated.  Geosetter depends on that timestamp to be there.  “All” other camera use this timestamp to record the time the picture was taken (vs record that time the file was created).    Geosetter won’t work with these jpgs.

But, I found a geotag fix!!

You need to run a magic tool called exiftool.  The tool runs from a command prompt.  I know it is kinda of a hassle to run, but it will save you a bunch of hassle.  You need to change to the folder that is holding the jpgs that need to be fixed and you need to run the following command:

exiftool "-DateTimeoriginal<ModifyDate" *.jpg

After the tool is run, and you refresh the Geosetter (F5), then you see the Date Taken column filled-in.  (and the tool is now happy).

When this column is filled in, then you can run the “Sync with GPS” command and get the geotag information written into the jpg files.

It seems like a picky thing, but when you take 30 or more pictures on a trip, it is much easier to run a Geosetter tool than setting the geotags manually.

Just so you know, the installation of the exiftool is tricky.  Since I run Geosetter, exiftool is already installed, but hidden in the Geosetter Profile FIles directory.  To make exiftool work, you need to find the path it sitting in and update the system path environment varilable.  Kinda of a hassle.  Also, you will notice that before I ran exiftool, I created a backup directory and copied all the original jpgs, there, just in case exiftool hoses things up.