Index: bin/mailjam-mta
===================================================================
--- bin/mailjam-mta	(revision 16)
+++ bin/mailjam-mta	(revision 21)
@@ -1,31 +1,31 @@
 #!/usr/bin/env python
 #
-# Run the Postman MTA client
+# Run the Mailjam MTA client
 
-import sys
-from postman.mta import MTAClient
+import argparse, sys
+from mailjam.mta import MTAClient
 
-def usage():
-    print """
-    Usage: postman-mta address < raw_email_data
+msg = 'mailjam-mta: Mailing lists MTA client'
+parser = argparse.ArgumentParser(description=msg)
+parser.add_argument('-c', '--config', action='store', dest='config',
+                    help='Set the path to a valid mailjam mta client configuration file')
+parser.add_argument('-v', '--version', action='version',
+                    version='mailjam mta client 0.1.0')
+parser.add_argument('-a', '--address', action='store', dest='address',
+                    required=True,
+                    help='Set the address of the mailing list we want to manage')
 
-    address is a valid mailing list address
-
-    raw_email_data is the raw data (txt) that contains the information of
-    the email to be sent
-    """
-    return True
+parser.add_argument('-i', '--input', type=argparse.FileType('r'),
+                    default='-', required=True, dest='input',
+                    help="Pass the raw email to be send to the mailing list, Use - to allow incoming raw mails from a pipe")
 
 if __name__ == '__main__':
-    if len(sys.argv) < 2:
-        usage()
-        raise SystemExit
-    try:
-        raw_email = sys.stdin.read()
-    except:
-        usage()
-        raise SystemExit
-    mta_client = MTAClient(address=sys.argv[1])
-    mta_client.get_raw_email(raw_email)
+    results = parser.parse_args()
+    if results.config:
+        mta_client = MTAClient(address=results.address,
+                               configfile=results.config)
+    else:
+        mta_client = MTAClient(address=results.address)
+    mta_client.get_raw_email(results.input.read())
     mta_client.run()
 
