How to escape a # in an email address


#1

I need to send notifications to an email address that has a “#” character in it. I have been unable to find a way to escape this character so that Nagios doesn’t interpret this as a comment. Any suggestions?

define contact {
    use    gen-contact
    contact_name    test-case
    service_notification_commands send-by-email
    alias    test-case
    email    #not-a-comment@domain.com
}

#2

$ seems to be the usual Nagios escape character, but that doesn’t mean it’ll work in this case.