Archive for April, 2010

DD-WRT, OpenVPN, and Duh Tip #2

Sunday, April 25th, 2010

While attempting to fix the problems in my OpenVPN configuration using DD-WRT on my new router, I connected my laptop to the server, from behind the OpenVPN client machine. I was using it to peer at the OpenVPN logs. Of course, both OpenVPN connections are going to appear from the same address, the laptop behind the NAT router and the router itself so OpenVPN was never going to work for both at the same time. So, the duh tip #2 is to ensure only one OpenVPN connection is made from a single IP address.

DD-WRT, OpenVPN, DynDNS.org, and Duh Tip #1

Sunday, April 25th, 2010

My router that ran DD-WRT (WRT54G) died recently and I had temporarily replaced it with my LinkSys VOIP router. I also configured that router to use my dynamic DNS service (DynDNS.org). Upon replacing the broken router with a new one and correctly configuring it, I couldn’t get OpenVPN to work. I finally realized that on the server, when it tried to make the connection back to the client, it was using an IP address from DynDNS.org that was created by the VOIP box that had updated it with a local LAN address. So the tip is, make certain the IP address on the dynamic DNS site is correct – I had to log in and change it by hand because DD-WRT said it didn’t need updating, when in fact it did!

Flashing DD-WRT v2.4 onto Linksys WRT54GS v1.1

Wednesday, April 21st, 2010

Spent hours trying to install DD-WRT v2.4 onto the Linksys WRT54GS v1.1. Whatever you do, don’t do the 30/30/30 reset a second time; it will brick your router. I know. To recover, you must take out the circuit board and short pins 5&6 with a small screwdriver while plugging in the power. Within 30 seconds, you’ll need to tftp the new firmware to the device. This will get you back to working again. Make sure to use the Mini-Build required for initial flashing via TFTP. This will get you to a working router.

Rewriting the From: E-mail Header Using Sendmail and MIMEDefang

Wednesday, April 21st, 2010

I frequently give out email addresses using <yourdomain@mydomain.com>; this way I am able to track the source of spam I receive. It also easily enables me to reject future email to that account by adding a line to sendmail‘s access file along with a “pleasant” 550 response message when warranted. My problem has been how to send an e-mail using that address.

The solution is quite simple – I specify the address in the Reply-To field of my e-mail client and use MIMEDefang to add an action to change the From: Header to the Reply-To: header.

Fortunately, I already had MIMEDefang added into the mix as I use it and SpamAssassin for processing mail. I had some difficulty understanding where and how to add the logic in the mimedefang-filter perl script but finally found useful information at http://www.mickeyhill.com/mimedefang-howto/ and through searching archives of the MIMEDefang mailing list.

I don’t have any users that use Reply-To and so the determination of when to apply this is quite simple; if the mail originated on the local LAN and the Reply-To header exists and has an email address then change the From header to the Reply-To contents and delete the Reply-To header. You may need to alter the contents of the if logic.

This is accomplished with the following code, placed near the end of sub filter_end:

    # Rewrite From: header with Reply-To: if it exists
    if ($RelayAddr =~ "^192\.168\.1\." && $entity->head->get('Reply-To') =~ /@/) {
        action_change_header('From', $entity->head->get('Reply-To'));
        action_delete_header('Reply-To');
    }

Adobe Photoshop CS2 Issues After Full Restore to New Disk

Monday, April 19th, 2010

The disk on my MacBook Pro was going bad – S.M.A.R.T. reported imminent failure. I had Apple swap it out for a new one and I restored the new disk with my backup from Time Machine. Unfortunately, with the archaic way Adobe licenses its products, it was the only software I had purchased that did not work after the restore. After two hours online with Adobe support, I was not able to get much further.

After much trial and error, I determined the only way to get the software activated was to fully remove Photoshop CS2 and reinstall. I followed this technote from Adobe to manually uninstall Photoshop CS2, but it was incomplete. I had to remove a license file and only then could it activate successfully. In addition to the files Adobe asks you to remove, the real magic file that needs removal is /Library/Preferences/Adobe Systems/Product licenses_120/B2B86000.dat. After removing that, along with all the others, I was able to get CS2 installed on my machine and successfully activated.

stop spam with honeypot!