Procmailrc Auto Reply with out Caching the email

February 11th, 2010

The other day at work I had to figure out how to accept a email give a reply to anyone that ever sends a email no matter how many times they email the address. Everything I could find had caching in it, with a little digging and poking around the web I found some information that lead me to this solution:

# Auto Reply without caching
# Creator: Richard Genthner
# Date 11-FEB-2010
#
# SENDER the email you want it to look like it came from
# SUBJECT What you want to change the subject to
# FILE the name of the auto reply message
SENDER=bob@example.com
SUBJECT="My Contact information has changed"
FILE=.autoreply_mesg

# Processor this will send the incoming message to /dev/null after sending a auto reply
:0 h c
* !^FROM_DAEMON
* !^FROM_MAILER
* !^X-Loop: $SENDER
| (formail -r -A"FROM:$SENDER" -A"X-Loop: $SENDER" -I"Subject:$SUBJECT";\
cat $HOME/$FILE) | $SENDMAIL -t
:0
/dev/null

Lets break this done in to sections. First we have is this:

SENDER=help@cfda.gov
SUBJECT="Our Support information has changed"
FILE=.autoreply_mesg

In this section we are setting the SENDER which is the email address that we want the message to look like. SUBJECT is the Subject we want to replace the RE: blah blah with something that is informational. FILE is the name if the file containing our message. In the next section we have the following bits:

:0 h c
* !^FROM_DAEMON
* !^FROM_MAILER
* !^X-Loop: $SENDER
| (formail -r -A"FROM:$SENDER" -A"X-Loop: $SENDER" -I"Subject:$SUBJECT";\
cat $HOME/$FILE) | $SENDMAIL -t

:0
/dev/null

So at first this looks cryptic but lets break it down line by line. So frist we have the :0 to accept anything then h and c tell procmail to keep a copy of the email just in case we need to process it more then in just this one block. * !^FROM_DAEMON says if its not from a daemon then proceed tot he next step. * !^FROM_MAILER means if not from a auto mailer aka mailing lists then proceed to the next step. * !^X-Loop: this mean is that if not a mail loop then proceed to next step. Which is the formail command. Let break this down by options, first we have -r which mean Generate an auto-reply header. This will normally throw away all the existing fields, then we have -A which allows us to apply custom information to the header fields, -I that any existing similar fields are simply removed. then we are cat’ing the auto reply file in the body of the message and then passing it off to the sendmail to send the file.

  • Share/Bookmark

Day with Flourish Library

June 3rd, 2009

So the other day i was surfing the web and have found a pretty neat PHP library called Flourish. At first was wondering why anyone would want to use a library instead of a MVC these days. I have to say after using its pretty neat. Coming from recent rails development I was missing ActiveRecord from rails in PHP but oh wait this library has Active Record. So i figured since there isn’t any tutorials on how to create a blog application with it. So look towards it in the coming days.

I wrote a simple application with it in about 30 minutes but the only reason i took at look was because the documentation is so good its like reading a book with a map. It has everything you would ever need but json-rpc and xml-rpc. Since this flourish library is in beta it might have those features soon or even just down the road. its pretty stable write now only a few bugs here and there but nothing major with patches all the time. So check it out.

  • Share/Bookmark

New Job Coming!!

June 3rd, 2009

I have a brand new job coming in a few days in washington,dc at Symplicity with my friend BP. I’m going to be a PHP developer working with from what i hear a great framework. This has made me spend sometime polishing up my PHP skills since i haven’t been doing much coding with PHP but with Ruby and Python. So far it has been pretty easy to polish them up. Like the old saying just like riding a bike.

  • Share/Bookmark

The Laid Off life!

May 20th, 2009

So a couple of weeks ago I got laid off from work! I have to say it sucks big time, but one thing I have to say is kinda of nice is the fact i can have more time to relearn things that i forgot while doing my last job. Also I can spend more time out doors mowing and doing things for my grandfather. So far in my Laid off life i have refreshed my mind of php, learned more rails, started to learn python in greater detail and oh yeah spent a ton of time looking for a job!

  • Share/Bookmark

Start of Summer

May 3rd, 2009

We finally got some green grass here in maine, it almost summer and I can’t wait for the swimming, fishing and camping this year with my wife.

  • Share/Bookmark

Work and plans

November 9th, 2008

Well i have been working two jobs enorder to try to get a head right now. Working two jobs has been making me think about going back to school for Electrical and Computer Engineering double major here in maine. I have been looking at the courses and they all seem pretty interresting. This means I would have to give up one of my jobs. The Problem is I enjoy both my jobs. I telecommute for a Denfense Contractor at night and durring the day I work for a local teleco/IT support company. Both are challenging and both are interesting. So the choice is hard. The local job I would have to drop to part time enorder to go to school if I was to keep it. The reason I’m rethinking my education is because my IT degree and in field work that I’m doing now really isn’t using it and its pretty boring most of the time. IT stuff is pretty much the same thing every day over and over, fixing laptops,desktops, servers and printers. So I think I’ll take some ECE classes and see how I like it.

I went to boston a few weeks ago to meet up with lucas and BP. We had a blast in boston for the weekend. We went to The People Republic, a Brizallian BBQ place where the girl that was our waitress was drop dead hot. We even did the Sam Adams tour was cool because we all got glasses from the tasting. It was cool to be in the boston pubs when the soxs are playing becuase it becomes alive and its like if everyone in the bar is cheering for the same thing. So that I believe brings us up to date.

  • Share/Bookmark

Well its been a while…

September 16th, 2008

Its been a while since i posted something on my site. So i’m going to make a list and cover each one in as much detail as I can.

  1. My Job
  2. Potential new project
  3. Pneumonia
  4. Projects

Ok, My job is interesting I have to deal with some intresting problems and not so cool things. I have been working my butt off doing things at my job that isn’t Code Releated and I have to say I’m starting to miss coding a lot.  Its been so long since the last time I have to code anything I have started to forget some of the simple things that I knew like the back of my hand. Other then missing coding, I have been doing a lot of stuff with Wireless Networks at work and Phone Systems I’m starting to get envoled with.

I might have the chance to work with AGIS,Inc and there LifeRing Application. Due to NDA’s and Confinidentuality agreements I can’t say much other then I have the chance to build a web interface for anyliss for it and the GOV. So thats all i can into for detail.

I came down with pneumonia this pass weekend and have been laid up on the couch since friday night. Which sucks because I hate not working when I know I can. I thought it was kinda odd, since this past friday we start bowling in a league under the name “The 4 Horse Men”.

I’m also working on a windows mobile application for tracking employees from there mobile device. I have been playing with trackme which is a applicaiton that basically does what I want with a little more. Except its a massive eater of battery on my HTC Titan Phone and the User can close the application. So Idea behind the one I’m writing runs a service in the background and stores 5 positions in a xml file then makes a data connection and pushes them to a database server then disconnects the phone from the data connection. This would make it a little more efficent on battery power. I’m working on a web interface for it that uses google maps to display and analize the data points.

So thats where I’m at this Point. I’m looking for more programming projects. Due to the Fact I miss it to much. My brain doesn’t feel like its getting much use doing IT work with any Programming for it to do. Nap time to so I can go to work tomorrow.

  • Share/Bookmark

Exchange 2007 and Windows 2008 Server

August 12th, 2008

Ok, let me be frank, I’m not much of a windows user anymore like I was pre-2005. I attend to use Unix or Linux for all my needs. My new job has required me to brush off my windows skills and rehone them. All I have to say is after dealing with Windows Server 2008 and Exchange 2007. Microsoft why the Hell can’t you leave layouts and way programs work? Exchange 2007 and Server 2008 panels and settings are so confusing by them making it what they call simple. I have to say windows 2003 and exchange 2003 were perfect in the layout and access policy. PLEASE Microsoft stop changing the server UI and compents of the UI for Server Applications. It feels like I’m speaking english and your speaking some screwed up language. I spend more time searching for shit then anything else.

End of my Rant! improvements to software is good as long as the user doesn’t feel like they have to learn something totally new.

  • Share/Bookmark

New Job, New Music

August 2nd, 2008

Well for the past week I have been at my new job work my tail off. For starters on the phone fixing a Exchange server with microsoft to fix a domain rename and get exchange to like it. Also this week, I worked on a Cisco System Router and ASA 5505.  I have to say the Cisco ASA’s rock I couldn’t believe how easy it was to setup and deploy. The company I work does a lot of high WIFI networking and i have to its interesting. I have to say so far its been interesting. It will be interesting to see what next week will bring to the table. We do a lot with phone systems using VOIP so it will be interesting to see when I get into the phone stuff, but I’m hoping that i just stay in the networking part with a main focus in the security aspect of things to be honest.  I also got the chance to learn on the spot how to terminate fiber multimode.

Also my buddy jeremy has introduced me to a lot of new music of the past couple of months and I have to say his latest find is awesome. The band is call the Old Crow Medicine Show below is a video clip of it. Its a got a turn of the century sound to them.

Old Crow Medicine Show — Wagon Wheel

  • Share/Bookmark

USSSA umpire exam

July 23rd, 2008

Well i have been busy studying for the umpire exam for slow pitch softball. What brings this on you ask? Well because of my cousin matt I have been playing softball all summer long. I’m a ok player but I think I would be a better manager or umpire. So I was talking to one of the umpires about how to be coming a umpire. So Neal told me to talk to Donnie who is the Chief Umpire for our league. At the last game we add Donnie gave me the rule book and told me where to go on the USSSA website to get the exam and casebook. I didn’t realize how much it was to umpiring to make sure that you stay fair to everyone. I personally believe the casebook is better study guide then the dam book. So I hope soon I’ll be a official USSSA umpire for slow pitch softball.

  • Share/Bookmark