Class: Gitlab::Email::Hook::SmimeSignatureInterceptor

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/email/hook/smime_signature_interceptor.rb

Class Method Summary collapse

Class Method Details

.delivering_email(message) ⇒ Object


9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/gitlab/email/hook/smime_signature_interceptor.rb', line 9

def delivering_email(message)
  signed_message = Gitlab::Email::Smime::Signer.sign(
    cert: certificate.cert,
    key: certificate.key,
    ca_certs: certificate.ca_certs,
    data: message.encoded)

  signed_email = Mail.new(signed_message)

  overwrite_body(message, signed_email)
  overwrite_headers(message, signed_email)
end