Changeset 1100


Ignore:
Timestamp:
Sep 7, 2012 11:23:37 PM (10 years ago)
Author:
jemian
Message:

working on getting the mail to also work on Ubuntu

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pvMail/src/PvMail/pvMail.py

    r1094 r1100  
    255255    global gui_object
    256256   
    257     email_program = '/usr/lib/sendmail'
    258257    from_addr = sys.argv[0]
    259258    to_addr = str(" ".join(recipients))
    260     mailprogram = "%s -F %s -t %s" % (email_program, from_addr, to_addr)
    261     mail_command = [mailprogram, "Subject: "+subject, message]
    262     cmd = '''cat << +++ | %s\n+++''' % "\n".join(mail_command)
     259
     260    cmd = 'the mail configuration has not been set yet'
     261    if 'el' in str(os.uname()):         # RHEL uses postfix
     262        email_program = '/usr/lib/sendmail'
     263        mail_command = "%s -F %s -t %s" % (email_program, from_addr, to_addr)
     264        mail_message = [mail_command, "Subject: "+subject, message]
     265        cmd = '''cat << +++ | %s\n+++''' % "\n".join(mail_message)
     266   
     267    if 'Ubuntu' in str(os.uname()):     # Ubuntu uses exim
     268        email_program = '/usr/lib/sendmail'
     269        # these commands aren't working!
     270        mail_command = "%s -f %s %s" % (email_program, from_addr, to_addr)
     271        mail_message = [mail_command, "Subject: "+subject, message]
     272        cmd = '''cat << +++ | %s\n+++''' % "\n".join(mail_message)
    263273
    264274    msg = "sending email to: %s" % to_addr
Note: See TracChangeset for help on using the changeset viewer.