Monthly Archives: February 2009

Qmail Taps Extended

Problem

You're running qmail and you want to log as in "copy/archive/tap"  only the outgoing email messages.  Inter7, the creators of vpopmail have a nice solution in a patch named qmailtap.

This patch will actually give you the option to match a message's To and From addresses against a regexp and decide what to do with them, all in an easy to write configuration file but this solution will not differentiate between To and From so if any of them matches the regexp the messages will be copied.

If you would only want to log outgoing mail you could decide to log only the messages which have the From address set to a local account but since there's no way to know which of the From or To addresses  matched you can't do this.

Solution

I created another patch that would allow you to specify which address you want to match.

With the original patch to match everything To or From @domain.com and copy to copy@example.com  you would need a line like this in the configuration:

.*@domain.com:copy@example.com

With the new patch if you only want to log the messages with the From address @domain.com you would set the configuration like this:

F:.*@domain.com:copy@example.com

If you want to log only those with the To address @domain.com

T:.*@domain.com:copy@example.com

if you want the same behavior as the original patch:

A:.*@domain.com:copy@example.com

Note: When writing multiple rules you have to consider how qmail-queue works after this patch
For each message qmail-queue looks at the From address first and tries to match it against the lines
starting with F: or A:.   When it finds a match it copies the message and stops.
If it didn't find a match in the F: or A: lines  it will try to match the To address against
the T: and A: lines.

Download

If you have not applied qmailtap patch yet here is the new full patch:

[download#3]

If you have already applied the qmailtap patch here is a patch you have to apply to obtain the new functionality:

[download#4]

Got any questions ? Or maybe you have other solutions... hit the comments!

This week on twitter 2009-02-22

  • Download Debian Linux 5 Lenny ISO / CD / DVD Images http://ff.im/14vqe #
  • @noahkagan isn't bill.com mostly used in the port industry? #
  • @hacool I was hoping this would actually show me how to make a real cloud 😀 in reply to hacool #
  • iBelieve http://ff.im/14XoV #
  • RT: @improvingtheweb: RT @NicoleSimon exactly the reason y I only post very selective content & photos 2 facebook http://tinyurl.com/ca4r2l #
  • if you're looking to host your own photos gallery2 is a cool script #
  • 10 stonking email marketing systems reviewed. http://ff.im/157rY #
  • RT: @StephanieSAM: This is pretty good! RT @barbaraling: 10 Tips for Using Twitter And Email Marketing for B2B http://tinyurl.com/7hf86b #
  • @ao12 si eu, le iau cu lada de la metro. 🙂 in reply to ao12 #
  • RT @Othella 20 Expert WordPress Tips for Pro-Developers http://bit.ly/19nwI6 #
  • have shared hosting ? could you use it as a socks proxy: http://tinyurl.com/bzqtrt #
  • 20 Expert WordPress Tips for Pro-Developers | StylizedWeb.com http://ff.im/15wyD #
  • Inter7 - http://ff.im/15wyC #
  • RT: @denisecox: RT @StephanieSAM: Anyone doing email mrkting in Europe? Please take our survey! Pls RT http://bit.ly/gby6k #
  • tied to play with mozilla's cloud editor ( bespin ) but it's just too slow for me #
  • The rational marketer (and the irrational customer) http://ff.im/167dn #
  • Authenticity http://ff.im/168IC #
  • playing with zend Framework, second try... first time I got bored before I managed to actually do something with it #
  • @AlexVolocaru CAN-SPAM doesn't require double opt in, that's why many see it as a law that's actually encouraging spam in reply to AlexVolocaru #
  • @AnnePMitchell probably not many 🙂 in reply to AnnePMitchell #
  • Mahalo Caught Spamming Google With PageRank Funneling Link Scheme : SEO Book.com http://ff.im/16xOw #
  • seems like Zend Tool only works with 1.7.4 not the latest 1.7.5 #
  • @wllm it doesn't . It throws an error cause it can't find CodeGenerator in reply to wllm #
  • @wllm I gave up. Again! Just too much work to do before I actually get to do the REAL work. Feels like bureaucracy in reply to wllm #
  • @wllm yes exactly. But I found no indication about where I could get Zend_CodeGenerator. I ended up using 1.7.4 which worked well in reply to wllm #
  • cum poti sa pleci de la Cluj si sa ajungi in Bucuresti in jur de ora 13-14 ? #
  • wy did my blog' #
  • ok...sloppy fingers ... #
  • why did traffic on my blog (http://patchlog.com) double since yesterday ? I did nothing. Is there something wrong with wordpress stats? #
  • oh I found out what the problem was. I installed this the wp toolbar : http://tinyurl.com/d9xcms #
  • ... and now for every outgoing click I get two extra 'views' #
  • The Great Email Debate - Topic #1 - The Opt-In Box: Checked or Un-Checked http://ff.im/17KJ9 #
  • It’s All About You http://ff.im/17KJd #
  • thanks for spamming me with twine... good bye 🙂 #
  • I can't believe it ... google using asp ??? check out the link to "online registration form" on this post: http://tinyurl.com/594zeb #
  • I got an invitation to try the Zend Server beta. anyone tried it yet? #
  • Saki's Ext Examples http://ff.im/18rWU #
  • Plugin Authors, Are you making the best of Readme.txt? http://ff.im/18sqd #
  • Worst Unsubscribe Practices http://ff.im/18sqe #
  • Yahoo Returns to its Roots: Annoying Ads http://ff.im/18sqf #
  • I wonder why a lot of blogs still don't have the "Notify me of followup comments via email" on the comment form ... #
  • hmmm....what could have changed between firefox 3.0.4 and firefox 3.0.6 that messes up the layout of my Extjs grid ? ... #
  • and why isn't Saki's example (http://examples.extjs.eu/gridinbl.html ) messed up ? #
  • @mihaibrehar re: "subscribe to comments...", good question. It's very useful. But the plugin is good enough. in reply to mihaibrehar #
  • writing a site scrapper ... actually just configuring one I wrote some time some time ago #
  • RT: @jowyang: I'm waiting to see examples of baby day car centers providing tweets to anxious parents to monitor. Practical? #
  • project on elance.com: Find users talking about a specific topic near a given city and prepare a list of outgoing tweets 2 these users #spam #
  • Twitter endorses certain accounts. Is it fair? http://ff.im/1abpH #

Powered by Twitter Tools.

HowTo: Shared Hosting as Socks Proxy

Problem

You need a proxy to connect to a service that would only accept connections from a certain location.

You have a shared hosting account on a server in location that is accepted by the service where you want to connect. Could you use it as a proxy server.?

You could install one of those proxy scripts made in php but that would only let you browse the web, what you want is be able to proxify any application and for that you need a socks server working with one of those proxifier applications  (like tsocks on linux/unix ).

So could you use a socks proxy on your shared hosting account?

Solutions

The solutions are listed starting with the most simple working on the most permissive hosting accounts and ending with the most complex suited for the least permissive accounts.
There will be further posts describing the solutions in detail. This post is mostly an introduction.

  1. SSH Tunnel

    This is the simplest but it assumes that your hosts allows ssh access to your account and they don't block ssh tunnels.

    1.  

    This creates a socks server on your local host , then you can use it in the proxifyer app to forward all connections through it.

  2. Custom SSH Tunnel

    This is a solution for those hosting accounts that don't allow ssh tunneling, but allow you to connect over ssh and run a program ( antinat - a socks server ) once connected over ssh.

    ( One might wonder: why create a tunnel when you could just run antinat and connect directly to it? If you can do that then that's the best way to do it but most shared hosting servers would have all ports blocked so you would not be able to connect to any port other then the standard ones ( 80,443,25,110,143, etc ) but those are only available to root and are already busy anyway. )

    The idea is to forward the traffic from your computer to the proxy server through the actual ssh connection instead of using the standard tunneling mechanisms which are blocked by server's configuration.

    For this you would need a program on your host to act both as a socks server ( sort of ) and as a forwarder through a ssh connection. On the other side ( hosting account ) you would need another program that would receive data from the ssh connection and forward it to antinat. Both programs would actually have to forward data both ways.

    Both forwarders would have to multiplex connections and forward them through a single ssh connection because most hosting accounts only allow one connection / user

  3. Callback Socks server

    This is a solution in case your hosting account has no ssh access.

    It's similar to previous solution but in this case instead of having the local forwarder connect to the remote ( hosting ) forwarder through ssh, you eliminate the remote forwarder and just have the socks server connect back to the local forwarder and then forward everything through that connection.

    This would require modification to the socks server as antinat doesn't have this callback feature built in.

    Another requirement is that you are able to upload and run antinat on the server. Usually you can do this by just calling it in a php script ( eg.: system('antinat') ) or from a perl script if the host offers cgi access.

  4. Custom script ?

    What if for some reason (no cgi or php system() blocked ) you can't run antinat?

    Well in this case I'm guessing it would be possible to write a script that you could call over a http connection, and forward through it, but php's socket functions would need to be available and script's max execution time would limit your connection time so don't expect much of this.

I have used solution #1 and I wrote the software and patches required to make #2 and #3 work. In the following weeks I'll write the posts to describe them in more details.

You can subscribe to my RSS feeds or connect with me on one of the social networks listed in the sidebar if you want to be notified when they are posted.

If you know other ways of doing this or ideas about my solutions I'd love to read about them in the comments.

This week on twitter 2009-02-15

Powered by Twitter Tools.

Twitter is just Twitter

The web is amazing. Every once in a while a new service appears that brings together so many people and gets so much popularity that everyone starts to look at it as the solution to everything.

Twitter is one good example of such beast. Started as a microblogging tool, made popular by high profile bloggers like Robert Scooble, seen as the hidden treasure of branding and marketing, twitter currently has about 5 mil users and growing rapidly. ( you know it's growing when you see spam growing 🙂 )

One of the greatest things about twitter ( from a developer's point of view ) is that it allows developers access to it's data through a simple API. This allowed a lot of companies and individual developers to write a large variety of web based services and applications from simple clients to power monitoring , pregnancy monitoring and alarm monitoring applications .

All these new apps being created everyday make people think what more can we do with twitter ? How can we make it solve all of our problems? ( can it bail out the banks ? 🙂 ) .

A few weeks ago this post on Marketing Pilgrim blog suggests twitter could become a payment gateway, three days ago someone wrote a post suggesting twitter search could be a threat to google , I still see tweets about that post.

I see the value in each of those apps, in some there is more in others less, I can see how twitter search can be very useful for certain things, but it could never replace a search engine in the way google, yahoo, live work.

I'm not saying people shouldn't look for innovative ways to use a service, but headlines like "twitter threatens google" seem more like link bait.

I actually think something like friendfeed.com would be more efficient as a search engine then twitter is but would still not match google's power.

Sure people based search is cool but what about most of the people who don't  live in twitter, what about the forums, the mailing lists, the blog comments, the pdfs, .doc?

This week on twitter 2009-02-08

Powered by Twitter Tools.

Ip alias with dhcp in ubuntu

Problem

You have a machine running ubuntu, NetworkManager gets the ip from a dhcp server and you want to have another ip that never changes on the same interface (for example if you want to also act as a dhcp server for your local network and both the local and uplink are connected on the same interface).

Dhclient seems to support this through an "alias" statement and NetworkManager seems to use dhclient but I just couldn't make it work like this.

Solution

Create a script in /etc/network/if-up.d/ . Name is as  you wish. My choice was "alias" .

  1.  

Then make sure the script is executable:

  1.  

You can replace the ip and mask to fit your needs.
NetworkManager will run this script automatically after it brings the interface up.

This worked for me but in the spirit of usability it would have been nice to have this kind of feature directly into NetworkManager's connection configuration gui.

Do you know any other way of doing this? Please share it in the comments.

This week on twitter 2009-02-01

  • ] #
  • that was my son's first tweet at 2 years and 9 months #
  • @vvladescu yeah but those times were more like 1997 not 2007 in reply to vvladescu #
  • RT @JackBastide: Don't Waste Time Vacuuming Under Furniture .. It takes Too long and No one looks there. Funny! #
  • I'm loving twhirl. Well maybe just liking it and also tweetdeck doesn't seem to work on Linux so... #
  • @segdeha why do you even care about that? just ask the server not to send it. #
  • @segdeha detect the user agent on the server side and make the server not send gzipped content #
  • @chrisbrogan I don't think there are many saying "we MSN" but quite a few saying: "google it" or "I googled it" #
  • Post from the Comments - Voices http://ff.im/KTjS #
  • Twitter, Chris Brogan, and Black Swans http://ff.im/KTjU #
  • RT: @lyndoman: If the Planet's gravitational field is not as strong everywhere, does that mean I can lose weight by moving house? #
  • TECH SOURCE FROM BOHOL: Linux Keyboard Shortcuts: Safe Way to Exit During System Freezes http://ff.im/Lbq0 #
  • RT: @corymiller303: chris talks about how he uses WordPress as a web app framework http://tinyurl.com/cc2gxe #
  • @brentnau I agree. You can see the same tips all over the web but it doesn't mean that's how he got 88k followers in reply to brentnau #
  • RT: @jenniev Checklist For Double Checking Your Email Marketing Campaign: http://budurl.com/889q #
  • @RetailEmailBlog having a donotreply address in any email message is just rude. If you don't want me to reply don't send me an email. in reply to RetailEmailBlog #
  • Worldometers - real time world statistics http://ff.im/LhTg #
  • @AlexVolocaru unbelieveble! cum ai dat de link-ul ala? in reply to AlexVolocaru #
  • @storming I find Linus's comments moderate compared to when he was picking up on the Gnome devs and started patching it himself in reply to storming #
  • @DaivRawks that site is scary 🙂 in reply to DaivRawks #
  • @AlexVolocaru lovely, go spammers go ! in reply to AlexVolocaru #
  • The goals you never hear about http://ff.im/Lli7 #
  • oh how I hate those sites with videos that automatically start playing when you visit a page #
  • why do some services insist on less then 15 character passwords ? I can understand a lower limit but why so small higher limits? #
  • RT: @stejules: How Do You 'Follow' 2,500 People on Twitter? http://bit.ly/p4Ra Many Twitter users adopt a "quality not quantity" strategy #
  • @homerj79 Email Marketing Done Right != spam in reply to homerj79 #
  • Compare Email Marketing Software Providers | Constant Contact | iContact http://ff.im/Me03 #
  • @ZaStef still have those chi.mp imvites? Can I have one? #
  • @clickio @RaduCeuca caca i-ar preocupa problema ar implementa email authentication si problema nu ar mai fi atat de grava in reply to clickio #
  • I wonder who came up with the idea of auto dm on twitter. The perfect example of a BAD viral idea #
  • RT: @LorenMcDonald: If U ask 4 my birth date during email opt-in, I expect a B-Day wish every year &/or offers relevant to my age - got it #
  • is http://chi.mp trying to be a whitelabel friendfeed ? #
  • @al3x I'm actually struggling to be less like that but it's hard. I still host my pictures myself in reply to al3x #
  • The Render Rate is Coming! http://ff.im/MD0U #
  • @grader could you not suggest I should follow people I already follow ? #
  • @teedubya screaming at the kids ti tell them to stop screaming is a good strategy to make yourself heard 🙂 in reply to teedubya #
  • Welcome to OpenVPN http://ff.im/MFum #
  • Really bad unsubscribe processes http://ff.im/N6kS #
  • @bracco wordpress would be good for all of that in reply to bracco #
  • Untitled http://ff.im/Nl0r #
  • when looking at a user's profile would be nice to see some bio and subscribed subscribers numbers like on twitter. I... http://ff.im/NmYX #
  • @divinewrite the new site looks great in reply to divinewrite #
  • @spam @_LisaBarone #
  • @LisaBarone just got followed by your fake personality @_LisaBarone #
  • FireScope http://ff.im/NIIJ #
  • one hundred push ups http://ff.im/NIII #
  • SpeedBlogging: How To Write Better Posts In Less Time — Copyblogger http://ff.im/NNCN #
  • Google Introduces A New Weapon In The Fight For Net Neutrality: Measurement Labs http://ff.im/O2T6 #
  • How to Draw a Manga Dog (with video) - wikiHow http://ff.im/O5bG #
  • is there any open source application like adobe AIR ? #
  • why doesn't anyone create a firefox extension/plugin that would turn firefox into an AIR like virtual machine? #
  • Google Gears seems somehow similar to AIR and is open source #
  • if you're a webmin user and you have to add a lot of ip addresses here's a simple way to do that: http://tinyurl.com/ct2lpb #
  • RT: @AaronMartirano: In order to succeed you must fail, so that you know what not to do the next time #
  • RT: @robertbasic: Thousands of video lectures from the world's top scholars - http://academicearth.org/ #
  • @Jimconnolly you're not wrong as long as you don't autofollow and you can handle the stream in reply to Jimconnolly #
  • @nonsequitir does moonlight allows you to write a web app with js and html then compile it into a "standalone" app ? in reply to nonsequitir #
  • @backtype when I comment on some blog posts ( ex. http://tinyurl.com/b5zus8 ) the entry in backtype shows the title of the blog not the ... #
  • I hate when I update from web and twitter just decides to cut everything over 140 chars. It would be a lot better to refuse to update #
  • @backtype here's the problem http://www.backtype.com/mihaisecasiu/comment/32961170 it shows the title of the blog not the title of the ... #
  • @backtype bog post ... sorry #
  • @Erik_James_ there wasn't any counter. Very weird. Also it's harder where there are long urls involved in reply to Erik_James_ #
  • @arronlock I find it interesting that some businesses and the public institutions still use it, some don't even have email but have a fax in reply to arronlock #
  • Yes, I did click the button!!! (WHAT!!??) #
  • if you're wandering what that last tweet was... I was testing clickjacking: http://tinyurl.com/7fh4kp #
  • 27 questions for your email marketing in 2009 http://ff.im/OVap #
  • @Erik_James_ I post mostly from twitterfox, but at times also from web, and more and more from friendfeed in reply to Erik_James_ #
  • I just tried the "Drain Holes" wp plugin for monitoring downloads but I like "Download monitor" a lot more. Any other... http://ff.im/P8Wv #
  • RT: @CraigTeich: QikBizTip: If ur looking for xtra $, 99% of time it's best to leverage your current biz than to look for side opportunities #
  • ugrading to ubuntu 9.04 alpha #
  • @nonsequitir on production. I like leaving on the edge 🙂 in reply to nonsequitir #
  • @nonsequitir you see the empty half of the glass. I like to think of it as "alfa is probably just as ready " 🙂 in reply to nonsequitir #
  • @nonsequitir ah well I'll see in a few minutes. Are you already running it ? in reply to nonsequitir #
  • @nonsequitir I have been a die hard gentoo user,but I'm slowly switching to ubuntu. I just don't have the time to compile everything anymore in reply to nonsequitir #
  • RT: @migueldeicaza: Linux kernel hacker Robert Love has a tasty cooking blog: http://food.rlove.org I will try the carnitas this weekend #
  • RT: @JackBastide: If you have a JOB be thankful BUT don't b complacent. Have a Plan B home based biz on the side theres good ones out there #
  • it seems like new ubuntu will use SHA512 instead of MD5 for encrypting system passwords #
  • Gustavo Duarte http://ff.im/PHq5 #
  • asking me to register to comment on your blog is just crazy #
  • is there any way to disable google's Warning - visiting this web site may harm your computer! #
  • i seems I get this warning for every link I click in google results #
  • @DominiqueGoh clearly something is wrong with it even wikipedia shows up as badware in reply to DominiqueGoh #
  • Install Flash 10 Under Ubuntu Linux 64 bit Edition http://ff.im/Q5iY #
  • @stejules I experienced the problem too. very frustrating 🙂 in reply to stejules #
  • Untitled http://ff.im/Ql3g #
  • I wonder what #
  • what's the percentage of 32 bit cpus still being sold ? #
  • and what's the percentage of 32 bit cpus estimated to still be in usage? anyone got any stats ? #
  • Harvesting Energy From Humans | Popular Science http://ff.im/QpBc #
  • TECH SOURCE FROM BOHOL: Free/Open-source Television Software http://ff.im/QqB2 #
  • @nonsequitir you can have something close to that.A coop search engine and tell it to search only in your social bookmarking profiles in reply to nonsequitir #
  • anyone have air + twhirl running on ubuntu 9.04 ? http://ff.im/QOYv #
  • RT: @chrisbrogan: Want to hear about online customer service? @avenuez has a guest post on my site about it: http://is.gd/hYZC #
  • Email campaign case studies (one good, one bad) http://ff.im/QQHK #

Powered by Twitter Tools.

Bttv Kworld tv tunner setup

Problem

Can't get a  Kworld KW-TV878RF ( bt878 chipset ) to work, tvtime-scanner doesn't detect any channel, dmesg shows the module as loaded ( running the  2.6.28-6-generic kernel on Ubuntu 9.04 alpha , but that's not the issue as it turned out ), but still no channel available.

Solution

Edit /etc/modprobe.d/bttv and add the following lines:

alias char-major-81 videodev
alias char-major-81-0 bttv
options bttv card=78 tuner=5 radio=1

The first two lines might not be needed but that's how I had them on gentoo, before I decided to install ubuntu.
The last line is actually telling the bttv drive the exact type of card you have.
For other cards the card number might be different.