RasppleII / a2cloud

Connect your Apple // to the world via Linux
Other
5 stars 2 forks source link

A2CLOUD: provide IMAP email client #1

Open knghtbrd opened 8 years ago

knghtbrd commented 8 years ago

From @IvanExpert on October 25, 2015 21:3

Install Alpine or Mutt, plus (important) an easy configuration script, which also has preset settings for common providers. This has not been done thus far because ease of use has been a design goal and neither Alpine nor Mutt is easy to configure; Mutt is probably the nicer choice but it is entirely dependent on a separately created configuration file. A sample configuration-creator script for Mutt was created by Alistair Ross at: http://pastebin.com/Mawvd2pZ

I have not done anything further with it, however perhaps it can be used as a starting point.

Copied from original issue: RasppleII/a2server#14

knghtbrd commented 8 years ago

I use mutt (and am using it to type this reply), but I have to say that its ability to handle remote IMAP clients is … poor. It assumes the IMAP server is on the LAN and does not keep a full local cache of messages. Moreover it has virtually no support whatsoever for POP3 and it needs a config file that can get pretty complex. I also find its keyboard shortcuts to be bizarre even today—I use my own. That said, I could probably write a good set of mutt defaults and a reasonably good shell script to handle some basic setup for a user's private .muttrc using the SMTP patch to avoid the need for setting up a "sendmail" tool. (Although I think we still wind up needing cron so some sendmail setup will be required at some stage for that alone.

I've not used pine since before there was alpine honestly. That said I did recently install it on the Pi and can investigate. It has decent enough IMAP support though I think it still doesn't cache messages. Still, for IMAP navigation alone, it'd be a better choice than mutt, and its menus are simple and familiar even if it's been 16 years since I have used it.

Cone's another choice. Not as popular, but it's part of the courier suite. Its IMAP is easily as strong as pine, and it's similarly easily used because of its heavily menu-oriented design. Very clearly written to be the "free alternative" to pine, since pine was not exactly under a free license at the time.

Fetchmail is easy and obvious for POP3, but very few people pull messages via POP3 anymore. OfflineIMAP is the solution I use for IMAP since mutt really wants to have local folders. But OfflineIMAP is not a real trivial setup. I'll give the latest versions a fresh look, along with seeing if it remains a mail synchronization tool, or if it now provides mail sorting as well.

Joseph

On Sun, Oct 25, 2015 at 02:03:24PM -0700, IvanExpert wrote:

Install Alpine or Mutt, plus (important) an easy configuration script, which also has preset settings for common providers. This has not been done thus far because ease of use has been a design goal and neither Alpine nor Mutt is easy to configure; Mutt is probably the nicer choice but it is entirely dependent on a separately created configuration file. A sample configuration-creator script for Mutt was created by Alistair Ross at: http://pastebin.com/Mawvd2pZ

I have not done anything further with it, however perhaps it can be used as a starting point.


Reply to this email directly or view it on GitHub: https://github.com/RasppleII/a2server/issues/14

knghtbrd commented 8 years ago

From @IvanExpert on October 26, 2015 0:56

Sounds like you're pretty familiar with the options, so I'll defer to your judgment here. In terms of A2CLOUD being the thing that gets one's Apple IIc on the internet with various text-based clients, email feels like a key missing piece, but not necessarily an easily solved one.

knghtbrd commented 8 years ago

I actually made myself aware of the options the other day when I saw a note explicitly noting that it was not supported because it was difficult to do well. I said, "no it's not, just use pine since it's now under a free license!" And then I realized that pine may not be ideal for GMail and whatnot, and as many people now use that as use pretty much anything else. So I had to reconsider a bit. :)

Perhaps the thing to do would be to provide multiple options? Install our preferred choice for new users unless alternatives exist that the user may have chosen instead.

So if we can install pine (if that's what we go with), we will do that unless we detect that something else is installed. I was planning to do that on jessie for weechat vs. irssi as irssi has gotten stale and bloated, whereas weechat is still pretty light and fast if you pardon its ability to have scripts written in anything. irssi is still the best choice for wheezy as weechat in wheezy is 0.3.0, yuck. In jessy it's 1.2, not bad.

IvanExpert commented 8 years ago

I don't mind multiple options, but the most important thing to me is that it not be only usable/configurable for Linux power users, who can already install a mail client on their own. Probably the one significant thing I bring to this project is my ability to see things (at least as well as I can) from that kind of user's perspective, and that has guided much of A2CLOUD's development. So I wouldn't want to claim it's got email support if it isn't something that a Linux noob (or at least a technically inclined Linux noob) can't use. I'd rather have nothing than multiple options that require too much technical understanding or Linux familiarity to get going.

knghtbrd commented 8 years ago

I agree, that's why I didn't jump on mutt as a highly functional default. Sure it's highly functional, but it's also highly not n00b friendly to make it do all of that stuff. Sure there are new user guides all over the Internet, but they all begin with either "here's the manual, start writing your .muttrc", or "here's a .muttrc, change these things, and then go read the manual." My own from debian-devel all those ages ago included.

Joseph

On Mon, Oct 26, 2015 at 07:14:04AM -0700, IvanExpert wrote:

I don't mind multiple options, but the most important thing to me is that it not be only usable/configurable for Linux power users, who can already install a mail client on their own. Probably the one significant thing I bring to this project is my ability to see things (at least as well as I can) from that kind of user's perspective, and that has guided much of A2CLOUD's development. So I wouldn't want to claim it's got email support if it isn't something that a Linux noob (or at least a technically inclined Linux noob) can't use.


Reply to this email directly or view it on GitHub: https://github.com/RasppleII/a2cloud/issues/1#issuecomment-151147073

knghtbrd commented 7 years ago

Alistair's script, in case the pastebin link goes away:

#!/bin/bash
# Config suitable for mutt-1.5.21. Check compatability for other versions.
today=`date`
muttrc="$HOME/.muttrc"
clear

echo ".muttrc Maker for GMail (or other IMAP) by Alistair Ross"
echo

if [ -e $muttrc ]
then
    printf "\a"
    echo "WARNING: There is already a .muttrc config file in your home directory"
    echo "This setup wizard will overwrite this file if you continue."
    echo "To abort this process at any time, press Ctrl-C"
    echo "Hit RETURN to continue."
read x
fi

echo

echo "Enter your email address>"
read imap_user

echo "Enter your IMAP password (note this will be echoed to the screen) >"
read imap_pass

echo "Enter your name as you wish to appear to your recipients, eg, John Smith >"
read realname

echo "Enter the IMAP folder URI, press return for imaps://imap.gmail.com:993 >"
read folder
if [ -z $folder ]
then
    folder="imaps://imap.gmail.com:993"
fi

echo "Enter your SMTP URL (just hit return if you are using GMail, otherwise format is smtp://username@domain.com:587/ >"
read smtp_url
if [ -z $smtp_url ]
then
    smtp_url="smtp://$imap_user:587/"
fi

echo "Enter your from address (hit return to assume $imap_user) >"
read from
if [ -z $from ]
then
    from="$imap_user"
fi

echo "Enter the hostname of your email provider (hit enter for gmail.com) >"
read hostname
if [ -z $hostname ]
then
    hostname="gmail.com"
fi

echo "Enter the name of the IMAP Drafts folder (hit enter for +[Gmail]/Drafts) >"
read postponed
    if [ -z $postponed ]
then
    postponed="+[Gmail]/Drafts"
fi

clear
printf "\a"
echo "Thanks. I'm going to set a whole bunch of defaults for you. Including the below
settings regarding certificate authentication which may or may not be pertinent
to your mail server and/or preferences.

For example, here's a few below that may be of interest. To change any setting,
simply edit ~/.muttrc

ignore 'Authentication-Results:'
ignore 'DomainKey-Signature:'
ignore 'DKIM-Signature:'
hdr_order Date From To Cc
set askcc = no
set ascii_chars = yes # default: no
set editor = '/usr/bin/vim'"

echo "# .muttrc configuration generated by muttrcmaker for Gmail/IMAP
# Configuration written on $today
set imap_user = '$imap_user'
set imap_pass = '$imap_pass'

set imap_login = '$imap_user'
set folder = 'imaps://imap.gmail.com:993'
#set imap_authenticators = 'set imap_authenticators='digest-md5:gssapi:cram-md5:login' 

set smtp_url = '$smtp_url'
set smtp_pass = '$imap_pass'
set from = '$from'
set realname = '$realname'
set signature = '~/.signature'
set hostname = '$hostname'
set use_ipv6 = no

set spoolfile = '+INBOX'
set postponed='$postponed'

set header_cache=~/.mutt/cache/headers
set message_cachedir=~/.mutt/cache/bodies
set certificate_file=~/.mutt/certificates

set move = no

set sort = 'threads'
set sort_aux = 'last-date-received'
set imap_check_subscribed

ignore 'Authentication-Results:'
ignore 'DomainKey-Signature:'
ignore 'DKIM-Signature:'
hdr_order Date From To Cc

set askcc = no
set ascii_chars = yes # default: no
set editor = '/usr/bin/vim' 

# Colors

color attachment brightmagenta default
color error      brightred    default
color hdrdefault red          default
color indicator  brightyellow red
color markers    brightcyan   default
color message    brightcyan   default
color normal     default      default
color quoted     brightblue   default
color search     default      green
color signature  red          default
color status     yellow       blue
color tilde      magenta      default
color tree       magenta      default

# set abort_nosubject = ask-yes
# set abort_unmodified = yes
# set alias_file = '~/.muttrc'
# set alias_format = '%4n %2f %t %-10a   %r'
# set allow_8bit = yes
# set allow_ansi = no
# set arrow_cursor = no
# set askbcc = no
# set assumed_charset = '(empty)'
# set attach_charset = '(empty)'
# set attach_format = '%u%D%I %t%4n %T%.40d%> [%.7m/%.10M, %.6e%?C?, %C?, %s] '
# set attach_sep = '\n'
# set attach_split = yes
# set attribution = 'On %d, %n wrote:'
# set auto_tag = no
# set autoedit = no
# set beep = yes
# set beep_new = no
# set bounce = ask-yes
# set bounce_delivered = yes
# set braille_friendly = no
# set certificate_file = '~/.mutt_certificates'
# set charset = '(empty)'
# set check_mbox_size = no
# set check_new = yes
# set collapse_unread = yes
# set compose_format = '-- Mutt: Compose  [Approx. msg size: %l   Atts: %a]%>-'
# set config_charset = '(empty)'
# set confirmappend = yes
# set confirmcreate = yes
# set connect_timeout = '30'
# set content_type = 'text/plain'
# set copy = yes
# set crypt_autoencrypt = no
# set crypt_autopgp = yes
# set crypt_autosign = no
# set crypt_autosmime = yes
# set crypt_replyencrypt = yes
# set crypt_replysign = no
# set crypt_replysignencrypted = no
# set crypt_timestamp = yes
# set crypt_use_gpgme = no
# set crypt_use_pka = no
# set crypt_verify_sig = yes
# set date_format = '!%a, %b %d, %Y at %I:%M:%S%p %Z'
# set default_hook = '~f %s !~P | (~P ~C %s)'
# set delete = ask-yes
# set delete_untag = yes
# set digest_collapse = yes
# set display_filter = '(empty)'
# set dotlock_program = '/usr/local/bin/mutt_dotlock'
# set dsn_notify = '(empty)'
# set dsn_return = '(empty)'
# set duplicate_threads = yes
# set edit_headers = no
# set encode_from = no
# set entropy_file = '(empty)'
# set envelope_from_address = '(empty)'
# set escape = '~'
# set fast_reply = no
# set fcc_attach = yes
# set fcc_clear = no
# set folder = '~/Mail'
# set folder_format = '%2C %t %N %F %2l %-8.8u %-8.8g %8s %d %f'
# set followup_to = yes
# set force_name = no
# set forward_decode = yes
# set forward_decrypt = yes
# set forward_edit = yes
# set forward_quote = no
# set gecos_mask = '^[^,]*'
# set hdrs = yes
# set header = no
# set header_cache = '(empty)'
# set header_cache_compress = yes
# set header_cache_pagesize = '16384'
# set help = yes
# set hidden_host = no
# set hide_limited = no
# set hide_missing = yes
# set hide_thread_subject = yes
# set hide_top_limited = no
# set hide_top_missing = yes
# set history = '10'
# set history_file = '~/.mutthistory'
# set honor_disposition = no
# set honor_followup_to = yes
# set ignore_linear_white_space = no
# set ignore_list_reply_to = no
# set imap_check_subscribed = no
# set imap_delim_chars = '/.'
# set imap_headers = '(empty)'
# set imap_idle = no
# set imap_keepalive = '900'
# set imap_list_subscribed = no
# set imap_passive = yes
# set imap_peek = yes
# set imap_pipeline_depth = '15'
# set imap_servernoise = yes
# set implicit_autoview = no
# set include = ask-yes
# set include_onlyfirst = no
# set indent_string = '> '
# set index_format = '%4C %Z %{%b %d} %-15.15L (%?l?%4l&%4c?) %s'
# set ispell = 'ispell'
# set keep_flagged = no
# set locale = 'C'
# set mail_check = '5'
# set mail_check_recent = yes
# set mailcap_path = '(empty)'
# set mailcap_sanitize = yes
# set maildir_header_cache_verify = yes
# set maildir_trash = no
# set mark_old = yes
# set markers = yes
# set mask = '!^\.[^.]'
# set mbox = '~/mbox'
# set mbox_type = 'mbox'
# set menu_context = '0'
# set menu_move_off = yes
# set menu_scroll = no
# set message_cache_clean = no
# set message_cachedir = '(empty)'
# set message_format = '%s'
# set meta_key = no
# set metoo = no
# set mh_purge = no
# set mh_seq_flagged = 'flagged'
# set mh_seq_replied = 'replied'
# set mh_seq_unseen = 'unseen'
# set mime_forward = no
# set mime_forward_decode = no
# set mime_forward_rest = yes
# set mix_entry_format = '%4n %c %-16s %a'
# set mixmaster = '1'
# set move = no
# set narrow_tree = no
# set net_inc = '10'
# set pager = 'builtin'
# set pager_context = '0'
# set pager_format = '-%Z- %C/%m: %-20.20n   %s%*  -- (%P)'
# set pager_index_lines = '0'
# set pager_stop = no
# set pgp_auto_decode = no
# set pgp_autoinline = no
# set pgp_check_exit = yes
# set pgp_clearsign_command = '(empty)'
# set pgp_decode_command = '(empty)'
# set pgp_decrypt_command = '(empty)'
# set pgp_encrypt_only_command = '(empty)'
# set pgp_encrypt_sign_command = '(empty)'
# set pgp_entry_format = '%4n %t%f %4l/0x%k %-4a %2c %u'
# set pgp_export_command = '(empty)'
# set pgp_getkeys_command = '(empty)'
# set pgp_good_sign = '(empty)'
# set pgp_ignore_subkeys = yes
# set pgp_import_command = '(empty)'
# set pgp_list_pubring_command = '(empty)'
# set pgp_list_secring_command = '(empty)'
# set pgp_long_ids = no
# set pgp_mime_auto = ask-yes
# set pgp_replyinline = no
# set pgp_retainable_sigs = no
# set pgp_show_unusable = yes
# set pgp_sign_as = '(empty)'
# set pgp_sign_command = '(empty)'
# set pgp_sort_keys = 'address'
# set pgp_strict_enc = yes
# set pgp_timeout = '300'
# set pgp_use_gpg_agent = no
# set pgp_verify_command = '(empty)'
# set pgp_verify_key_command = '(empty)'
# set pipe_decode = no
# set pipe_sep = '\n'
# set pipe_split = no
# set pop_auth_try_all = yes
# set pop_authenticators = '(empty)'
# set pop_checkinterval = '60'
# set pop_delete = ask-no
# set pop_host = '(empty)'
# set pop_last = no
# set pop_pass = '(empty)'
# set pop_reconnect = ask-yes
# set pop_user = '(empty)'
# set post_indent_string = '(empty)'
# set postpone = ask-yes
# set postponed = '~/postponed'
# set preconnect = '(empty)'
# set print = ask-no
# set print_command = 'lpr'
# set print_decode = yes
# set print_split = no
# set prompt_after = yes
# set query_command = '(empty)'
# set query_format = '%4c %t %-25.25a %-25.25n %?e?(%e)?'
# set quit = yes
# set quote_regexp = '^([ \t]*[|>:}#])+'
# set read_inc = '10'
# set read_only = no
# set recall = ask-yes
# set record = '~/sent'
# set reply_regexp = '^(re([\[0-9\]+])*|aw):[ \t]*'
# set reply_self = no
# set reply_to = ask-yes
# set resolve = yes
# set reverse_alias = no
# set reverse_name = no
# set reverse_realname = yes
# set rfc2047_parameters = no
# set save_address = no
# set save_empty = yes
# set save_history = '0'
# set save_name = no
# set score = yes
# set score_threshold_delete = '-1'
# set score_threshold_flag = '9999'
# set score_threshold_read = '-1'
# set search_context = '0'
# set send_charset = 'us-ascii:iso-8859-1:utf-8'
# set sendmail = '/usr/sbin/sendmail -oem -oi'
# set sendmail_wait = '0'
# set shell = '(empty)'
# set sig_dashes = yes
# set sig_on_top = no
# set simple_search = '~f %s | ~s %s'
# set sleep_time = '1'
# set smart_wrap = yes
# set smileys = '(>From )|(:[-^]?[][)(><}{|/DP])'
# set smime_ask_cert_label = yes
# set smime_ca_location = '(empty)'
# set smime_certificates = '(empty)'
# set smime_decrypt_command = '(empty)'
# set smime_decrypt_use_default_key = yes
# set smime_default_key = '(empty)'
# set smime_encrypt_command = '(empty)'
# set smime_encrypt_with = '(empty)'
# set smime_get_cert_command = '(empty)'
# set smime_get_cert_email_command = '(empty)'
# set smime_get_signer_cert_command = '(empty)'
# set smime_import_cert_command = '(empty)'
# set smime_is_default = no
# set smime_keys = '(empty)'
# set smime_pk7out_command = '(empty)'
# set smime_sign_command = '(empty)'
# set smime_sign_opaque_command = '(empty)'
# set smime_timeout = '300'
# set smime_verify_command = '(empty)'
# set smime_verify_opaque_command = '(empty)'
# set smtp_authenticators = '(empty)'
# set smtp_pass = '(empty)'
# set smtp_url = '(empty)'
# set sort = 'date'
# set sort_alias = 'alias'
# set sort_aux = 'date'
# set sort_browser = 'alpha'
# set sort_re = yes
# set spam_separator = ','
# set spoolfile = '(empty)'
# set ssl_ca_certificates_file = '(empty)'
# set ssl_client_cert = '(empty)'
# set ssl_force_tls = no
# set ssl_min_dh_prime_bits = '0'
# set ssl_starttls = yes
# set ssl_use_sslv2 = no
# set ssl_use_sslv3 = yes
# set ssl_use_tlsv1 = yes
# set ssl_usesystemcerts = yes
# set ssl_verify_dates = yes
# set ssl_verify_host = yes
# set status_chars = '-*%A'
# set status_format = '-%r-Mutt: %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o? Old:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? %l?]---(%s/%S)-%>-(%P)---'
# set status_on_top = no
# set strict_threads = no
# set suspend = yes
# set text_flowed = no
# set thorough_search = yes
# set thread_received = no
# set tilde = no
# set time_inc = '0'
# set timeout = '600'
# set tmpdir = '(empty)'
# set to_chars = ' +TCFL'
# set tunnel = '(empty)'
# set uncollapse_jump = no
# set use_8bitmime = no
# set use_domain = yes
# set use_envelope_from = no
# set use_from = yes
# set use_idn = yes
# set user_agent = yes
# set visual = '(empty)'
# set wait_key = yes
# set weed = yes
# set wrap = '0'
# set wrap_headers = '78'
# set wrap_search = yes
# set wrapmargin = '0'
# set write_bcc = yes
# set write_inc = '10'
" > .muttrc

echo 
echo "$HOME/.muttrc Created."
knghtbrd commented 7 years ago

I am still not opposed to either of alpine or mutt. I use mutt myself, but it is not trivial to configure, and Alistair's script doesn't really come real close to resolving that as cleanly as I would like. No configuration tool really could, to be perfectly honest. But it might be quite good enough or the basis of something that is good enough.

The last time I used pine, alpine didn't exist. It has the distinct advantage of supporting usenet groups as an alternative to tin and of having a pretty extensive built-in configuration.

Both alpine and mutt suffer from the fact that being UNIX terminal mail programs, they generally want to assume a sendmail-compatible mail program. The problem there is that running a mail server like esmtp or postfix is not trivial and should be truly not necessary anymore. It's also not desirable on a system like a Raspberry Pi if you can help it. Yet this assumption continues to be the standard default for console UNIX mail programs.

I use the SMTP patch for mutt (which I believe to be part of Debian's NeoMutt in testing, but perhaps not in stable), but it takes somewhat complex folder hook settings to juggle multiple email addresses and SMTP smart hosts with it. There's also a need for password management and other such things. I recall pine having similar SMTP feature 20 years ago and I doubt it was taken out, but does it support multiple SMTP servers for different email addresses? Who's got just one email address anymore?

This won't be fixed in 1.9.1, but it is needed and should be targeted toward 2.0.0.