Re: New to Mutt, unable to send messages in *any* attempted way

2022-05-07 Thread Cameron Simpson
On 07May2022 11:11, X Tec  wrote:
>On 2022-05-07 08:45:35, Cameron Simpson wrote:
>> Probably not? If you've been debugging the $smtp* variables (in
>> particular, having to debug the password) then it sounds like mutt is
>> actually sending directly with SMTP and _not_ using the local postfix.
>>
>> When you send with the local postfix, mutt just hands the message off to
>> the sendmail command and doesn't say anything about delivery - that is
>> sendmail's job.
>>
>I double-checked Mutt's current $sendmail variable, and it's certainly the 
>default "/usr/sbin/sendmail" command mentioned in the manual.
>The route exists, and it's by Postfix package in the system I use.

The manual says that setting $smtp_url overrides $sendmail. So your 
$sendmail setting is not in play.

>Also, I tried sending email to myself, and checked the full headers. It does 
>have the TLS thing you mention BTW, but on the other hand it has "User-Agent: 
>Mutt 1.10.1"...

These are not in conflict. Anything you send with mutt normally has a 
mutt user-agent header. Have a look at the received headers. They should 
trace the path from where you sent the email from through to how it was 
delivered.

>Also, Mutt does not say additional stuff or command line output (just exit 
>code '0') when sending email...
>I'm trying to use Mutt with external MTA/SMTP (Postfix in this case), as the 
>correct way intended, instead of Mutt's builtin SMTP.
>Am I failing? If so, why?

You're failing in this because you have $smtp_url defined. Comment out 
it and the other $smtp* variables.

When you send with $sendmail (the local system's mail system, postfix 
for you) the smtp settings come from the main.cf file, not from mutt.

>By the way, in Mutt default pager for reading emails, your words between 
>underscores '_' (_not_, _may_, etc...) are not being displayed... Why?

I think someone suggested turning off any colouring settings you have 
active. Possibly some colours match the terminal background colour.

Are the words invisible (gaps in the text) or missing (no gaps)?

>If sending email from the webmail, I'm sure it gets send from the email 
>address account/SMTP.

This is because the ISP itself is running the delivery, either by 
internal SMTP or its own sendmail equivalent.

>Same if sending from the popular "official" email clients (Outlook, 
>Thunderbird...)

That's because they're using SMTP, probably the the ISP SMTP service 
with a username/password (or better) authentication.

>But *not* sure when sending from Mutt...

According to the manual, if you set $smtp_url mutt will send with SMTP 
(or try) and send with $sendmail otherwise.

>And finally, what key to manually force to check for new mail, instead 
>of waiting or quitting and starting Mutt again?

The "$" key is usually bound to the  command, which updates the 
state of the current folder.

>Evidently just doing "any" activity in Mutt does not refresh/fetch new 
>email...

See http://www.mutt.org/doc/manual/#new-mail (particularly new mail 
Detection) and http://www.mutt.org/doc/manual/#mailboxes

Cheers,
Cameron Simpson 


Re: pattern modifier to select current message in pager?

2022-05-07 Thread raf
On Fri, May 06, 2022 at 03:41:56PM -0700, "N.J. Thomas"  wrote:

> If I am in a folder and I am currently on some message (eg. #702), I'm
> looking for a pattern to delete all previous message, up to and
> including the selected message.
> 
> I can do this manually by running "D" with the pattern "~m -702" (I had
> to type in the number of the currently selected message).
> 
> But if I want to do this for any message I am on (so I can alias
> this), I didn't see any pattern modifier in the manual that allowed me
> to do this.
> 
> Is this possible?
> 
> thanks,
> Thomas

Jut guessing, but have you tried: ~m -.
In ex/vi, . means the current line.
Nope. That doesn't work.

Looking at the code, I can see where it
would need to be changed (pattern.c:eat_range),
but I don't know how to get the index number of
the current message.

It looks like it's mutt_index_menu()'s MUTTMENU *menu's
current field but I don't think that's accessible to
eat_range().

It looks like the answer is no.

cheers,
raf



Re: New to Mutt, unable to send messages in *any* attempted way

2022-05-07 Thread Kevin J. McCarthy

On Sat, May 07, 2022 at 11:11:35AM -0500, X Tec wrote:
By the way, in Mutt default pager for reading emails, your words 
between underscores '_' (_not_, _may_, etc...) are not being 
displayed... Why?


Possibly your color settings, or the color settings shipped with your 
packaged version of mutt.


Try adding 'uncolor body *' to the bottom of your muttrc to remove all 
body coloring add see if that makes a difference.



"man mutt" says that:

 -n Do not read the system-wide Muttrc configuration file.

If you're getting an exit 1, I'd expect some kind of error message as
well.

No command line output whatsoever; only an exit '1' code when checking 
with "echo $?"


I can't duplicate this, but it's possible a bug got fixed related to 
this.  If you could specify the exact command you are running I'll try 
to look at it again.


When browsing emails in Mutt, why do sizes inside () -for example, 
(1.1K)- change to something different and smaller -( 6)- when hitting 
enter to display the message?


The IMAP code updates the message body size when it actually downloads 
the message.  When opening the mailbox, it only displays an estimate 
based on the subset of headers it downloads.


--
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA


signature.asc
Description: PGP signature


Re: New to Mutt, unable to send messages in *any* attempted way

2022-05-07 Thread Sam Kuper
Hi X Tec,

Not sure if you have read this web page?

https://gitlab.com/muttmua/mutt/-/wikis/MailConcept

You may find life simpler if, following the advice there, you apply the
concept of "separation of concerns".

https://en.wikipedia.org/wiki/Separation_of_concerns

In other words:

-   use an MRA such as Getmail, Fetchmail, or Retchmail to retrieve your
mail from the server; and

-   either:

-   (If you don't need complex filtering) use the MRA's built-in MDA
to write the retrieved mail to a local inbox.  Ideally, a
Maildir directory in some sensible location like ~/inbox ; or

-   (If you do need complex filtering) use a separate MDA like
Procmail or Maildrop to perform that processing and to deliver
the mails into relevant Maildirs, e.g. ~/mail/personal and
~/mail/work ; and

-   use Mutt solely as an MUA; and

-   use either Postfix as your MTA (if you're already good at Postfix),
or perhaps better still, use a lightweight MTA like msmtp, which is
much easier to configure and manage, and is more than powerful
enough for a typical single user.


This way, you are playing to each tool's strengths.

You also will be able to troubleshoot more easily under this approach,
because MTA-related config should live *solely* within the MTA's config
file(s); MUA-related config *solely* within the MUA's config file(s);
etc.


On Sat, May 07, 2022 at 11:11:35AM -0500, X Tec wrote:
> Also, Mutt does not say additional stuff or command line output (just
> exit code '0') when sending email...

0 means "success", so that's reasonable.


> I'm trying to use Mutt with external MTA/SMTP (Postfix in this case),
> as the correct way intended, instead of Mutt's builtin SMTP.
>
> Am I failing? If so, why?

Unsure.  Consider a simpler MTA such as msmtp.


> By the way, in Mutt default pager for reading emails, your words
> between underscores '_' (_not_, _may_, etc...) are not being
> displayed... Why?

Have you searched the bug tracker?

https://gitlab.com/muttmua/mutt/-/issues/


>>> Then how do I know the email is really being sent from  
>>> u...@domain.tld 's account/SMTP?
>> 
>> Hahahaha! You don't!
>> [...]
>> 
> Maybe I'm completely confused and lost...
>
> If sending email from the webmail, I'm sure it gets send from the
> email address account/SMTP.

Many webmail interfaces map directly to an underlying email account.  I
guess that's the situation you've encountered.

Not all of them do, though!  Some webmail instances let users send email
from multiple different accounts, or even from one account via another
account's SMTP server!

(I'm not making a value judgement here: not saying that one approach is
right and the other is wrong.  Just stating facts.)


> Same if sending from the popular "official" email clients (Outlook,
> Thunderbird...)

Yes, those clients typically map one email address to one SMTP server.


> But *not* sure when sending from Mutt...

Correct.

Mutt is a MUA.

It is a very powerful MUA.

It does have some MTA functionality, but it's up to you to configure
that functionality (or, perhaps better, configure a standalone MTA) to
suit you.




> And finally, what key to manually force to check for new mail, instead
> of waiting or quitting and starting Mutt again?
>
> Evidently just doing "any" activity in Mutt does not refresh/fetch new
> email...

In recent(ish) versions of Mutt, activity (e.g. using a cursor key to
move up or down the index) *does* cause Mutt to check for new mail in
the currently-displayed mailbox (i.e. mbox or Maildir).

That's not the same as fetching mail, though.  If you want to *fetch*
mail, then you need to invoke your MRA (which could be Mutt, but could
also be Getmail, Fetchmail, or Retchmail, etc).

Sam


Re: New to Mutt, unable to send messages in *any* attempted way

2022-05-07 Thread X Tec
On 2022-05-07 08:45:35, Cameron Simpson wrote:
> Probably not? If you've been debugging the $smtp* variables (in 
> particular, having to debug the password) then it sounds like mutt is 
> actually sending directly with SMTP and _not_ using the local postfix.
> 
> When you send with the local postfix, mutt just hands the message off to 
> the sendmail command and doesn't say anything about delivery - that is 
> sendmail's job.
> 
I double-checked Mutt's current $sendmail variable, and it's certainly the 
default "/usr/sbin/sendmail" command mentioned in the manual.
The route exists, and it's by Postfix package in the system I use.
Also, I tried sending email to myself, and checked the full headers. It does 
have the TLS thing you mention BTW, but on the other hand it has "User-Agent: 
Mutt 1.10.1"...
Also, Mutt does not say additional stuff or command line output (just exit code 
'0') when sending email...
I'm trying to use Mutt with external MTA/SMTP (Postfix in this case), as the 
correct way intended, instead of Mutt's builtin SMTP.
Am I failing? If so, why?

By the way, in Mutt default pager for reading emails, your words between 
underscores '_' (_not_, _may_, etc...) are not being displayed... Why?



> >Then how do I know the email is really being sent from  
> >u...@domain.tld 's account/SMTP?
> 
> Hahahaha! You don't!
> [...]
> 
Maybe I'm completely confused and lost...
If sending email from the webmail, I'm sure it gets send from the email address 
account/SMTP.
Same if sending from the popular "official" email clients (Outlook, 
Thunderbird...)
But *not* sure when sending from Mutt...



> "man mutt" says that:
> 
>  -n Do not read the system-wide Muttrc configuration file.
> 
> If you're getting an exit 1, I'd expect some kind of error message as 
> well.
> 
No command line output whatsoever; only an exit '1' code when checking with 
"echo $?"



> >---When browsing emails in Mutt, why do sizes inside () -for example, 
> >(1.1K)- change to something different and smaller -( 6)- when hitting 
> >enter to display the message?
> 
> They don't for me. Are you sure you're not confusing the index lines 
> (one per message, specified by $index_format) with the header shown 
> above a specific message when you're viewing it? Got an example?
> 
1   2022-05-06 17:45:35 Cameron Simpson ( 11K) Re: New to Mutt, unable to send 
messages in *any* attempted way
And when hitting enter to display message:
1   2022-05-06 17:45:35 Cameron Simpson ( 158) Re: New to Mutt, unable to send 
messages in *any* attempted way
(I changed $date_format and $index_format to custom values)



And finally, what key to manually force to check for new mail, instead of 
waiting or quitting and starting Mutt again?
Evidently just doing "any" activity in Mutt does not refresh/fetch new email...



Re: Gmail config

2022-05-07 Thread Rob Pyott
Solved!  --I added the proper SASL packages as suggested.  Thank you!

On Sun, May 1, 2022 at 10:33 PM Kevin J. McCarthy  wrote:
>
> On Sun, May 01, 2022 at 08:34:22PM -0400, Rob Pyott wrote:
> >Here's the debug output from "connecting to smtp" to the end.  Should
> >have sent all of it previously.  Thanks --
>
> >[2022-05-01 18:40:05] 5< 250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN 
> >OAUTHBEARER XOAUTH
>
> This shows that the server is offering possible authenticators,
> including LOGIN and PLAIN, so the problem doesn't seem to be on Gmail's
> side.
>
> >[2022-05-01 18:40:05] smtp_authenticate: Trying method login
>
> It looks like you've set $smtp_authenticators.  I'm assuming you
> previously had it unset and were getting the same error, and are trying
> Andrzej's suggestion here.
>
> In any case, "login" is clearly being offered by the server, but:
>
> >[2022-05-01 18:40:05] SASL: No worthy mechs found
>
> The Cyrus SASL library is reporting it can't use it and then:
>
> >[2022-05-01 18:40:05] smtp_auth_sasl: login unavailable
>
> Mutt gives up and tries the next one.
>
> This looks like something is wrong with your Cyrus SASL installation.
> On Debian, for instance, the authentication modules come in a different
> package from the libsasl2 package: libsasl2-modules.  I would check to
> make sure you have at least the standard modules installed on your
> system.
>
> If you can't find out the problem, you could also try compiling Mutt
> with gsasl support instead.  It's new in Mutt 2.2.x, and so isn't well
> tested yet, but might work for you.
>
> --
> Kevin J. McCarthy
> GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA