Setup SMTP with groovy script

191 views
Skip to first unread message

Samuel Mutel

unread,
May 28, 2018, 9:13:57 AM5/28/18
to Nexus Users
Hello,

Do someone has a groovy script to setup SMTP inside nexus?
Or do you know what API I need you to use?
I checked the API here https://github.com/sonatype/nexus-book-examples.git but i didn't find something useful...

Thanks.
Regards.

Joseph Stephens

unread,
May 29, 2018, 7:44:57 AM5/29/18
to Samuel Mutel, Nexus Users
Hi Samuel,


def emailManager = container.lookup(EmailManager.class.name

and pass an instance of EmailConfiguration to setConfiguration e.g.

emailManager.configuration = new EmailConfiguration(
    enabled: true,
    host: 'host',
    port: 25,
    username: 'username',
    password: 'password',
    fromAddress: 'fr...@example.com',
    subjectPrefix: 'subject',
    startTlsEnabled: true,
    startTlsRequired: true,
    sslOnConnectEnabled: true,
    sslCheckServerIdentityEnabled: true,
    nexusTrustStoreEnabled: true
)

Thanks,

Joe 

--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users+unsubscribe@glists.sonatype.com.
To post to this group, send email to nexus...@glists.sonatype.com.
To view this discussion on the web visit https://groups.google.com/a/glists.sonatype.com/d/msgid/nexus-users/e5a0e8e9-42af-4875-a4b2-4141e7336fea%40glists.sonatype.com.
For more options, visit https://groups.google.com/a/glists.sonatype.com/d/optout.



--
Joseph Stephens

Danny Kulchinsky

unread,
May 29, 2018, 8:05:49 AM5/29/18
to Joseph Stephens, Samuel Mutel, Nexus Users

To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users...@glists.sonatype.com.



--
Joseph Stephens

--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users...@glists.sonatype.com.

To post to this group, send email to nexus...@glists.sonatype.com.
Reply all
Reply to author
Forward
0 new messages