Coq Au Vin

23 July 2009

Ingrediants:

2 rashers rindless bacon

12 pickling onions

24 button mushrooms

45ml oil

125ml flour

2ml salt

freshly milled black pepper

8 chicken drumsticks or thighs

60ml brandy

625ml red wine

6 sprigs parsley

1 bay leaf 1 sprig thyme

2 cloves garlic

15ml flour

30ml water

chopped parsley

Set the oven at 180 degress. Cut the bacon into thin strips.

Skin the onions. Wash and trim the mushrooms. Heat the oil in the frying pan

and fry the bacon until all the fat has rendered. Place in a casserole.

Add the onions and mushrooms to the pan and sizzle for a minute or two then set aside.

Mix together the flour, salt and pepper and toss the chicken pieces to coat lightly.

Heat a little more oil in the pan and brown the chicken pieces.

Warm the brandy, pour over the chicken and flame. When the flames subside,

transfer the chicken to the casserole. Add the wine to pan, stir thoroughly and pour over chicken.

Tie the parsley,bay leaf and thyme together to form bouquet garni and add to casserole.

Peel and crush the garlic and add. Cover and bake for 1 hour, stirring occasionally.

Mix together the flour and water, stir into the sauce with the mushrooms and onions and cook

for a further 30 minutes.

Remove and discard the bouquest garni and garnish the casserole with chopped parsely.

serves 6

* Taken from the Quick ‘n’ Easy Chicken reciept book

restore email

23 July 2009

so you have a user who by accident deleted their emails and you have no backups. oh dear you say? well not if you are the mail administrator.

i’m running postfix with mailscanner. every mail that passes through gets archived, except high scoring spam ofcourse. the problem that i had was that i set the archiving to save it as a raw queue file so i could not just copy it into the mail queue and sends it off to the relavent people who it was intended for.

in anycase, i had to somehow search through the archive mail for the user’s email address, convert it into a format that i can just copy into the user’s mailbox without clogging the mail queue. yes, this will still duplicate those emails that were not lost, but that’s the user’s issue, not mine.

this is how find, postcat, sed and grep saved my life.

find and copy the user’s email and then convert it. (note – some of the directories you will have to create)

first we change directory to the archives

pop:~# cd /var/spool/MailScanner/archive/

then we use find and grep to search for the user’s email address and pipe it to a file

pop:~# find ./ -name “*” -exec grep -H user@domain.com {} \; > /root/extract/users/user/find.txt

then we cat the file and make it a little bit more neater to use

pop:~# cat /root/extract/users/user/find.txt | cut -c15-40 > /root/extract/users/user/user.txt

then we write a while command to actually move the emails to another directory

pop:~# while read i; do cp $i /root/extract/users/user/sort/ ; done < /root/extract/users/user/user.txt

then we change to that directory

pop:~# cd /root/extract/users/user/sort/

then we pipe the files in the directory to a file

pop:~# ls > ../list.txt

now we convert the emails to a format that you can just copy into the user’s mailbox on the mailserver

pop:~# while read i; do `postcat -v $i | grep “regular_text:” | sed “s/regular_text: //g” > ../extracted/$i.mbox` ; done < ../list.txt

now we move the emails to the user’s mailbox

pop:~# mv ../extracted/ /home/vpopmail/domain/user/Maildir/new/

change the permission on the folder

pop:~# chown -R postfix:postfix /home/vpopmail/domain/user/Maildir/new/

frustration

10 July 2009

i don’t know where to start with this post. as some of you know i have started a new job in town, which i will blog about next week sometime. this post is mainly a bitching session and a rant and rave.
my car gave me issues about 3 weeks ago when a water pipe burst. i sorted that out but then she would not start. so monday night Nick offered to tow my car all the way to a guy’s workshop to have a look at it. tuesday morning the guy has a look at it and says it’s a blown head gasket. cool…not too bad just gonna cost a couple of grand no probs. now being a bit low on cash and did not budget for this i decided to make a trip to the bank only to sit there for over an hour and spend a whole 50 seconds with the consultant to tell me no i can’t get a loan cause i started a new job and need to be 3 months employed. nice one absa, you just lost yourself a customer AND business, cheers.

now i take the bus to work to town which i must say is awesome, no traffic stress and all that stuff! anyhoo, when i first started going on the bus i got the shock of my life.

“1 ticket to cape town please” while handing over a R20 note.

“that’ll be another 70c”

“it is a oneway ticket you know”

“yeah, it’s R20.70″

so like, geeeeeeez….that’s more than i pay for petrol to town on my own. are they for real?
anyhoo, i payed that for a couple of days R20.70c. then yesterday i went with Carl to the bus station after i got to cape town and bought a weekly ticket. that gets clipped each time you ride the bus and it has a 2 weeks expiry date. so basically i buy one of these every 2 weeks (as i only take the bus to cape town…i take the train home). one of these weekly tickets costs me….wait for it….R67.50. let’s work it out. R67.50 divide that by 10 clips. R6.75. now where the hell is the logic in that? R20.70 without a weekly ticket but R6.75 with one? are they for real? if you buy a month ticket, it is even less! what a fraking ripoff!

no, not finished with the bus yet…this next one also frustrats the hell out of me. the bus to town in the morning runs from about 06h00 to 07h20. not too bad as most people start at 08h00 anyways. but now the reason i am taking the train after work is because i work till 17h30. the last bus out of town leaves at….17h15. now what the hell is up with that? most people work till 17h00. which would leave one to get to the station or a bus stop in 15 minutes. now the place where i work is about 20 minutes fast walk to the station. so if i finished at 17h00 i’d still miss the bus. why not make one last bus out of town leave at 17:35? if the last bus leaves at 17:15, how many buses actually leave at that time cause i am damn sure that bus would be full as hell.

reading over this post, i sound more mellow than anything else…hmmmm

postfix and it’s wonders

10 July 2009

I had a client ask me a while ago if i can block all email coming in for his domain but allow certain domains/emails to be able to send to him.

I managed to find an arcticle on it thanks to Winston!

Add this line to /etc/postfix/main.cf:

smtpd_restriction_classes = domain_class
domain_class =
check_sender_access hash:/etc/postfix/access_domain_class
reject

This will cause Postfix to pass the sender address of all e-mail classified as fredclass through the access table access_domain_class, and if it doesn’t get accepted there, it gets rejected.

The file /etc/postfix/access_domain_class should contain this sort of thing:

# These are for various technical reasons.
double-bounce@mx.mydomain.com OK
root@mx.mydomain.com OK
MAILER-DAEMON@mx.mydomain.com OK

# These are the good guys.
user@domain.com OK
domain.com OK

E-mail from the above addresses and domains to bob@domain.com will be accepted. All other sender addresses will be rejected.

After creating the file /etc/postfix/access_domain_class, run the postmap command on it:

hostname/# cd /etc/postfix
hostname/# postmap hash:access_domain_class
hostname/# /etc/init.d/postfix reload

Up to this point, we have only defined the class domain_class and created
the database file /etc/postfix/access_domain_class which says who is
permitted to send e-mail to bob@domain.com. Now we must tell Postfix
that all e-mail addressed to bob@domain.com is of class domain_class.

The main.cf should already have something like this:

smtpd_recipient_restrictions =
hash:/etc/postfix/access_recipient

This causes Postfix to pass the recipient address of all incoming e-mail through the table access_recipient.  In our case, we will not simply accept or reject e-mail to bob@domain.com. Instead we will just indicate that it is of class domain_class.

In the file /etc/postfix/access_recipient, this should appear:

bob@domain.com domain_class

This means that all e-mail addressed to bob@domain.com is classified as domain_class, which implies that the test check_sender_access hash:/etc/postfix/access_domain_class will be applied to all such e-mails in accordance with the rule in /etc/postfix/main.cf.

To activate the changes to the file /etc/postfix/access_recipient, do this:

hostname/# cd /etc/postfix
hostname/# postmap hash:access_recipient
hostname/# /etc/init.d/postfix restart

Powered by Wordpress   |   Lunated designed by ZenVerse