Logs, Delivery

Hello Guys,
please help me to set the header as per the required logs,
below is the configuration set

kumo.configure_local_logs {
  log_dir = '/var/log/kumomta',
  max_segment_duration = '01 seconds',
  per_record = {
    Reception = {
      -- use names like "20230306-022811_recv" for reception logs
      suffix = '_recv',
    },

    Delivery = {
      -- put delivery logs in a different directory
      log_dir = '/var/log/kumo/delivery',
      suffix = '_dev'
    },

    TransientFailure = {
      -- Don't log transient failures
      enable = true,
    },

    Bounce = {
      -- Instead of logging the json record, evaluate this
      -- template string and log the result.
      template = [[Bounce! id={{ id }}, from={{ sender }} code={{ code }} age={{ timestamp - created }}]],
    },

    -- For any record type not explicitly listed, apply these settings.
    -- This effectively turns off all other log records
    Any = {
      enable = false,
    },
  },

Header needs to be set header_x-unique-id

Ok so first I’m going to say that if you don’t log transient failures you will someday have a headache trying to diagnose some issue, only to realize the server did not log the transient error.

ok

Now I honestly don’t have enough context yet to understand your question.

type,timeLogged,timeQueued,orig,rcpt,orcpt,dsnAction,dsnStatus,dsnDiag,dsnMta,srcType,srcMta,dlvType,dlvSourceIp,dlvDestinationIp,dlvEsmtpAvailable,dlvSize,vmta,jobId,envId,queue,vmtaPool,header_x-unique-id

Acutally my requirement is to set these headers in the log file

So what you want is the content of that header added to the log file?

not all the message header

The link is about adding a specific named header to the log.

ok let me check that

@yearning-hyena I have tried with the docs, you have suggest, when I am sending the mail it’s getting bounce, please find the logs below

{"type":"Bounce","id":"43f62047a02c11eeb1110aa6b44afef4","sender":"test@mg.us.aclmobile.net","recipient":"anshukla60@gmail.com","queue":"smtp.mailgun.org","site":"unspecified->smtp.mailgun.org@smtp_client","size":1734,"response":{"code":550,"enhanced_code":{"class":5,"subject":7,"detail":1},"content":"Relaying denied","command":"RCPT TO:<anshukla60@gmail.com>\r\n"},"peer_address":{"name":"smtp.mailgun.org.","addr":"34.160.157.95"},"timestamp":1703182249,"created":1703182247,"num_attempts":0,"bounce_classification":"AuthenticationFailed","egress_pool":"unspecified","egress_source":"unspecified","feedback_report":null,"meta":{},"headers":{},"delivery_protocol":"ESMTP","reception_protocol":"ESMTP","nodeid":"0d45e5bc-f144-461b-a219-f9b98dbcf813","tls_cipher":"TLS13_AES_128_GCM_SHA256","tls_protocol_version":"TLSv1_3","tls_peer_subject_name":["C=US","ST=Texas","L=San Antonio","O=MAILGUN TECHNOLOGIES, INC","CN=*.mailgun.org"]}

Have you tested your credentials to MailGun from the commandline on the server? Authentication failed as an error implies your credentials are incorrect.

yes

using telnet my mail is being delivered

You hand-telnet connected with TLS?

Paste pls.

ok

[root@ip-10-4-1-71 etc]# swaks --to ashutosh.shukla@sinch.com --from test@acl.pinchappmails.com --server 0.0.0.0 --port 587 --auth plain --auth-user sssssss --auth-password ssssssss --tls
=== Trying 0.0.0.0:587…
=== Connected to 0.0.0.0.
← 220 ip-10-4-1-71 KumoMTA
→ EHLO ip-10-4-1-71.ap-south-1.compute.internal
← 250-ip-10-4-1-71 Aloha ip-10-4-1-71.ap-south-1.compute.internal
← 250-PIPELINING
← 250-ENHANCEDSTATUSCODES
← 250 STARTTLS
→ STARTTLS
← 220 Ready to Start TLS
=== TLS started with cipher TLSv1.2:ECDHE-ECDSA-AES256-GCM-SHA384:256
=== TLS no local certificate set
=== TLS peer DN=“/CN=rcgen self signed cert”
~> EHLO ip-10-4-1-71.ap-south-1.compute.internal
<~ 250-ip-10-4-1-71 Aloha ip-10-4-1-71.ap-south-1.compute.internal
<~ 250-PIPELINING
<~ 250-ENHANCEDSTATUSCODES
<~ 250 AUTH PLAIN
~> AUTH PLAIN dsssssaaaaaddd
<~* 535 5.7.8 AUTH invalid
*** No authentication type succeeded
~> QUIT
<~ 221 So long, and thanks for all the fish!
=== Connection closed with remote host.