Skip to content

Commit

Permalink
Merge pull request #1772 from fakhruddinhamid/master
Browse files Browse the repository at this point in the history
included option to set sender email
  • Loading branch information
olivierHa committed Dec 10, 2015
2 parents bf82026 + b7f9713 commit 1fe495f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libexec/notify_by_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ def get_shinken_url():

# Get current process user that will be the mail sender
def get_user():
return '@'.join((getpass.getuser(), socket.gethostname()))
if opts.sender:
return opts.sender
else:
return '@'.join((getpass.getuser(), socket.gethostname()))


#############################################################################
Expand Down Expand Up @@ -266,6 +269,8 @@ def create_html_message(msg):
help='Specify the $_SERVICEFIXACTIONS$ custom macros')
group_general.add_option('-r', '--receivers', dest='receivers',
help='Mail recipients comma-separated list')
group_general.add_option('-F', '--sender', dest='sender',
help='Sender email address, default is system user')
group_general.add_option('-n', '--notification-object', dest='notification_object', type='choice', default='host',
choices=['host', 'service'], help='Choose between host or service notification.')
group_general.add_option('-S', '--SMTP', dest='smtp', default='localhost',
Expand Down

0 comments on commit 1fe495f

Please sign in to comment.