From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.help Subject: Re: Can't send mail with smtpmail "any more". (Gmail and other providers) Date: Sun, 1 Nov 2020 16:05:01 +0300 Message-ID: References: <83mu07em37.fsf@gnu.org> <20201101133443.3a81f3af@atmarama.ddns.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23194"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/+ (1036f0e) (2020-10-18) Cc: help-gnu-emacs@gnu.org To: =?utf-8?B?U2HFoWEgSmFuacWha2E=?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 01 14:06:52 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kZD4N-0005xU-Rg for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 01 Nov 2020 14:06:51 +0100 Original-Received: from localhost ([::1]:46046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kZD4M-0007IQ-2v for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 01 Nov 2020 08:06:50 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58652) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kZD2y-0007HL-In for help-gnu-emacs@gnu.org; Sun, 01 Nov 2020 08:05:24 -0500 Original-Received: from static.rcdrun.com ([95.85.24.50]:54321) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kZD2u-0000ee-HR for help-gnu-emacs@gnu.org; Sun, 01 Nov 2020 08:05:23 -0500 Original-Received: from localhost ([::ffff:197.157.0.60]) (AUTH: PLAIN admin, TLS: TLS1.2,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by static.rcdrun.com with ESMTPSA id 00000000002A0B40.000000005F9EB28E.00006A04; Sun, 01 Nov 2020 13:05:17 +0000 Content-Disposition: inline In-Reply-To: <20201101133443.3a81f3af@atmarama.ddns.net> Received-SPF: pass client-ip=95.85.24.50; envelope-from=bugs@gnu.support; helo=static.rcdrun.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/01 07:22:28 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_SORBS_WEB=1.5, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:124853 Archived-At: * Saša Janiška [2020-11-01 15:35]: > On Tue, 27 Oct 2020 17:15:56 +0200 > Eli Zaretskii wrote: > > > smtpmail.el has a debug facility, whereby you can set a variable and > > get a buffer with the details of the connection session. > > What about adding some regular logging facility to smtpmail.el? It is > the main reason why I'm using msmtp instead? > > (This email is still sent by Claws until I decide which client to > use: Gnus or mu4e.) M-x rmail is quite good client for email handling in Emacs. Then there is: M-x mh-rmail which may have many good power users' options For me, due to nature of my email handling and having over 50000 Maildir directories inside of ~/Maildir and that none of Emacs clients is handling Maildirs, I am using mutt email client. That is one of most efficient for me. And I am launching it inside of Emacs and editing files with Emacs by using emacsclient (defun mutt-emacs () "Opens mutt in ansi-term buffer within GNU Emacs" (interactive) (let* ((default-directory (getenv "HOME"))) (ansi-term "mutt"))) But my M-x becomes not usable when I am in ansi-term, I would like that it is usable. I made this function to open up mutt in vterm and I still use it. But that was workaround from time when ansi-term was not handling best some terminal activities. Bugs have been polished and now ansi-term works just fine. (defun mutt-vterm () "Opens mutt in vterm buffer within GNU Emacs" (interactive) (let* ((default-directory (getenv "HOME")) (buffer-exist (get-buffer "mutt")) (vterm-kill-buffer-on-exit t) (vterm-shell "mutt") (last-key (last-key))) (if buffer-exist (if (and (not (symbolp last-key)) (not (= last-key 8388717))) (vterm "mutt") (if (and (not (string-match (buffer-name (current-buffer)) "mutt")) (y-or-n-p "Buffer `mutt' exists, do you wish to switch?")) (switch-to-buffer "mutt"))) (vterm "mutt")))) (global-set-key (kbd "s-m") 'mutt-you-name-it) For fetching emails I recommend using GNU mailtools and setting up crontab to regularly fetch emails to local computer. For sending, I recommend using the MTA on the system if such exists on your system, for example exim, courier MTA, OpenSMTPD, Postfix and similar. Those are handling the queues well if you have good connection to Internet. msmtp is excellent tool and handles queues of email even if connection to Internet is sporadic. MTAs need to be configured to handled mail in queues for longer time and for that reason some emails could be lost or returned back. I am using those scripts for msmtp, like list queue and similar. So the script below is at ~/bin/sendmail and my PATH is ~/bin as well so Emacs will recognize it as sendmail and dispatch email without any further settings to msmtp. That is very handy when using it with emacs -Q when one needs to M-x report-emacs-bug ~/bin/sendmail follows below: #!/usr/bin/env bash QUEUEDIR=$HOME/.msmtpqueue # Set secure permissions on created directories and files umask 077 # Change to queue directory (create it if necessary) if [ ! -d "$QUEUEDIR" ]; then mkdir -p "$QUEUEDIR" || exit 1 fi cd "$QUEUEDIR" || exit 1 # Create new unique filenames of the form # MAILFILE: ccyy-mm-dd-hh.mm.ss[-x].mail # MSMTPFILE: ccyy-mm-dd-hh.mm.ss[-x].msmtp # where x is a consecutive number only appended if you send more than one # mail per second. BASE="`/bin/date +%Y-%m-%d-%H.%M.%S`" if [ -f "$BASE.mail" -o -f "$BASE.msmtp" ]; then TMP="$BASE" i=1 while [ -f "$TMP-$i.mail" -o -f "$TMP-$i.msmtp" ]; do i=`expr $i + 1` done BASE="$BASE-$i" fi MAILFILE="$BASE.mail" MSMTPFILE="$BASE.msmtp" # Write command line to $MSMTPFILE echo "$@" > "$MSMTPFILE" || exit 1 # Write the mail to $MAILFILE cat > "$MAILFILE" || exit 1 # If we are online, run the queue immediately. # Replace the test with something suitable for your site. ping -c 1 -w 2 stw1.rcdrun.com > /dev/null if [ $? -eq 0 ]; then msmtp-runqueue.sh > /dev/null & fi exit 0