PK œqhYî¶J‚ßF ßF ) nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/
Dir : /opt/sharedrads/oldrads/mailers/ |
Server: Linux ngx353.inmotionhosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64 IP: 209.182.202.254 |
Dir : //opt/sharedrads/oldrads/mailers/diskmovemailer.py |
#!/opt/imh-python/bin/python3 """Copyright 2011 Erik Soroka - InMotion Hosting, Inc. - e@inmotion.net - ext 834 This script connects to an SMTP server using smtplib and sends in disk move tickets """ # libs and other stuff we need import sys from smtplib import SMTP import datetime # smtp debug level, raise for more verbosity debuglevel = 0 # lets make sure we received the necessary arguments if len(sys.argv) < 2: print( '\nThis script connects to an SMTP server using python\'s smtplib and sends in' ) print( 'disk move tickets. The message body must be passed through a pipe/stdin.\n' ) print("Usage: cat filename |", sys.argv[0], "<username> <server>\n") sys.exit(1) # setup smtp server info/credentials smtp = SMTP() smtp.set_debuglevel(debuglevel) smtp.connect('mail.imhadmin.net', 25) smtp.login('lamar@imhadmin.net', 'QMgg-B+W35fL') # lets set variables based on arguments passed to us USERNAME = sys.argv[1] SERVER = sys.argv[2] # where our mail should come from from_addr = "IMH T3 Disk Management <no-replies@imhadmin.net>" # assign to addr from powerpanel result to_addr = "moves@imhadmin.net" # our subject subj = "DISK MOVE: " + USERNAME + " @ " + SERVER # fetch the date date = datetime.datetime.now().strftime("%m/%d/%Y %H:%M") # get the message from stdin message_text = sys.stdin.read() # send it msg = "From: {}\nTo: {}\nSubject: {}\nDate: {}\n\n{}".format( from_addr, to_addr, subj, date, message_text, ) smtp.sendmail(from_addr, to_addr, msg) smtp.quit() # EOF