Changeset 21:41e7bbc16e32 in mailjam for bin
- Timestamp:
- May 22, 2012, 1:29:55 PM (13 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- bin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
bin/mailjam-mta
-
Property exe
set to
*
r16 r21 1 1 #!/usr/bin/env python 2 2 # 3 # Run the PostmanMTA client3 # Run the Mailjam MTA client 4 4 5 import sys6 from postman.mta import MTAClient5 import argparse, sys 6 from mailjam.mta import MTAClient 7 7 8 def usage(): 9 print """ 10 Usage: postman-mta address < raw_email_data 8 msg = 'mailjam-mta: Mailing lists MTA client' 9 parser = argparse.ArgumentParser(description=msg) 10 parser.add_argument('-c', '--config', action='store', dest='config', 11 help='Set the path to a valid mailjam mta client configuration file') 12 parser.add_argument('-v', '--version', action='version', 13 version='mailjam mta client 0.1.0') 14 parser.add_argument('-a', '--address', action='store', dest='address', 15 required=True, 16 help='Set the address of the mailing list we want to manage') 11 17 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 parser.add_argument('-i', '--input', type=argparse.FileType('r'), 19 default='-', required=True, dest='input', 20 help="Pass the raw email to be send to the mailing list, Use - to allow incoming raw mails from a pipe") 18 21 19 22 if __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) 23 results = parser.parse_args() 24 if results.config: 25 mta_client = MTAClient(address=results.address, 26 configfile=results.config) 27 else: 28 mta_client = MTAClient(address=results.address) 29 mta_client.get_raw_email(results.input.read()) 30 30 mta_client.run() 31 31 -
Property exe
set to
-
bin/mailjam-server
r16 r21 1 1 #!/usr/bin/env python 2 2 # 3 # Run the Postman XML-RPC server 3 # Run the Mailjam XML-RPC server 4 # 4 5 5 from postman.daemon import PostmanDaemon 6 import argparse 7 8 from mailjam.daemon import MailjamDaemon 9 10 msg = 'mailjam-server: Mailing lists management server' 11 parser = argparse.ArgumentParser(description=msg) 12 parser.add_argument('-c', '--config', action='store', dest='config', 13 help='Set the path to a valid mailjam configuration file') 14 parser.add_argument('-v', '--version', action='version', 15 version='mailjam server 0.1.0') 6 16 7 17 if __name__ == '__main__': 8 daemon = PostmanDaemon() 18 results = parser.parse_args() 19 if results.config: 20 daemon = MailjamDaemon(configfile=results.config) 21 else: 22 daemon = MailjamDaemon() 9 23 daemon.run()
Note:
See TracChangeset
for help on using the changeset viewer.