Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use html and change header from name #2466

Closed
seanfmark opened this issue Jul 5, 2018 · 3 comments
Closed

How to use html and change header from name #2466

seanfmark opened this issue Jul 5, 2018 · 3 comments

Comments

@seanfmark
Copy link

Hi!
I'm newbie on node.js using Haraka, Today i've success Install Haraka on my Centos 7 Server.
Now i want to ask how i can using html as Subject Body Email ? And How to change the Header from name ? like Picture on below

Header Name

Html Body Text

Thank you!

@jchook
Copy link

jchook commented Jul 6, 2018

Hey I am not an authority on the subject, but this looks like what you want:

The "From" header is a message header (as opposed to an SMTP envelope header). The HTML is usually embedded in a child of a multipart/alternative MIME body part.

Looks like you would use the transaction object to modify both the header and the body, perhaps in a plugin. Check out these functions:

  • transaction.set_banner(text, html) - append html to the bottom
  • transaction.add_body_filter(ct_match, filter) - arbitrarily filter body content
  • transaction.header
  • transaction.remove_header(key)
  • transaction.add_header(key, value)

Fortunately this has some MIME parsing built-in, though you have to set transaction.parse_body = true, and your filter must return the text in the same encoding.

Previously I achieved this functionality with Postfix filters + AlterMIME.

@baudehlo
Copy link
Collaborator

baudehlo commented Jul 7, 2018 via email

@jchook
Copy link

jchook commented Jul 18, 2018

Ah, I saw the title:

How to use html and change header from name

and this section of the OP:

And How to change the Header from name ?

Which I assumed meant he wanted to alter existing MIME headers/body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants