'how to configure 'send email' in jenkins by proxy

My Jenkins machine cannot connect to the internet. I want to configure Jenkins to work with a proxy server to send email. The startup parameter is:

-Dhttp.proxyHost=172.16.0.10 -Dhttp.proxyPort=3128

But it doesn't work.



Solution 1:[1]

Jenkins proxy settings are configured on the Manage Jenkins > Manage Plugins > Advanced tab.

If you can't get to that page in your Jenkins instance you will need to ask the person with Admin access to that Jenkins instance.

Solution 2:[2]

I configured the proxy by appending the below string in 'JAVA_ARGS' setting in '/etc/default/jenkins' and restart the Jenkins server.

 -Dhttp.proxyHost=172.16.0.10 -Dhttp.proxyPort=3128-Dhttps.proxyHost=172.16.0.10 -Dhttps.proxyPort=3128

Solution 3:[3]

You can configure the proxy properties on Manage Jenkins > System configurations. In this page you can find "Global Properties" configuration and in this part you have to push the "add" button and put there the HTTP_PROXY, HTTPS_PROXY and NO_PROXY properties. These proxy properties should contain the proxy configuration like in the operating system. You can see an example of this configuration in the next image:

enter image description here

You should replace the properties:

  • <$PROTOCOL> -> Proxy address protocol (http, https, ...)
  • <$USER> -> Proxy user authorization (If the proxy require it)
  • <$PASS> -> Proxy password (If the proxy require it)
  • <$PROXY_DNS> -> Proxy URL or Proxy IP
  • <$PORT> -> Proxy port
  • <$DNS1>,<$DNS2>,... -> URL where the proxy don't should be used

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Andrew Gray
Solution 2 Naren Chejara
Solution 3 JaGaln