2 " Language: msmtp rc files
3 " Maintainer: Simon Ruderich <simon@ruderich.com>
4 " Eric Pruitt <eric.pruitt@gmail.com>
5 " Last Change: 2014-12-11
12 elseif exists("b:current_syntax")
18 syn match msmtpComment /#.*$/ contains=@Spell
21 syntax match msmtpOption /\<\(defaults\|account\|host\|port\|proxy_host\|proxy_port\|timeout\|protocol\|domain\)\>/
22 " Authentication commands.
23 syntax match msmtpOption /\<\(auth\|user\|password\|passwordeval\|ntlmdomain\)\>/
25 syntax match msmtpOption /\<\(tls\|tls_trust_file\|tls_crl_file\|tls_fingerprint\|tls_key_file\|tls_cert_file\|tls_certcheck\|tls_starttls\|tls_min_dh_prime_bits\|tls_priorities\)\>/
26 " Sendmail mode specific commands.
27 syntax match msmtpOption /\<\(auto_from\|from\|maildomain\|dsn_notify\|dsn_return\|add_missing_from_header\|add_missing_date_header\|remove_bcc_headers\|logfile\|syslog\)\>/
29 " Options which accept only an on/off value.
30 syn match msmtpWrongOption /\<\(tls\|tls_certcheck\|tls_starttls\|auto_from\|add_missing_from_header\|add_missing_date_header\|remove_bcc_headers\) \(on$\|off$\)\@!.*$/
31 " Option port accepts numeric values.
32 syn match msmtpWrongOption /\<\(port\|proxy_port\) \(\d\+$\)\@!.*$/
33 " Option timeout accepts off and numeric values.
34 syn match msmtpWrongOption /\<timeout \(off$\|\d\+$\)\@!.*$/
35 " Option protocol accepts smtp and lmtp.
36 syn match msmtpWrongOption /\<protocol \(smtp$\|lmtp$\)\@!.*$/
37 " Option auth accepts on, off and the method.
38 syn match msmtpWrongOption /\<auth \(on$\|off$\|plain$\|cram-md5$\|digest-md5$\|scram-sha-1$\|gssapi$\|external$\|login$\|ntlm$\)\@!.*$/
39 " Option auth accepts on, off and the facility.
40 syn match msmtpWrongOption /\<syslog \(on$\|off$\|LOG_USER$\|LOG_MAIL$\|LOG_LOCAL\d$\)\@!.*$/
42 " Marks all wrong option values as errors.
43 syn match msmtpWrongOptionValue /\S* \zs.*$/ contained containedin=msmtpWrongOption
45 " Mark the option part as a normal option.
46 highlight default link msmtpWrongOption msmtpOption
48 "Email addresses (yanked from esmptrc)
49 syntax match msmtpAddress /[a-z0-9_.-]*[a-z0-9]\+@[a-z0-9_.-]*[a-z0-9]\+\.[a-z]\+/
51 syn match msmtpHost "\%(host\s*\)\@<=\h\%(\w\|\.\|-\)*"
53 syn match msmtpNumber /\<\(\d\+$\)/
55 syntax region msmtpString start=/"/ end=/"/
56 syntax region msmtpString start=/'/ end=/'/
58 highlight default link msmtpComment Comment
59 highlight default link msmtpOption Type
60 highlight default link msmtpWrongOptionValue Error
61 highlight default link msmtpString String
62 highlight default link msmtpAddress Constant
63 highlight default link msmtpNumber Number
64 highlight default link msmtpHost Identifier
67 let b:current_syntax = "msmtp"