On 05May2022 15:11, x...@trimaso.com.mx <x...@trimaso.com.mx> wrote:
>On Thu, May 05, 2022 at 12:07:44PM -0500, Kevin J. McCarthy wrote:
>>1) On the command line, the shell will expand shell variables inside
>>double quoted strings, before Mutt even sees it.
[...]
>First: had to delete/rename ~/.muttrc, because some previous settings 
>were perhaps conflicting...

Always good to get the config as simple as possible.

>This seemed to *finally* work (had to play with both single and double 
>quotes...):
>
>printf "%b\n" "$msg" | mutt -s "Test message" -e 'set 
>my_user="u...@domain.tld"; set my_url="smtp.domain.tld"; set 
>from="Send User <u...@domain.tld>"; set 
>smtp_url="smtp://$my_user:my_p4ss@$my_url:587"; set 
>ssl_starttls="yes"; set ssl_force_tls="yes"' recei...@domain.tld

This is why using a config file is often better. If you had:

    set my_user="u...@domain.tld"
    set my_url="smtp.domain.tld"
    set from="Send User <u...@domain.tld>"
    set smtp_url="smtp://$my_user:my_p4ss@$my_url:587"
    set ssl_starttls="yes"
    set ssl_force_tls="yes"

in some file "muttrc-test" you can then test with:

    printf "%b\n" "$msg" | mutt -F muttrc-test -s "Test message" 
recei...@domain.tld

much more easily.

>Finally worked -seemingly-, but popped just many doubts:
>---There's a "sent email" log in local system, where sent emails are 
>logged. There's always this line:
>Message-ID: < <alphanum_string.alphanum_string> @ 
>mylocalpcu...@localhost.myisp.com >
>Is this correct?

Might be. It won't be a "real" Message-ID line as it looks like the log 
tries to include the username of the user who sent the email.

However, you're using SMTP to smtp.domain.tld, which means you're not 
using the local mail system, which means that it should not be logging 
locally for email you send using mutt.

Personally, I configure my local postfix install's main.cf (+etc) to 
send email from my laptop, and just have mutt deliver to the local 
sendmail. That gets me: local logging, local queue (good if offline), 
etc and a single place for the config (postfix). And anything else on my 
laptop can also send email. Such as cron etc.

>---Without "set from=" field, sender becomes 
>"mylocalpcu...@localhost.myisp.com"... What is this?

Probably defaults. In the good old days of shared standalone machines, 
localusername@machine_hostname would sometimes be a valid working 
address. And it is still all that can be guessed without any other 
config.

However, these days machine_hostname is almost never a valid email 
domain, and you want to configure the domain to be your usual ISP based 
domain. For example, my postfix main.cf has:

    mydomain = cskk.id.au
    myorigin = cskk.id.au

even though that domain is actually hosted on another machine, so that 
email from my laptop has a meaningful From: line. You're doing the same 
thing for mutt with "set from".

>Does the "from" field kind of guarantee that email is being *really* 
>sent from the u...@domain.tld address, and not from *local rig*?

No, it is just what gets written into the heder line so that people know 
what address to use for replies and citations.

>---In "set smtp_url" field, if using "$my_user:my_p4ss" notation, this 
>seems to override the "set smtp_pass" field completely?
>
>---Seemingly not needed smtp_authenticators... ??

Some ISPs allow unauthenticated email from "trusted" networks. For 
example, my home server accepts unauthenticated email from machines on 
my local LAN. An ISP _might_ accept it from the clients, but that seems 
more dubious.

>---Without smtp_url and smtp_pass fields, where does email go? 
>recei...@domain.tld doesn't receive it...

Probably delivered to the local mail system. If that can already deliver 
email, it will be doing the outbound SMTP for you.

>---Is email really being sent with STARTTLS, as wanted? How can I tell?

Mutt has some debug flags. Try using the "-d 5" option.

>---In "set from=" field, spaces between "Send User" and actual email 
>address... don't seem to matter?

The $from is for the "From:" header line, which accepts a full RFC2822 
email address which has a full name and username@hostname part, which 
can be written like:

    Cameron Simpson <c...@cskk.id.au>

which I prefer or:

    c...@cskk.id.au (Cameron Simpson)

which is very common, and I find less pleasant to look at. Only the 
c...@cskk.id.au part matters for email delivery. (And the "From:" doesn't 
affect delivery for you, but it gets used by people replying, so it 
affects them.)

>>Are you able to send email via that account using other applications?
>
>Yes, I used to use Heirloom Mailx.

That should give you something to copy.

>I didn't mean email provider, but ISP internet service I'm connected 
>to.
>And did test again: I connected to an internet network, did not 
>specify port in smtp_url, tried send email, and got:
>Could not connect to smtp.domain.tld (No route to host)
>Tried connecting to a different internet network, tried to send email 
>using *exact* command, without port, and *it succceeded*.
>WTH?

Maybe that only works from a specific network.

Cheers,
Cameron Simpson <c...@cskk.id.au>

Reply via email to