sending mail from terminal

Not too many people use emails from the command prompt now.
Telex is gone as I think are Newsgroups.
Well, I kind of agree on Telex.
 

Attachments

  • mailnewsirc.jpg
    mailnewsirc.jpg
    485.8 KB · Views: 136
I prefer neomutt these days, but to be honest, for me, I don't see much difference between it and mutt. I have a mutt page https://srobb.net/mutt.html that goes into some details of setting up sending and receiving, though these days, even mutt has grown, to the point where it can send and receive on its own, though I still prefer getmail and msmtp (especially the latter, as I send on different email addresses.)

The trouble is that while the good doctor is right, about lots of people using it, it's all the ones who don't that are the problem. Jason Ryan of ArchLinux has one of my favorite articles about it, which also includes a way to view those mails that are html only in mutt. (That is, the REALLY stupid ones where links won't show in say, w3m.) https://www.jasonwryan.com/blog/2012/05/12/mutt/

Depending upon your position and such, many of us aren't in a position to tell our boss, Look you foolish person, if you wish me to waste my time reading your undoubtedly unnecessary email, send it in plain text. So, most of us, even those who use good mail clients like neomutt, often have to read this stupid html email, which should have never been allowed. Even now, with ISPs bribing politicians to get bandwidth limits---oh, let me shut up, or I'll go on and on and... (That last one may just be a US problem, most other developed countries seem to have competition for Internet, so that the ISPs have to offer something decent. In the US it's.....
Heh, another rather old youtube video describes it well. (Obscenity in the video).
View: https://www.youtube.com/watch?v=0ilMx7k7mso
 
a way to view those mails that are html only in mutt.
Got this for long since, even hacked it a bit to work around other weird problems I since forgot, I got these in my ~/.mailcap:
Code:
text/html;w3m -cols 72 -I %{charset} -T text/html -s | sed -e 's:^[[:blank:]]*$::' | cat -s; copiousoutput
application/msword;catdoc -a %s; nametemplate=%s.doc; copiousoutput
application/rtf;catdoc -a %s; nametemplate=%s.rtf; copiousoutput

But it won't help with links in html-only mails when the caption is not the link itself, w3m processing into text will only show the caption. So in these rare cases, you have to dig into the "source"…

Of course, a *sane* HTML email always is mime/multipart, including a text/plain part which has the links in plaintext. But yes, every now and then, you receive a braindead broken Email.
 
Is any tool to send mails from terminal?
If you want to send mail with the command mail, you must configure sendmail
in order that other MTA accept mail from it. Without a static IP and a MX entry you will perhaps not get it,
unless configuring it as SMARTHOST for authenticating to other MTA, for example to your gmail account,
and sending from there, as were sendmail a MUA, to do it is only a little configuration work,
but doable. But for reading then your gmail account you must get the emails with something like
fetchmail.

It is simpler to use a program like alpine to authenticate to gmail and read gmail with imap.
Its support for imap is better than the one of mutt. And you can use it for reading and writing to usenet.
 
I would like to use this script with a cronjob but instead of send to the root mailbox I wold like to send to my actual email. Is that possible without a static ip address?
 
the base system sendmail wont do
you need another mta or compile base sendmail with cyrus sasl support
then you can authenticate to your mail provider mta
hopefully not google because that is a pain
 
the base system sendmail wont do
you need another mta or compile base sendmail with cyrus sasl support
then you can authenticate to your mail provider mta
hopefully not google because that is a pain
Thank you for your reply.
I use ProtonMail. Can you recommend me a MTA? Please.
 
Thank you for your reply.
I use ProtonMail. Can you recommend me a MTA? Please.
Have you tried it? It might work (or it might with some tweaking).

Code:
mail -s "My test email" test@test.com
the body here
.
EOT

So I typed the first line, the mail program waits for me to type a messge, then . on a line by itself means end of message (mail shows EOT for End Of Text I'm assuming.)

Obviously change test@test.com to an email address where you really DO want to get the email - see if it arrives, look in your Spam, check /var/log/maillog.

In my case it's a no-go:

Code:
dsn=4.3.0, reply=451-p.q.r.s is not yet authorized to deliver mail from
 
many IPSs block outgoing port 25, many mail hostings reject residential IP ranges, or/and reject mail from IPs without reverse DNS mapping unless they are authenticated
I personally use base sendmail compiled with SASL support but it's not ideal (need to recompile sendmail after freebsd-update)
 
many IPSs block outgoing port 25, many mail hostings reject residential IP ranges, or/and reject mail from IPs without reverse DNS mapping unless they are authenticated
I personally use base sendmail compiled with SASL support but it's not ideal (need to recompile sendmail after freebsd-update)
mail/sendmail package is compiled with SASL. I am using it for my own mail server in replacement of base sendmail.
 
I would like to use this script with a cronjob but instead of send to the root mailbox I wold like to send to my actual email. Is that possible without a static ip address?
If you want to send mail from a script, you will call an email client in the script.
It is not a good Idea to call mozilla thunderbird in a script. Better are traditional
command line programs like sendmail or mailx that calls sendmail. For that, you need
to configure sendmail as a client (SMART HOST) that is able to connect to
your email provider and send the mail from there.

Unfortunately it is not anymore possible to configure sendmail with google due xoath2,
but there are lots of free smtp mail providers that you can log in with a password,
for example web.de, and from there you can send mails to your ProtonMail account.

Here is a link to configure sendmail:


You can also use a program like this:

 
I'm using mail system (console) for local and WAN.
On console, mutt or neomutt
I'm using postfix for send mail and fetchmail for retry mails
SASL protocol for password on server FAI
I define smarthost and aliases in mailer.conf
After freebsd-upgrade " service stop and start postifx"
 
Back
Top