source: mailjam/bin/postman-mta@ 15:8ae771653ffe

Last change on this file since 15:8ae771653ffe was 15:8ae771653ffe, checked in by Borja Lopez <borja@…>, 13 years ago

Added a postman-mta.conf version to be used in the tests

Added a script bin/postman-mta that will run the MTA client from a shell

Renamed the bin/postman_server script to bin/postman-server

Disabled the tests from tests/mta.py, as they are totally outdated and they
break the tests.

Replaced the old code in mta.Sendmail with a new mta.MTAClient class, which
contains code that actually *works* against a postman server (tests to come!)

Restructured the postman-mta.conf configuration file. The sections have better
names now (server, archive) and the archive section contains parameters which
names that reflect much better what they are used for.

Added a new parameter to the postman-mta.conf file (server.uri) that allows
us to set the uri to where any MTA client will have to connect, in only one
shorter line.

Fixed some typos in postman.config

Updated the setup.py script so the bin/postman-* scripts are installed
properly in the bin/ directory.

Added a function, proper_etc_path(), to the setup.py script so the path where
configuration files have to be installed is correctly set when building a
distribution/source package (still to be tested).

Updated the MANIFEST

File size: 648 bytes
RevLine 
[15]1#!/usr/bin/env python
2#
3# Run the Postman MTA client
4
5import sys
6from postman.mta import MTAClient
7
8def usage():
9 print """
10 Usage: postman-mta address < raw_email_data
11
12 address is a valid mailing list address
13
14 raw_email_data is the raw data (txt) that contains the information of
15 the email to be sent
16 """
17 return True
18
19if __name__ == '__main__':
20 if len(sys.argv) < 2:
21 usage()
22 raise SystemExit
23 try:
24 raw_email = sys.stdin.read()
25 except:
26 usage()
27 raise SystemExit
28 mta_client = MTAClient(address=sys.argv[1])
29 mta_client.get_raw_email(raw_email)
30 mta_client.run()
31
Note: See TracBrowser for help on using the repository browser.