IT Process Automation

 View Only
  • 1.  CA IT PAM can't send email (Send Email Operator)

    Posted Jun 07, 2022 08:18 AM
    I have a process that send email when is content isn't business, but the send email operator fails.

    The problem is return code is -1 and nothing else, is there some log file more detailed?

    I did a simple test for send email, the error is staying.

    The user name and password is correct. I have checked many times.

    In attach is settings for SMTP.

    Someone can help me? Thanks

    ------------------------------
    Regards,

    Felipe
    ------------------------------


  • 2.  RE: CA IT PAM can't send email (Send Email Operator)

    Posted Jun 08, 2022 02:26 PM
    You can try to use other server mail. I recommend to you download smartermail and try again using this server mail. If here is functional you need review your configuration.

    Also check if you have relay permision in the server mail 365.


  • 3.  RE: CA IT PAM can't send email (Send Email Operator)

    Posted Jun 15, 2022 02:28 PM
    Hey guys,

    I developed a workaround, basically I faced this problem because the security team disabled the legacy TLS version.

    For some reason PAM uses old TLS to send email, replace the email send operator with a powershell script.


  • 4.  RE: CA IT PAM can't send email (Send Email Operator)
    Best Answer

    Posted Jun 20, 2022 02:10 PM
    Edited by Felipe V Oct 06, 2022 10:07 AM
    <# 
    Autor:               Felipe Vandrilho
    Objetivo: Envia e-mail para subtituir o operador "SEND_EMAIL" do PAM
    #>
    # PARAMETROS
    [string] [Parameter(Position=0, Mandatory)] $email_usu = $args[0]
    [string] [Parameter(Position=1, Mandatory)] $email_pss = $args[1]
    [string] [Parameter(Position=2, Mandatory)] $email_dest = $args[2]
    
    # Retorna o conteudo do arquivo HTML como String no body
    $body_sem_cadastro = Get-ChildItem -Path "C:\temp\" -Name body-message.html | Get-Content | Out-String
    
    # USA TLS 1.2
    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
    
    #conversao passowrd em security string
    $email_pss_ss = ConvertTo-SecureString -String $email_pss -Force -AsPlainText
    
    #Objeto Credencial
    $credencial = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $email_usu, $email_pss_ss
    
    $smtp_cliente = @{
        From = $email_usu
        To = $email_dest
        Subject = "Não foi possível registrar a sua solicitação!"
        #Body = "<h1>TESTE 01</h1>"
        Body = $body_sem_cadastro
        Credential = $credencial
        SmtpServer = "smtp.office365.com"
        Port = "587"
        BodyAsHtml = $true
        UseSsl = $true
        Encoding ="UTF8"
    }
    
    Send-MailMessage @smtp_cliente
    
    # $Error[0] > "C:\temp\error-output.txt"


    ------------------------------
    Regards

    Felipe Vandrilho
    ------------------------------