1. Packages
  2. Artifactory Provider
  3. API Docs
  4. MailServer
artifactory v8.8.1 published on Wednesday, Apr 9, 2025 by Pulumi

artifactory.MailServer

Explore with Pulumi AI

Provides an Artifactory Mail Server resource. This can be used to create and manage Artifactory mail server configuration.

Example Usage

S

import * as pulumi from "@pulumi/pulumi";
import * as artifactory from "@pulumi/artifactory";

const mymailserver = new artifactory.MailServer("mymailserver", {
    enabled: true,
    artifactoryUrl: "http://tempurl.org",
    from: "test@jfrog.com",
    host: "http://tempurl.org",
    username: "test-user",
    password: "test-password",
    port: 25,
    subjectPrefix: "[Test]",
    useSsl: true,
    useTls: true,
});
Copy
import pulumi
import pulumi_artifactory as artifactory

mymailserver = artifactory.MailServer("mymailserver",
    enabled=True,
    artifactory_url="http://tempurl.org",
    from_="test@jfrog.com",
    host="http://tempurl.org",
    username="test-user",
    password="test-password",
    port=25,
    subject_prefix="[Test]",
    use_ssl=True,
    use_tls=True)
Copy
package main

import (
	"github.com/pulumi/pulumi-artifactory/sdk/v8/go/artifactory"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := artifactory.NewMailServer(ctx, "mymailserver", &artifactory.MailServerArgs{
			Enabled:        pulumi.Bool(true),
			ArtifactoryUrl: pulumi.String("http://tempurl.org"),
			From:           pulumi.String("test@jfrog.com"),
			Host:           pulumi.String("http://tempurl.org"),
			Username:       pulumi.String("test-user"),
			Password:       pulumi.String("test-password"),
			Port:           pulumi.Int(25),
			SubjectPrefix:  pulumi.String("[Test]"),
			UseSsl:         pulumi.Bool(true),
			UseTls:         pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Artifactory = Pulumi.Artifactory;

return await Deployment.RunAsync(() => 
{
    var mymailserver = new Artifactory.MailServer("mymailserver", new()
    {
        Enabled = true,
        ArtifactoryUrl = "http://tempurl.org",
        From = "test@jfrog.com",
        Host = "http://tempurl.org",
        Username = "test-user",
        Password = "test-password",
        Port = 25,
        SubjectPrefix = "[Test]",
        UseSsl = true,
        UseTls = true,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.artifactory.MailServer;
import com.pulumi.artifactory.MailServerArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var mymailserver = new MailServer("mymailserver", MailServerArgs.builder()
            .enabled(true)
            .artifactoryUrl("http://tempurl.org")
            .from("test@jfrog.com")
            .host("http://tempurl.org")
            .username("test-user")
            .password("test-password")
            .port(25)
            .subjectPrefix("[Test]")
            .useSsl(true)
            .useTls(true)
            .build());

    }
}
Copy
resources:
  mymailserver:
    type: artifactory:MailServer
    properties:
      enabled: true
      artifactoryUrl: http://tempurl.org
      from: test@jfrog.com
      host: http://tempurl.org
      username: test-user
      password: test-password
      port: 25
      subjectPrefix: '[Test]'
      useSsl: true
      useTls: true
Copy

Create MailServer Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new MailServer(name: string, args: MailServerArgs, opts?: CustomResourceOptions);
@overload
def MailServer(resource_name: str,
               args: MailServerArgs,
               opts: Optional[ResourceOptions] = None)

@overload
def MailServer(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               enabled: Optional[bool] = None,
               host: Optional[str] = None,
               port: Optional[int] = None,
               artifactory_url: Optional[str] = None,
               from_: Optional[str] = None,
               password: Optional[str] = None,
               subject_prefix: Optional[str] = None,
               use_ssl: Optional[bool] = None,
               use_tls: Optional[bool] = None,
               username: Optional[str] = None)
func NewMailServer(ctx *Context, name string, args MailServerArgs, opts ...ResourceOption) (*MailServer, error)
public MailServer(string name, MailServerArgs args, CustomResourceOptions? opts = null)
public MailServer(String name, MailServerArgs args)
public MailServer(String name, MailServerArgs args, CustomResourceOptions options)
type: artifactory:MailServer
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. MailServerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. MailServerArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. MailServerArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. MailServerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. MailServerArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var mailServerResource = new Artifactory.MailServer("mailServerResource", new()
{
    Enabled = false,
    Host = "string",
    Port = 0,
    ArtifactoryUrl = "string",
    From = "string",
    Password = "string",
    SubjectPrefix = "string",
    UseSsl = false,
    UseTls = false,
    Username = "string",
});
Copy
example, err := artifactory.NewMailServer(ctx, "mailServerResource", &artifactory.MailServerArgs{
	Enabled:        pulumi.Bool(false),
	Host:           pulumi.String("string"),
	Port:           pulumi.Int(0),
	ArtifactoryUrl: pulumi.String("string"),
	From:           pulumi.String("string"),
	Password:       pulumi.String("string"),
	SubjectPrefix:  pulumi.String("string"),
	UseSsl:         pulumi.Bool(false),
	UseTls:         pulumi.Bool(false),
	Username:       pulumi.String("string"),
})
Copy
var mailServerResource = new MailServer("mailServerResource", MailServerArgs.builder()
    .enabled(false)
    .host("string")
    .port(0)
    .artifactoryUrl("string")
    .from("string")
    .password("string")
    .subjectPrefix("string")
    .useSsl(false)
    .useTls(false)
    .username("string")
    .build());
Copy
mail_server_resource = artifactory.MailServer("mailServerResource",
    enabled=False,
    host="string",
    port=0,
    artifactory_url="string",
    from_="string",
    password="string",
    subject_prefix="string",
    use_ssl=False,
    use_tls=False,
    username="string")
Copy
const mailServerResource = new artifactory.MailServer("mailServerResource", {
    enabled: false,
    host: "string",
    port: 0,
    artifactoryUrl: "string",
    from: "string",
    password: "string",
    subjectPrefix: "string",
    useSsl: false,
    useTls: false,
    username: "string",
});
Copy
type: artifactory:MailServer
properties:
    artifactoryUrl: string
    enabled: false
    from: string
    host: string
    password: string
    port: 0
    subjectPrefix: string
    useSsl: false
    useTls: false
    username: string
Copy

MailServer Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The MailServer resource accepts the following input properties:

Enabled This property is required. bool
When set, mail notifications are enabled.
Host This property is required. string
The mail server IP address / DNS.
Port This property is required. int
The port number of the mail server.
ArtifactoryUrl string
The Artifactory URL to to link to in all outgoing messages.
From string
The 'from' address header to use in all outgoing messages.
Password string
The password for authentication with the mail server.
SubjectPrefix string
A prefix to use for the subject of all outgoing mails.
UseSsl bool
When set to 'true', uses a secure connection to the mail server.
UseTls bool
When set to 'true', uses Transport Layer Security when connecting to the mail server.
Username string
The username for authentication with the mail server.
Enabled This property is required. bool
When set, mail notifications are enabled.
Host This property is required. string
The mail server IP address / DNS.
Port This property is required. int
The port number of the mail server.
ArtifactoryUrl string
The Artifactory URL to to link to in all outgoing messages.
From string
The 'from' address header to use in all outgoing messages.
Password string
The password for authentication with the mail server.
SubjectPrefix string
A prefix to use for the subject of all outgoing mails.
UseSsl bool
When set to 'true', uses a secure connection to the mail server.
UseTls bool
When set to 'true', uses Transport Layer Security when connecting to the mail server.
Username string
The username for authentication with the mail server.
enabled This property is required. Boolean
When set, mail notifications are enabled.
host This property is required. String
The mail server IP address / DNS.
port This property is required. Integer
The port number of the mail server.
artifactoryUrl String
The Artifactory URL to to link to in all outgoing messages.
from String
The 'from' address header to use in all outgoing messages.
password String
The password for authentication with the mail server.
subjectPrefix String
A prefix to use for the subject of all outgoing mails.
useSsl Boolean
When set to 'true', uses a secure connection to the mail server.
useTls Boolean
When set to 'true', uses Transport Layer Security when connecting to the mail server.
username String
The username for authentication with the mail server.
enabled This property is required. boolean
When set, mail notifications are enabled.
host This property is required. string
The mail server IP address / DNS.
port This property is required. number
The port number of the mail server.
artifactoryUrl string
The Artifactory URL to to link to in all outgoing messages.
from string
The 'from' address header to use in all outgoing messages.
password string
The password for authentication with the mail server.
subjectPrefix string
A prefix to use for the subject of all outgoing mails.
useSsl boolean
When set to 'true', uses a secure connection to the mail server.
useTls boolean
When set to 'true', uses Transport Layer Security when connecting to the mail server.
username string
The username for authentication with the mail server.
enabled This property is required. bool
When set, mail notifications are enabled.
host This property is required. str
The mail server IP address / DNS.
port This property is required. int
The port number of the mail server.
artifactory_url str
The Artifactory URL to to link to in all outgoing messages.
from_ str
The 'from' address header to use in all outgoing messages.
password str
The password for authentication with the mail server.
subject_prefix str
A prefix to use for the subject of all outgoing mails.
use_ssl bool
When set to 'true', uses a secure connection to the mail server.
use_tls bool
When set to 'true', uses Transport Layer Security when connecting to the mail server.
username str
The username for authentication with the mail server.
enabled This property is required. Boolean
When set, mail notifications are enabled.
host This property is required. String
The mail server IP address / DNS.
port This property is required. Number
The port number of the mail server.
artifactoryUrl String
The Artifactory URL to to link to in all outgoing messages.
from String
The 'from' address header to use in all outgoing messages.
password String
The password for authentication with the mail server.
subjectPrefix String
A prefix to use for the subject of all outgoing mails.
useSsl Boolean
When set to 'true', uses a secure connection to the mail server.
useTls Boolean
When set to 'true', uses Transport Layer Security when connecting to the mail server.
username String
The username for authentication with the mail server.

Outputs

All input properties are implicitly available as output properties. Additionally, the MailServer resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing MailServer Resource

Get an existing MailServer resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: MailServerState, opts?: CustomResourceOptions): MailServer
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        artifactory_url: Optional[str] = None,
        enabled: Optional[bool] = None,
        from_: Optional[str] = None,
        host: Optional[str] = None,
        password: Optional[str] = None,
        port: Optional[int] = None,
        subject_prefix: Optional[str] = None,
        use_ssl: Optional[bool] = None,
        use_tls: Optional[bool] = None,
        username: Optional[str] = None) -> MailServer
func GetMailServer(ctx *Context, name string, id IDInput, state *MailServerState, opts ...ResourceOption) (*MailServer, error)
public static MailServer Get(string name, Input<string> id, MailServerState? state, CustomResourceOptions? opts = null)
public static MailServer get(String name, Output<String> id, MailServerState state, CustomResourceOptions options)
resources:  _:    type: artifactory:MailServer    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
ArtifactoryUrl string
The Artifactory URL to to link to in all outgoing messages.
Enabled bool
When set, mail notifications are enabled.
From string
The 'from' address header to use in all outgoing messages.
Host string
The mail server IP address / DNS.
Password string
The password for authentication with the mail server.
Port int
The port number of the mail server.
SubjectPrefix string
A prefix to use for the subject of all outgoing mails.
UseSsl bool
When set to 'true', uses a secure connection to the mail server.
UseTls bool
When set to 'true', uses Transport Layer Security when connecting to the mail server.
Username string
The username for authentication with the mail server.
ArtifactoryUrl string
The Artifactory URL to to link to in all outgoing messages.
Enabled bool
When set, mail notifications are enabled.
From string
The 'from' address header to use in all outgoing messages.
Host string
The mail server IP address / DNS.
Password string
The password for authentication with the mail server.
Port int
The port number of the mail server.
SubjectPrefix string
A prefix to use for the subject of all outgoing mails.
UseSsl bool
When set to 'true', uses a secure connection to the mail server.
UseTls bool
When set to 'true', uses Transport Layer Security when connecting to the mail server.
Username string
The username for authentication with the mail server.
artifactoryUrl String
The Artifactory URL to to link to in all outgoing messages.
enabled Boolean
When set, mail notifications are enabled.
from String
The 'from' address header to use in all outgoing messages.
host String
The mail server IP address / DNS.
password String
The password for authentication with the mail server.
port Integer
The port number of the mail server.
subjectPrefix String
A prefix to use for the subject of all outgoing mails.
useSsl Boolean
When set to 'true', uses a secure connection to the mail server.
useTls Boolean
When set to 'true', uses Transport Layer Security when connecting to the mail server.
username String
The username for authentication with the mail server.
artifactoryUrl string
The Artifactory URL to to link to in all outgoing messages.
enabled boolean
When set, mail notifications are enabled.
from string
The 'from' address header to use in all outgoing messages.
host string
The mail server IP address / DNS.
password string
The password for authentication with the mail server.
port number
The port number of the mail server.
subjectPrefix string
A prefix to use for the subject of all outgoing mails.
useSsl boolean
When set to 'true', uses a secure connection to the mail server.
useTls boolean
When set to 'true', uses Transport Layer Security when connecting to the mail server.
username string
The username for authentication with the mail server.
artifactory_url str
The Artifactory URL to to link to in all outgoing messages.
enabled bool
When set, mail notifications are enabled.
from_ str
The 'from' address header to use in all outgoing messages.
host str
The mail server IP address / DNS.
password str
The password for authentication with the mail server.
port int
The port number of the mail server.
subject_prefix str
A prefix to use for the subject of all outgoing mails.
use_ssl bool
When set to 'true', uses a secure connection to the mail server.
use_tls bool
When set to 'true', uses Transport Layer Security when connecting to the mail server.
username str
The username for authentication with the mail server.
artifactoryUrl String
The Artifactory URL to to link to in all outgoing messages.
enabled Boolean
When set, mail notifications are enabled.
from String
The 'from' address header to use in all outgoing messages.
host String
The mail server IP address / DNS.
password String
The password for authentication with the mail server.
port Number
The port number of the mail server.
subjectPrefix String
A prefix to use for the subject of all outgoing mails.
useSsl Boolean
When set to 'true', uses a secure connection to the mail server.
useTls Boolean
When set to 'true', uses Transport Layer Security when connecting to the mail server.
username String
The username for authentication with the mail server.

Import

$ pulumi import artifactory:index/mailServer:MailServer my-mail-server mymailserver
Copy

~>The password attribute is not retrievable from Artifactory thus there will be state drift after importing this resource.

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
artifactory pulumi/pulumi-artifactory
License
Apache-2.0
Notes
This Pulumi package is based on the artifactory Terraform Provider.