Jump to Navigation

Feed aggregator

Automated twitter compilation up to 05 July 2015

David Goodwin - 12 hours 43 min ago

Arbitrary tweets made by TheGingerDog up to 05 July 2015

  • RT And it will be our own fault. 2015/07/04
  • RT One day our industry will have stringent regulation forced upon it, like all other industries that have gone before. 2015/07/04
  • RT After a heated debate with a prehistoric gentleman over the weekend I thought we should make ourselves clear.


  • RT It seems our secret is out! #phpnw15 is now launched – CfP & Blind bird tickets are available! bit.ly/phpnw15 2015/07/03
  • RT Thanks to this government each working class home has its own pool to enjoy the heat wave. Vote Tory.


  • RT Wow. https://www.youtube.com/watch?v=WWTRwj9t-vU #youlookdisgusting 2015/07/03
  • Didn’t last long. #bromsgrove


  • RT YOUR COMMENTS: Readers are full interest and sympathy for the plight of the England women’s World Cup team.


  • RT hitch, a scalable TLS proxy from the people that brought you Varnish j.mp/1THolq6 2015/07/02
  • RT Breaking: It’s possible to spoof the address bar in a fully patched Chrome browser. Bad day for HTTPS sites! seclists.org/fulldisclosure/2015/Jun/108 2015/07/02
  • RT A robot has killed a worker in a VW plant in Germany www.ft.com/fastft/353721 2015/07/01
  • And behold. The heavens opened and down poured the rain. Now ends the British summer! 2015/07/02
  • RT If I could go back in time, I would have learned a lot less Windows and a lot more Unix 2015/07/01
  • RT Our first offender for the night. Explain this to the local magistrates.


  • RT PHP or Python contractor? Want to work remotely for a US based company? Get in touch. NO recruiters please. 2015/07/01
  • RT Looking at code I wrote 6 years ago. A reminder that what looks good today will be laughable at some point. Don’t take yourself too serious! 2015/06/30
  • RT Who else misses the days of early customer support for Smoothwall https://groups.google.com/forum/#!topic/alt.os.linux.smoothwall/FOsh2V79gvE%5B1-25%5D 2015/07/01
  • RT Coder Dilemma #6 – Choosing the right stack

    www.commitstrip.com/2015/06/30/coder-dilemma-6-choosing-the-right-stack/ http://t.co/oLR8U0ZXiD - embedded picture' alt='RT Coder Dilemma #6 - Choosing the right stack
    http://t.co/oLR8U0ZXiD - embedded image ' />


  • Good deed of the day done … (helping to push a broken down car out of the way) 2015/06/30
  • Schorchio! 2015/06/30
  • RT Greek bailout fund hits Indiegogo https://www.indiegogo.com/projects/greek-bailout-fund#/ 2015/06/29
  • RT Hi #WorcestershireHour, Bromsgrove Carnival is next week starting Friday 10 July with a free outdoor cinema in Sanders Park, see you there! 2015/06/29
  • RT Good evening #WorcestershireHour. Do any of you need to improve your speaking & presenting? Check out www.BromsgroveSpeakers.org.uk 2015/06/29
  • RT “Yet someone is clearly doing their job horribly wrong.” https://xkcd.com/463/


  • I turned off postfix’s greylisting last night.

    300 virus emails were intercepted by Amavis overnight.

    I think I’ll re-enable greylisting. 2015/06/29

  • RT Milton Friedman nailed it: Monetary Unity To Political Disunity bit.ly/1LOXyme @Frances_Coppola @azizonomics


  • RT @saulo_uk Hi Saulo, here are details of the @OpenRightsGroup Birmingham event I’ve organised. Hope you can make it! https://openrightsgroupbirmingham.wordpress.com/2015/06/28/come-along-to-the-1st-ever-open-rights-group-birmingham-meet-up/ 2015/06/28
  • RT Emergency support for Greek banks from European Central Bank – ELA – to be turned off, sources tell me www.bbc.co.uk/news/business-33303304 2015/06/28
  • RT Marriage used to be so simple. You’d meet a man, buy his daughter; make awkward conversation til she died in childbirth. What went wrong? 2015/06/27

python content_filter for Postfix (rewriting the subject)

David Goodwin - Wed, 01/07/2015 - 11:50

A python script which can be used as a Postfix content_filter to headers email going through it … (example shows changing the Subject).

#!/usr/bin/python from email import Parser import smtplib import sys import logging logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(levelname)s %(message)s', filename='/tmp/content-filter.log', filemode='a') # Get the CLI arguments. try: cli_from = sys.argv[2].lower() cli_to = sys.argv[4:] logging.debug("To / From : %r" % sys.argv) except: logging.error("Invalid to / from : %r" % sys.argv) sys.exit(69) # postfix will bounce the mail. retrying bad args won't work logging.debug("From : %s, to : %r" % (cli_from, cli_to)) # Get the email content from STDIN. content = ''.join(sys.stdin.readlines()) p = Parser.Parser() parsed = p.parsestr(content, True) #logging.debug("email source : %s" % parsed.as_string()) old_subject = parsed.get('Subject'); # remove the old header, and add a new one. del parsed['subject'] parsed['Subject'] = "New Subject -- " + old_subject # convert it back to a big string. content = str(parsed) # and let's try reinjecting it into Postfix. command = ["/usr/sbin/sendmail", "-G", "-i", "-f", cli_from, cli_to] stdout = '' stderr = '' retval = 0 try : process = Popen(command, stdin=PIPE) (stdout, stderr) = process.communicate(content); retval = process.wait() if retval == 0: logging.debug("Mail resent via sendmail, stdout: %s, stderr: %s" % (stdout, stderr)) sys.exit(0) else: raise Exception("retval not zero - %s" % retval) except Exception, e: print "Error re-injecting via /usr/sbin/sendmail." logging.error("Error resending mail %s -- stdout:%s, stderr:%s, retval: %s" % (e, stdout, stderr, retval)) sys.exit(75) # tempfail, we hope.
Subscribe to Wolverhampton Linux User Group aggregator

Main menu 2

by Dr. Radut