mayaml 4.0.1 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +29 -10
- data/Gemfile +1 -0
- data/README.md +4 -5
- data/bin/mayaml-mutt-init +75 -0
- data/lib/mayaml/base.rb +19 -0
- data/lib/mayaml/mutt_account_alternates/generator.rb +29 -0
- data/lib/mayaml/mutt_account_alternates/presenter.rb +18 -0
- data/lib/mayaml/mutt_account_alternates/template.mustache +1 -0
- data/lib/mayaml/mutt_account_alternates/validator.rb +18 -0
- data/lib/mayaml/mutt_account_alternates.rb +32 -0
- data/lib/mayaml/mutt_account_creds/generator.rb +29 -0
- data/lib/mayaml/mutt_account_creds/presenter.rb +29 -0
- data/lib/mayaml/mutt_account_creds/template.mustache +8 -0
- data/lib/mayaml/mutt_account_creds/validator.rb +25 -0
- data/lib/mayaml/mutt_account_creds.rb +32 -0
- data/lib/mayaml/mutt_account_init/generator.rb +30 -0
- data/lib/mayaml/mutt_account_init/presenter.rb +37 -0
- data/lib/mayaml/mutt_account_init/template.mustache +3 -0
- data/lib/mayaml/mutt_account_init/validator.rb +24 -0
- data/lib/mayaml/mutt_account_init.rb +32 -0
- data/lib/mayaml/mutt_config_accounts.rb +19 -0
- data/lib/mayaml/mutt_config_default_account.rb +18 -0
- data/lib/mayaml/mutt_config_init.rb +20 -0
- data/lib/mayaml/mutt_config_static.rb +18 -0
- data/lib/mayaml/mutt_configs_accounts/handler.rb +30 -0
- data/lib/mayaml/mutt_configs_default_account/handler.rb +46 -0
- data/lib/mayaml/mutt_configs_init/handler.rb +37 -0
- data/lib/mayaml/mutt_configs_static/assets/account_chooser.sh +20 -0
- data/lib/mayaml/mutt_configs_static/assets/csk.muttrc +94 -0
- data/lib/mayaml/mutt_configs_static/assets/mailcap +4 -0
- data/lib/mayaml/mutt_configs_static/assets/muttrc +125 -0
- data/lib/mayaml/mutt_configs_static/handler.rb +40 -0
- data/lib/mayaml/version.rb +1 -18
- data/lib/mayaml.rb +3 -47
- metadata +82 -24
- data/bin/mayaml-check +0 -42
- data/lib/mayaml/error.rb +0 -23
- data/lib/mayaml/mail_account/builder.rb +0 -127
- data/lib/mayaml/mail_account/default_flag_validator.rb +0 -43
- data/lib/mayaml/mail_account/error.rb +0 -47
- data/lib/mayaml/mail_account/mailboxes_validator.rb +0 -53
- data/lib/mayaml/mail_account/port_validator.rb +0 -44
- data/lib/mayaml/mail_account/required_attributes_validator.rb +0 -91
- data/lib/mayaml/mail_account/smtp_protocol_validator.rb +0 -53
- data/lib/mayaml/mail_account/type_validator.rb +0 -53
- data/lib/mayaml/mail_account.rb +0 -47
- data/lib/mayaml/parser.rb +0 -29
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "mainapp/component"
|
4
|
+
|
5
|
+
module Mayaml
|
6
|
+
module MuttConfigsAccounts
|
7
|
+
class Handler
|
8
|
+
include ::Mainapp::Component
|
9
|
+
attr_struct :logger, :mutt_account_creds_generator
|
10
|
+
|
11
|
+
def execute(data, prefix_path)
|
12
|
+
data.map do |account_data|
|
13
|
+
key = build_path(prefix_path, account_data)
|
14
|
+
view = mutt_account_creds_generator.render account_data
|
15
|
+
{key => view}
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def build_path(prefix_path, acc_data)
|
22
|
+
File.join(
|
23
|
+
prefix_path,
|
24
|
+
"accounts",
|
25
|
+
acc_data[:name]
|
26
|
+
)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "mainapp/component"
|
4
|
+
|
5
|
+
module Mayaml
|
6
|
+
module MuttConfigsDefaultAccount
|
7
|
+
class Handler
|
8
|
+
include ::Mainapp::Component
|
9
|
+
attr_struct :logger
|
10
|
+
|
11
|
+
def execute(data, prefix_path)
|
12
|
+
account_data = default_account(data) || first_account(data)
|
13
|
+
return [] unless account_data
|
14
|
+
src = link_path(prefix_path)
|
15
|
+
dest = build_path(prefix_path, account_data)
|
16
|
+
[{src => dest}]
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def default_account(data)
|
22
|
+
data.find { |account_data| account_data[:default] == true }
|
23
|
+
end
|
24
|
+
|
25
|
+
def first_account(data)
|
26
|
+
data.first
|
27
|
+
end
|
28
|
+
|
29
|
+
def link_path(prefix_path)
|
30
|
+
File.join(
|
31
|
+
prefix_path,
|
32
|
+
"accounts",
|
33
|
+
"current_acc"
|
34
|
+
)
|
35
|
+
end
|
36
|
+
|
37
|
+
def build_path(prefix_path, acc_data)
|
38
|
+
File.join(
|
39
|
+
prefix_path,
|
40
|
+
"accounts",
|
41
|
+
acc_data[:name]
|
42
|
+
)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "mainapp/component"
|
4
|
+
|
5
|
+
module Mayaml
|
6
|
+
module MuttConfigsInit
|
7
|
+
class Handler
|
8
|
+
include ::Mainapp::Component
|
9
|
+
attr_struct :logger, :mutt_account_init_generator, :mutt_account_alternates_generator
|
10
|
+
|
11
|
+
def execute(data, prefix_path)
|
12
|
+
key = build_path(prefix_path)
|
13
|
+
view = compute_config data, prefix_path
|
14
|
+
[{key => view}]
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def build_path(prefix_path)
|
20
|
+
File.join(
|
21
|
+
prefix_path,
|
22
|
+
"init.muttrc"
|
23
|
+
)
|
24
|
+
end
|
25
|
+
|
26
|
+
def compute_config(data, prefix_path)
|
27
|
+
view = "vim: filetype=muttrc\n\n"
|
28
|
+
view += data.map.with_index do |account_data, index|
|
29
|
+
mutt_account_init_generator.render index, prefix_path, account_data
|
30
|
+
end.join("\n")
|
31
|
+
view += "\n"
|
32
|
+
view += mutt_account_alternates_generator.render data
|
33
|
+
view
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
set -eo pipefail
|
3
|
+
[[ "$TRACE" ]] && set -x
|
4
|
+
|
5
|
+
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
6
|
+
ACCOUNT_DIR="${CURRENT_DIR}/accounts"
|
7
|
+
|
8
|
+
main() {
|
9
|
+
local profile_file=$1; shift
|
10
|
+
ADDR=$(grep -e "^Delivered-To:" -e "^To:" | sed -e "s/^Delivered-To:\s//" -e "s/^To:\s//" | grep -Eio '\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b')
|
11
|
+
for email in $ADDR; do
|
12
|
+
account_file="${ACCOUNT_DIR}/${email}"
|
13
|
+
if [ -f "$account_file" ]; then
|
14
|
+
ln -sf $account_file ${ACCOUNT_DIR}/${profile_file}
|
15
|
+
return
|
16
|
+
fi
|
17
|
+
done
|
18
|
+
}
|
19
|
+
|
20
|
+
[[ "$0" == "$BASH_SOURCE" ]] && main "$@"
|
@@ -0,0 +1,94 @@
|
|
1
|
+
# vim: filetype=muttrc
|
2
|
+
#
|
3
|
+
# Mutt color file
|
4
|
+
# Maintainer: Jon Häggblad <jon@haeggblad.com>
|
5
|
+
# URL: http://www.haeggblad.com
|
6
|
+
# Last Change: 2013 May 17
|
7
|
+
# Version: 0.1
|
8
|
+
#
|
9
|
+
# Mutt colorscheme loosely inspired by vim colorscheme wombat.vim.
|
10
|
+
|
11
|
+
# --- vombatidae text colors ---
|
12
|
+
# color normal color230 color234
|
13
|
+
# color message color230 color234
|
14
|
+
|
15
|
+
# --- slightly less yellow text colors ---
|
16
|
+
color normal color253 color234 # mod
|
17
|
+
# color normal color253 color233 # mod
|
18
|
+
# color normal color253 default # mod
|
19
|
+
color indicator color230 color238
|
20
|
+
color status color101 color16
|
21
|
+
# color tree color113 color234
|
22
|
+
# color tree color173 color234
|
23
|
+
color tree color208 color234
|
24
|
+
color signature color102 color234
|
25
|
+
color message color253 color234
|
26
|
+
color attachment color117 color234
|
27
|
+
color error color30 color234
|
28
|
+
color tilde color130 color235
|
29
|
+
|
30
|
+
color search color100 default
|
31
|
+
color markers color138 default
|
32
|
+
|
33
|
+
# mono bold reverse
|
34
|
+
# color bold color173 color191
|
35
|
+
# mono underline reverse
|
36
|
+
# color underline color48 color191
|
37
|
+
|
38
|
+
color quoted color107 color234 # quoted text
|
39
|
+
color quoted1 color66 color234
|
40
|
+
color quoted2 color32 color234
|
41
|
+
color quoted3 color30 color234
|
42
|
+
color quoted4 color99 color234
|
43
|
+
color quoted5 color36 color234
|
44
|
+
color quoted6 color114 color234
|
45
|
+
color quoted7 color109 color234
|
46
|
+
color quoted8 color41 color234
|
47
|
+
#color quoted9 color138 color234
|
48
|
+
|
49
|
+
# color body cyan default "((ftp|http|https)://|news:)[^ >)\"\t]+"
|
50
|
+
# color body cyan default "[-a-z_0-9.+]+@[-a-z_0-9.]+"
|
51
|
+
# color body red default "(^| )\\*[-a-z0-9*]+\\*[,.?]?[ \n]"
|
52
|
+
# color body green default "(^| )_[-a-z0-9_]+_[,.?]?[\n]"
|
53
|
+
# color body red default "(^| )\\*[-a-z0-9*]+\\*[,.?]?[ \n]"
|
54
|
+
# color body green default "(^| )_[-a-z0-9_]+_[,.?]?[ \n]"
|
55
|
+
color index color245 color234 "~P" # messages from me
|
56
|
+
color index color202 color234 ~F # Flagged
|
57
|
+
color index color39 color234 ~N # New
|
58
|
+
color index color39 color234 ~O
|
59
|
+
color index color229 color22 ~T # Tagged
|
60
|
+
color index color236 color234 ~D # Deleted
|
61
|
+
|
62
|
+
# ---
|
63
|
+
|
64
|
+
#mono body reverse '^(subject):.*'
|
65
|
+
#color body brightwhite magenta '^(subject):.*'
|
66
|
+
#mono body reverse '[[:alpha:]][[:alnum:]-]+:'
|
67
|
+
#color body black cyan '[[:alpha:]][[:alnum:]-]+:'
|
68
|
+
|
69
|
+
# --- header ---
|
70
|
+
|
71
|
+
color hdrdefault color30 color233
|
72
|
+
color header color132 color233 '^date:'
|
73
|
+
color header color153 color233 '^(to|cc|bcc):'
|
74
|
+
color header color120 color233 '^from:'
|
75
|
+
color header color178 color233 '^subject:'
|
76
|
+
color header color31 color233 '^user-agent:'
|
77
|
+
color header color29 color233 '^reply-to:'
|
78
|
+
|
79
|
+
#color header magenta default '^(status|lines|date|received|sender|references):'
|
80
|
+
#color header magenta default '^(pr|mime|x-|user|return|content-)[^:]*:'
|
81
|
+
#color header brightyellow default '^content-type:'
|
82
|
+
#color header magenta default '^content-type: *text/plain'
|
83
|
+
# color header brightgreen default '^list-[^:]*:'
|
84
|
+
#mono header bold '^(subject):.*$'
|
85
|
+
#color header brightcyan default '^(disposition)'
|
86
|
+
#color header green default '^(mail-)?followup'
|
87
|
+
#color header white default '^reply'
|
88
|
+
#color header brightwhite default '^(resent)'
|
89
|
+
# color header brightwhite default '^from:'
|
90
|
+
|
91
|
+
#mono index bold '~h "^content-type: *(multipart/(mixed|signed|encrypted)|application/)"'
|
92
|
+
#color index green black '~h "^content-type: *multipart/(signed|encrypted)"'
|
93
|
+
|
94
|
+
#color sidebar_new color39 color234
|
@@ -0,0 +1,4 @@
|
|
1
|
+
# text/html; w3m -I %{charset} -T text/html; copiousoutput;
|
2
|
+
# text/html; elinks -dump ; copiousoutput;
|
3
|
+
text/html; elinks -eval "set document.codepage.assume = %{charset}" %s; nametemplate=%s.html
|
4
|
+
text/html; elinks -dump -dump-color-mode 3 -dump-charset utf-8 -default-mime-type text/htm -eval "set document.codepage.assume = %{charset}" %s; copiousoutput;
|
@@ -0,0 +1,125 @@
|
|
1
|
+
# Paths ----------------------------------------------
|
2
|
+
set folder = ~/.mails # mailbox location
|
3
|
+
set alias_file = ~/.mails/alias # where to store aliases
|
4
|
+
# set header_cache = ~/.mutt/cache/headers # where to store headers
|
5
|
+
# set message_cachedir = ~/.mutt/cache/bodies # where to store bodies
|
6
|
+
# set certificate_file = ~/.mutt/certificates # where to store certs
|
7
|
+
set mailcap_path = {{ prefix_path }}/mailcap # entries for filetypes
|
8
|
+
# set tmpdir = ~/.mutt/temp # where to keep temp files
|
9
|
+
# set signature = ~/.mutt/sig # my signature file
|
10
|
+
|
11
|
+
# Mailboxes to show in the sidebar.
|
12
|
+
mailboxes +INBOX \
|
13
|
+
+open \
|
14
|
+
+archive \
|
15
|
+
+drafts \
|
16
|
+
+trash \
|
17
|
+
|
18
|
+
# Default inbox.
|
19
|
+
set spoolfile = "+INBOX"
|
20
|
+
|
21
|
+
# Other special folders.
|
22
|
+
set mbox = "+open"
|
23
|
+
set postponed = "+drafts"
|
24
|
+
set record = "+INBOX"
|
25
|
+
|
26
|
+
|
27
|
+
# character set on messages that we send
|
28
|
+
set send_charset="utf-8"
|
29
|
+
# if there is no character set given on incoming messages, it is probably windows
|
30
|
+
set assumed_charset="iso-8859-1"
|
31
|
+
set editor="vim -c 'set syntax=mail ft=mail enc=utf-8 spell spelllang=pl,en'"
|
32
|
+
set markers=no
|
33
|
+
|
34
|
+
# Basic Options --------------------------------------
|
35
|
+
unset wait_key # no wait
|
36
|
+
set mbox_type = Maildir # mailbox type
|
37
|
+
set timeout = 3 # idle time before scanning
|
38
|
+
set mail_check = 1 # minimum time between scans
|
39
|
+
set mail_check_stats = yes
|
40
|
+
set mail_check_stats_interval = 5
|
41
|
+
set move # readed message to the mbox
|
42
|
+
set delete # don't ask, just do
|
43
|
+
unset confirmappend # don't ask, just do!
|
44
|
+
unset mark_old # read/new is good enough for me
|
45
|
+
# set beep_new # bell on new mails
|
46
|
+
set pipe_decode # strip headers and eval mimes when piping
|
47
|
+
# set thorough_search # strip headers and eval mimes before searching
|
48
|
+
set text_flowed # http://brianbuccola.com/line-breaks-in-mutt-and-vim/
|
49
|
+
|
50
|
+
# Sidebar Patch --------------------------------------
|
51
|
+
set sidebar_divider_char = ' │ '
|
52
|
+
set sidebar_visible = yes
|
53
|
+
set sidebar_width = 24
|
54
|
+
set sidebar_format = "%B%* %?N?%N/ ?%S"
|
55
|
+
color sidebar_new color221 color233
|
56
|
+
macro index "<PageUp>" "<sidebar-prev><sidebar-open>"
|
57
|
+
macro index "<PageDown>" "<sidebar-next><sidebar-open>"
|
58
|
+
|
59
|
+
# Status Bar -----------------------------------------
|
60
|
+
#set status_format = "───[ Folder: %f ]───[%r%m messages%?n? (%n new)?%?d? (%d to delete)?%?t? (%t tagged)? ]───%>─%?p?( %p postponed )?───"
|
61
|
+
|
62
|
+
# Header Options -------------------------------------
|
63
|
+
ignore * # ignore all headers
|
64
|
+
unignore from: to: cc: date: subject: # show only these
|
65
|
+
unhdr_order * # some distros order things by default
|
66
|
+
hdr_order date: to: cc: from: subject: # and in this order
|
67
|
+
|
68
|
+
# Index View Options ---------------------------------
|
69
|
+
set date_format = "%y-%m-%d %H:%M"
|
70
|
+
#set index_format="%4C %Z %{%b %d} %-16.16L %s"
|
71
|
+
#set index_format="%2C | %Z [%d] %-30.30F (%-4.4c) %s"
|
72
|
+
#set index_format= "[%Z] %D %-20.20F %s"
|
73
|
+
set index_format="%4C [%Z]%?X?%2X*& ? %s %* (%D) %-30.30L "
|
74
|
+
set sort = threads # like gmail
|
75
|
+
# set sort_aux = reverse-last-date-received # like gmail
|
76
|
+
# set uncollapse_jump # don't collapse on an unread message
|
77
|
+
# set sort_re # thread based on regex
|
78
|
+
# set reply_regexp = "^(([Rr][Ee]?(\[[0-9]+\])?: *)?(\[[^]]+\] *)?)*"
|
79
|
+
|
80
|
+
# Colours --------------------------------------------
|
81
|
+
source {{ prefix_path }}/csk.muttrc
|
82
|
+
|
83
|
+
# Account Settings -----------------------------------
|
84
|
+
set my_profile_file = "current_acc"
|
85
|
+
set smtp_authenticators="digest-md5:cram-md5:gssapi:login"
|
86
|
+
|
87
|
+
source {{ prefix_path }}/init.muttrc
|
88
|
+
source {{ prefix_path }}/accounts/$my_profile_file
|
89
|
+
|
90
|
+
# ============================================================================================
|
91
|
+
set query_command= "abook --mutt-query '%s'"
|
92
|
+
set pager_index_lines = 6
|
93
|
+
|
94
|
+
auto_view text/html # view html automatically
|
95
|
+
alternative_order text/plain text/enriched text/html # save html for last
|
96
|
+
|
97
|
+
attachments +A */.*
|
98
|
+
attachments -A text/x-vcard application/pgp.*
|
99
|
+
attachments -A application/x-pkcs7-.*
|
100
|
+
|
101
|
+
bind editor "<tab>" complete-query
|
102
|
+
bind editor "^T" complete
|
103
|
+
bind pager <Up> previous-line
|
104
|
+
bind pager <Down> next-line
|
105
|
+
|
106
|
+
macro index,pager r "<pipe-message>{{ prefix_path }}/account_chooser.sh $my_profile_file<enter>\
|
107
|
+
<enter-command>source {{ prefix_path }}/accounts/$my_profile_file<enter>\
|
108
|
+
<reply>" "Reply using specific account"
|
109
|
+
macro compose 'v' "<edit-from>^Umy_account_<complete>" "Select from"
|
110
|
+
macro index,pager "a" "<pipe-message>abook --add-email-quiet<enter>" "add the sender address to abook"
|
111
|
+
macro index,pager "A" "<shell-escape>abook<enter>" "launch abook"
|
112
|
+
macro pager \cb <pipe-entry>'urlscan'<enter> 'Follow links with urlview'
|
113
|
+
#macro pager \cv "<enter-command>set my_pdsave=\$pipe_decode<enter>\
|
114
|
+
#<enter-command>unset pipe_decode<enter>\
|
115
|
+
#<pipe-message>extract_url.pl | less<enter>\
|
116
|
+
#<enter-command>set pipe_decode=\$my_pdsave<enter>" "get URLs"
|
117
|
+
|
118
|
+
folder-hook . 'macro index,pager "<space>" "<display-message>"'
|
119
|
+
folder-hook . 'macro index,pager d "<save-message>=trash<enter>"'
|
120
|
+
folder-hook INBOX 'macro index "<space>" "<tag-prefix><save-message>=archive<enter>"'
|
121
|
+
folder-hook INBOX 'macro pager "<space>" "<save-message>=archive<enter>"'
|
122
|
+
folder-hook =open 'macro index "<space>" "<tag-prefix><save-message>=archive<enter>"'
|
123
|
+
folder-hook =open 'macro pager "<space>" "<save-message>=archive<enter>"'
|
124
|
+
folder-hook =trash 'push <delete-pattern>~r>30d!~F<enter>'
|
125
|
+
folder-hook =trash 'macro index,pager d <delete-message>'
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "mainapp/component"
|
4
|
+
require "mustache"
|
5
|
+
|
6
|
+
module Mayaml
|
7
|
+
module MuttConfigsStatic
|
8
|
+
class Handler
|
9
|
+
include ::Mainapp::Component
|
10
|
+
attr_struct :logger
|
11
|
+
|
12
|
+
def execute(prefix_path)
|
13
|
+
keys = %w[account_chooser.sh csk.muttrc mailcap muttrc]
|
14
|
+
keys.map do |config_file|
|
15
|
+
key = build_path(prefix_path, config_file)
|
16
|
+
value = ::Mustache.render assets_file_content(config_file), prefix_path: prefix_path
|
17
|
+
{key => value}
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def build_path(prefix_path, config_file)
|
24
|
+
File.join(
|
25
|
+
prefix_path,
|
26
|
+
config_file
|
27
|
+
)
|
28
|
+
end
|
29
|
+
|
30
|
+
def assets_file_content(config_file)
|
31
|
+
path = File.join(
|
32
|
+
__dir__,
|
33
|
+
"assets",
|
34
|
+
config_file
|
35
|
+
)
|
36
|
+
File.read path
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/lib/mayaml/version.rb
CHANGED
@@ -1,22 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (C) 2016, 2017 Szymon Kopciewski
|
4
|
-
#
|
5
|
-
# This file is part of Mayaml.
|
6
|
-
#
|
7
|
-
# This program is free software: you can redistribute it and/or modify
|
8
|
-
# it under the terms of the GNU General Public License as published by
|
9
|
-
# the Free Software Foundation, either version 3 of the License, or
|
10
|
-
# (at your option) any later version.
|
11
|
-
#
|
12
|
-
# This program is distributed in the hope that it will be useful,
|
13
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
-
# GNU General Public License for more details.
|
16
|
-
#
|
17
|
-
# You should have received a copy of the GNU General Public License
|
18
|
-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
19
|
-
|
20
3
|
module Mayaml
|
21
|
-
VERSION = "
|
4
|
+
VERSION = "5.0.0"
|
22
5
|
end
|
data/lib/mayaml.rb
CHANGED
@@ -1,49 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
#
|
7
|
-
# This program is free software: you can redistribute it and/or modify
|
8
|
-
# it under the terms of the GNU General Public License as published by
|
9
|
-
# the Free Software Foundation, either version 3 of the License, or
|
10
|
-
# (at your option) any later version.
|
11
|
-
#
|
12
|
-
# This program is distributed in the hope that it will be useful,
|
13
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
-
# GNU General Public License for more details.
|
16
|
-
#
|
17
|
-
# You should have received a copy of the GNU General Public License
|
18
|
-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
19
|
-
|
20
|
-
require "mayaml/version"
|
21
|
-
require "mayaml/mail_account/builder"
|
22
|
-
require "mayaml/parser"
|
23
|
-
|
24
|
-
module Mayaml
|
25
|
-
def self.accounts_from_file(yaml_accounts)
|
26
|
-
raw_accounts = Parser.get_accounts(yaml_accounts)
|
27
|
-
raw_accounts.map do |raw_account|
|
28
|
-
build_account(raw_account)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
def self.build_account(raw_account)
|
33
|
-
MailAccount::Builder.build do |builder|
|
34
|
-
builder.name raw_account.fetch("name")
|
35
|
-
builder.default raw_account.fetch("default", "")
|
36
|
-
builder.realname raw_account.fetch("realname")
|
37
|
-
builder.type raw_account.fetch("type")
|
38
|
-
builder.server raw_account.fetch("server")
|
39
|
-
builder.port raw_account.fetch("port")
|
40
|
-
builder.user raw_account.fetch("user")
|
41
|
-
builder.pass raw_account.fetch("pass")
|
42
|
-
builder.mailboxes raw_account.fetch("mailboxes", [])
|
43
|
-
builder.smtp_protocol raw_account.fetch("smtp_protocol")
|
44
|
-
builder.smtp_port raw_account.fetch("smtp_port")
|
45
|
-
builder.smtp_authenticator raw_account.fetch("smtp_authenticator")
|
46
|
-
builder.smtp_server raw_account.fetch("smtp_server")
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
3
|
+
lib_dir = File.expand_path(".", __dir__)
|
4
|
+
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
5
|
+
Dir[File.join(lib_dir, "mayaml", "*.rb")].each { |path| require_relative path }
|
metadata
CHANGED
@@ -1,23 +1,51 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mayaml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Szymon Kopciewski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: mainapp
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: mustache
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: ougai
|
15
43
|
requirement: !ruby/object:Gem::Requirement
|
16
44
|
requirements:
|
17
45
|
- - ">="
|
18
46
|
- !ruby/object:Gem::Version
|
19
47
|
version: '0'
|
20
|
-
type: :
|
48
|
+
type: :runtime
|
21
49
|
prerelease: false
|
22
50
|
version_requirements: !ruby/object:Gem::Requirement
|
23
51
|
requirements:
|
@@ -25,7 +53,7 @@ dependencies:
|
|
25
53
|
- !ruby/object:Gem::Version
|
26
54
|
version: '0'
|
27
55
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
56
|
+
name: debug
|
29
57
|
requirement: !ruby/object:Gem::Requirement
|
30
58
|
requirements:
|
31
59
|
- - ">="
|
@@ -66,6 +94,20 @@ dependencies:
|
|
66
94
|
- - ">="
|
67
95
|
- !ruby/object:Gem::Version
|
68
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rake
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
69
111
|
- !ruby/object:Gem::Dependency
|
70
112
|
name: simplecov
|
71
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,7 +123,7 @@ dependencies:
|
|
81
123
|
- !ruby/object:Gem::Version
|
82
124
|
version: '0'
|
83
125
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
126
|
+
name: yard
|
85
127
|
requirement: !ruby/object:Gem::Requirement
|
86
128
|
requirements:
|
87
129
|
- - ">="
|
@@ -94,11 +136,11 @@ dependencies:
|
|
94
136
|
- - ">="
|
95
137
|
- !ruby/object:Gem::Version
|
96
138
|
version: '0'
|
97
|
-
description: Mail Accounts from Yaml
|
139
|
+
description: Mail Accounts from Yaml config for mutt
|
98
140
|
email:
|
99
|
-
- s.kopciewski@
|
141
|
+
- s.kopciewski@dlamnie.net
|
100
142
|
executables:
|
101
|
-
- mayaml-
|
143
|
+
- mayaml-mutt-init
|
102
144
|
extensions: []
|
103
145
|
extra_rdoc_files: []
|
104
146
|
files:
|
@@ -106,19 +148,36 @@ files:
|
|
106
148
|
- Gemfile
|
107
149
|
- LICENSE
|
108
150
|
- README.md
|
109
|
-
- bin/mayaml-
|
151
|
+
- bin/mayaml-mutt-init
|
110
152
|
- lib/mayaml.rb
|
111
|
-
- lib/mayaml/
|
112
|
-
- lib/mayaml/
|
113
|
-
- lib/mayaml/
|
114
|
-
- lib/mayaml/
|
115
|
-
- lib/mayaml/
|
116
|
-
- lib/mayaml/
|
117
|
-
- lib/mayaml/
|
118
|
-
- lib/mayaml/
|
119
|
-
- lib/mayaml/
|
120
|
-
- lib/mayaml/
|
121
|
-
- lib/mayaml/
|
153
|
+
- lib/mayaml/base.rb
|
154
|
+
- lib/mayaml/mutt_account_alternates.rb
|
155
|
+
- lib/mayaml/mutt_account_alternates/generator.rb
|
156
|
+
- lib/mayaml/mutt_account_alternates/presenter.rb
|
157
|
+
- lib/mayaml/mutt_account_alternates/template.mustache
|
158
|
+
- lib/mayaml/mutt_account_alternates/validator.rb
|
159
|
+
- lib/mayaml/mutt_account_creds.rb
|
160
|
+
- lib/mayaml/mutt_account_creds/generator.rb
|
161
|
+
- lib/mayaml/mutt_account_creds/presenter.rb
|
162
|
+
- lib/mayaml/mutt_account_creds/template.mustache
|
163
|
+
- lib/mayaml/mutt_account_creds/validator.rb
|
164
|
+
- lib/mayaml/mutt_account_init.rb
|
165
|
+
- lib/mayaml/mutt_account_init/generator.rb
|
166
|
+
- lib/mayaml/mutt_account_init/presenter.rb
|
167
|
+
- lib/mayaml/mutt_account_init/template.mustache
|
168
|
+
- lib/mayaml/mutt_account_init/validator.rb
|
169
|
+
- lib/mayaml/mutt_config_accounts.rb
|
170
|
+
- lib/mayaml/mutt_config_default_account.rb
|
171
|
+
- lib/mayaml/mutt_config_init.rb
|
172
|
+
- lib/mayaml/mutt_config_static.rb
|
173
|
+
- lib/mayaml/mutt_configs_accounts/handler.rb
|
174
|
+
- lib/mayaml/mutt_configs_default_account/handler.rb
|
175
|
+
- lib/mayaml/mutt_configs_init/handler.rb
|
176
|
+
- lib/mayaml/mutt_configs_static/assets/account_chooser.sh
|
177
|
+
- lib/mayaml/mutt_configs_static/assets/csk.muttrc
|
178
|
+
- lib/mayaml/mutt_configs_static/assets/mailcap
|
179
|
+
- lib/mayaml/mutt_configs_static/assets/muttrc
|
180
|
+
- lib/mayaml/mutt_configs_static/handler.rb
|
122
181
|
- lib/mayaml/version.rb
|
123
182
|
homepage: https://github.com/skopciewski/mayaml
|
124
183
|
licenses:
|
@@ -139,9 +198,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
198
|
- !ruby/object:Gem::Version
|
140
199
|
version: '0'
|
141
200
|
requirements: []
|
142
|
-
|
143
|
-
rubygems_version: 2.4.8
|
201
|
+
rubygems_version: 3.4.19
|
144
202
|
signing_key:
|
145
203
|
specification_version: 4
|
146
|
-
summary: Mail Accounts from Yaml
|
204
|
+
summary: Mail Accounts from Yaml comfig for mutt
|
147
205
|
test_files: []
|