How to use "mime" in vacation or vacation-seconds - dovecot

I'm using "Pigeonhole Sieve Interpreter" in dovecot(http://wiki2.dovecot.org/Pigeonhole/Sieve), but there is a problem for me!
I want to use html code in vacation, I find the mime params. But there is no example about it! I only find a example in https://www.rfc-editor.org/rfc/rfc5230
in 4.4, but it is not work! Maybe,I have some mistake?
Who can give some more detail ?
Thanks!

vacation :subject "AutoReply${subjwas}"
:seconds 10
:handle "auto-resp" :mime "MIME-Version: 1.0
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding:base64
5aaI5aaI55qE5ZOHJm5ic3A7PGI+5Y2h5Y2h5Y2h5ZWK5ZWK77yBPC9iPg==";

Related

How to break long HTML string in email body

I have a long HTML string as my email body and I need to insert new line characters ("\n") to split the HTML into several lines, because mail servers have problems with long lines.
How do I do it without breaking the HTML tags?
I'm not talking about adding new line-breaks (<br>) in the HTML, I want to insert new line characters in the string so when mail servers fetch HTML line by line it shouldn't reach the line length limit.
For example:
If I have a HTML string:
<head><title>Enter a title, displayed at the top of the window.</title></head><body><h1>Enter the main heading, usually the same as the title.</h1><p>Be <b>bold</b> in stating your key points. Put them in a list: </p></body>
I want to insert new line-breaks:
<head>\n<title>\nEnter a title, displayed at the top of the window.\n</title>\n</head>\n<body>\n<h1>\nEnter the main heading, usually the same as the title.\n</h1>\n<p>\nBe <b>bold</b> in stating your key points. Put them in a list: \n</p>\n</body>
Many HTML emails use the quoted-printable encoding:
<head><title>Enter a title, displayed at the top of the window.</title></he=
ad><body><h1>Enter the main heading, usually the same as the title.</h1><p>=
Be <b>bold</b> in stating your key points. Put them in a list: </p></body>
In the above encoding, a trailing = marks the end of a line but doesn't break it. The original string can be reassembled by joining the lines accordingly.
Fortunately, there's no need to re-invent the wheel. The excellent Mail gem can do that for you: (and much more, you want to check out multi-part emails)
require 'mail'
mail = Mail.new do
content_type 'text/html'
content_transfer_encoding 'quoted_printable'
body "<head><title>Enter a title, displayed at the top of the window.</title></head><body><h1>Enter the main heading, usually the same as the title.</h1><p>Be <b>bold</b> in stating your key points. Put them in a list: </p></body>"
end
puts mail.to_s
Output:
Date: Wed, 03 Jun 2020 16:44:11 +0200
Message-ID: <5ed7b7...>
Mime-Version: 1.0
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<head><title>Enter a title, displayed at the top of the window.</title></=
head><body><h1>Enter the main heading, usually the same as the title.</h1=
><p>Be <b>bold</b> in stating your key points. Put them in a list: </p></=
body>=
Since you tagged your question ruby-on-rails, you might also want to check out Action Mailer.

Send plaintext / html mixed e-mails using mutt

I'd like to use mutt to send an mixed plaintext / html email.
Below won't work because the boundary id isn't set (of course).
mutt -s "mixed body test" me#mydomain.tld < plaintext_html_body.txt
Here a sample of a mixed e-mail which I sent from my Gmail account. This is more or less how the Source code of the e-mail should look like.
...
Content-Type: multipart/alternative; boundary=94eb2c088fb8697aed054afba7bf
...
--94eb2c088fb8697aed054afba7bf
Content-Type: text/plain; charset=UTF-8
This is a HTML Test
This is a HTML Test
--94eb2c088fb8697aed054afba7bf
Content-Type: text/html; charset=UTF-8
<div dir="ltr">
<span style="background-color:rgb(0,255,255)">
This is a HTML Test<br>
</span>
<span style="background-color:rgb(69,129,142)">
This is a HTML Test<br>
</span>
</div>
--94eb2c088fb8697aed054afba7bf--
Can mutt generate Content-Type: headers automatically (including boundary ids) or does it have any kind of mechanisms allowing to combine plaintext and html bodies?
If all breaks down, would manual generation of the entire body (including Content-Type: headers, boundary ids, both bodies) work?
Any alternative ideas?
Since mutt lets you edit email headers, you can manually insert a content-type line when composing a message.
Content-Type: text/plain; charset=utf-8
Subject: yadayada
You can probably go further and generate the boundaries and whatnot manually.
See also 'mpack' (ref: https://www.tecmint.com/send-email-attachment-from-linux-commandline/)

How to download a page with html form (post method) with wget?

I want use wget to get the result of this page http://smart.embl-heidelberg.de/smart/batch.pl
I click " Text-only output" on that page and specify the file for "Identifiers" as a file with the following content.
A0A183
Then I click "Submit query", which will lead me to the result page. I know that I should somehow provide the --post-data option to wget in order to download the result page. But I have difficulty in figuring out what this option should be. Could anyone let me how to figure it out? (I've try Chrome Devtools Network tab. But I'm not sure to get the --post-data option from there).
I also tried the following. But it generated an empty output file.
~$ cat /tmp/000.txt
A0A183
~/linux/test/perl/library/WWW/Mechanize/bin/mech-dump$ mech-dump --forms http://smart.embl-heidelberg.de/smart/batch.pl
GET http://smart.embl-heidelberg.de/smart/search.cgi
keywords=keywords... (text)
<NONAME>=Search SMART (submit)
POST http://smart.embl-heidelberg.de/smart/batch.pl (multipart/form-data)
IDS= (textarea)
SEQS= (textarea)
IDFILE= (file)
SEQFILE= (file)
TEXTONLY=<UNDEF> (checkbox) [*<UNDEF>/off|1/Text-only output]
LOOSE=<UNDEF> (checkbox) [*<UNDEF>/off|1/Substring matching for identifiers]
DO_PFAM=<UNDEF> (checkbox) [*<UNDEF>/off|DO_PFAM/include PFAM domains]
INCLUDE_SIGNALP=<UNDEF> (checkbox) [*<UNDEF>/off|INCLUDE_SIGNALP/include signal peptides]
<NONAME>=<UNDEF> (submit)
<NONAME>=<UNDEF> (reset)
~$ wget --post-data='IDFILE=/tmp/000.txt&TEXTONLY=1' http://smart.embl-heidelberg.de/smart/batch.pl
How about:
wget --post-data='IDS=A0A183&TEXTONLY=1' http://smart.embl-heidelberg.de/smart/batch.pl
I know this is old but got an answer that works with wget.
wget 1.13.4 or higher.
Check this post:
https://superuser.com/questions/86043/linux-command-line-tool-for-uploading-files-over-http-as-multipart-form-data
wget --header="Content-type: multipart/form-data boundary=FILEUPLOAD" --post-file 000.txt http://smart.embl-heidelberg.de/smart/batch.pl
000.txt
--FILEUPLOAD
Content-Disposition: form-data; name="IDS"
--FILEUPLOAD
Content-Disposition: form-data; name="SEQS"
--FILEUPLOAD
Content-Disposition: form-data; name="IDFILE"; filename="000.txt"
Content-Type: text/plain
A0A183
A0A182
--FILEUPLOAD
Content-Disposition: form-data; name="SEQFILE"; filename=""
Content-Type: application/octet-stream
--FILEUPLOAD
Content-Disposition: form-data; name="TEXTONLY"
1
--FILEUPLOAD--

What type of perl is this?

I need to debug some code that looks like the following. However, I don't know what language it's in. It appears to be a combination of perl and html. Could someone please let me know what exactly this is, so that I can do future research?
//All in the same file
<%doc>
# Something
# Something
</%doc>
<%args>
$id => undef
$debug => undef
$other => under
</%args>
<%perl>
Code that appears to be perl code
</%perl>
<!DOCTYPE html>
<html>
HTML that also appears to have code (maybe perl code) inside <%these types of %> brackets
as well as <& these types &>
</html>
Can someone please explain what exactly this is. Is it perl, or is it html? Or is it some combination of the two? And if its the later, is this how you reference the perl code from within HTML: <% foo %> <& bar &>
Sorry for the confusing question. I'd be happy to provide more details.
It appears to be a template for HTML::Mason.

How to use html entities in CSS content property?

Good day,
I'm stuck with a problem this morning. I found out that content property which is nice but I can't use HTML entities in it.
More specifically, I would like to use the é
This is what I tried: content: 'test with eacute \233'; but the result is test with eacute ÿ
I've also tried \0233, \0233c, \233c
I don't want to change my page's encoding.
Thank you in advance guys!
Hmm I found that website : http://www.evotech.net/articles/testjsentities.html
And it looks like the é (&eacute, &#233) is converted into \00E9
And now, content: 'test with eacute \00E9'; works!