in reply to getting SMTP capability working

If you have some other mailserver available, a tool like nullmailer can be helpful. It is a minimal solution, accepting mails from the local system and delegating the delivery to some smarter mailserver. The Debian wiki explains how to set it up. Basically, install the package and write account data for the smarter mailserver into a configuration file.

The Debian postfix package comes with a good configuration assistant, which makes setting up a fully featured mail server quite easy. Again, see the Debian wiki, which also has details on all the bells and whistles you probably won't need.

Yes, I'm aware that you are using a Raspi. Guess which Linux distribution is the base for Raspbian a.k.a. Raspberry Pi OS.

Both nullmailer and postfix allow you to submit mails via SMTP, that's the traditional and cleanest way. Any "solution" that tries to automate interacting with some kind of webmailer will ultimately fail, simply because there is no standard, only guesswork. Postfix comes with a sendmail executable that emulates the original "sendmail" as much as needed to send mail. Nullmailer has nullmailer-inject, which is not as compatible, but accepts emails from STDIN like sendmail does, and accepts a few parameters like sendmail does.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Replies are listed 'Best First'.
Re^2: emailing from one debian system to another
by Aldebaran (Curate) on May 19, 2022 at 01:15 UTC
    If you have some other mailserver available, a tool like nullmailer can be helpful. It is a minimal solution, accepting mails from the local system and delegating the delivery to some smarter mailserver. The Debian wiki explains how to set it up. Basically, install the package and write account data for the smarter mailserver into a configuration file.

    Ok, thanks Alexander, so I'm still in process of creating the mail server. I've had steps forward, but a couple back, as I updated systems at in opportune time and lost apache2. Working on that. I looked at the nullmailer install. I like the date on it: 2018. (Not too old, not too new.) Read the HOWTO to glean what I could.

    The Debian postfix package comes with a good configuration assistant, which makes setting up a fully featured mail server quite easy. Again, see the Debian wiki, which also has details on all the bells and whistles you probably won't need.

    Those were very helpful links. I'll repost this one: Installing_and_Configuring_Postfix_on_Debian.

    Yes, I'm aware that you are using a Raspi. Guess which Linux distribution is the base for Raspbian a.k.a. Raspberry Pi OS.

    Your comments made me realize that the problem space here was wall-to-wall debian. I'll go ahead and write this like we used to on usenet when the subject became implementation-specific:

    [specific to debian implementations]

    I had been unable to completely update my droplet until I found a bit of extra update syntax from ubuntu. I crammed it all into a new alias:

    alias release='sudo apt-get update && sudo apt-get upgrade && apt-get dist-upgrade && sudo do-release-upgrade'

    I had been in a limbo zone where I almost had 22.04 but now do:

    root@fourth:~# release ... Checking for a new Ubuntu release There is no development version of an LTS available. To upgrade to the latest non-LTS development release set Prompt=normal in /etc/update-manager/release-upgrades. root@fourth:~# apt autoremove
    Both nullmailer and postfix allow you to submit mails via SMTP, that's the traditional and cleanest way. Any "solution" that tries to automate interacting with some kind of webmailer will ultimately fail, simply because there is no standard, only guesswork. Postfix comes with a sendmail executable that emulates the original "sendmail" as much as needed to send mail. Nullmailer has nullmailer-inject, which is not as compatible, but accepts emails from STDIN like sendmail does, and accepts a few parameters like sendmail does.

    Ok, and thanks for your comment. I'm happy to see your responses as I know they are likely to contain useful and exotic details of what is happening underneath the hood with unix. One issue I need to get clear is whether Digital Ocean is giving me port 25, so I will fire off this to them:

    Dear Digital Ocean Support, I've been renting space from you for over a year now, and, because google will disallow 3rd-party use of their smtp server on May 30, am working up an email server with my DO site. I'm not entirely convinced that I have access to port 25, as it is blocked during the first 2 months. Do I? Thank you for your attention,

    Beyond this, I got some partial results and hope to not need to start over. I think I got the MX record set up right with DO. I had to access the way back machine for some of my sources. This is from 5 years ago: way back machine on mx records.

    Here's a nice, new fresh one: how-to-install-and-configure-postfix-on-ubuntu-22-04. I'll end up going through this again. Since the beginning of this write-up, I tore out and replaced apache2, changing Postfix twice, so I'll be due to go over it again.

    One final thing. I told a friend that google was restricting 3rd-party access to their smtp server, and she asked me whether her iOS mail app that gets her gmail will still be able to do so. Does anyone have the expertise to speculate? (I hemmed and hawed.)

      One issue I need to get clear is whether Digital Ocean is giving me port 25

      Very simple to test this for yourself, but do note that most virtual host providers block SMTP traffic. Log into your server, and run the netcat command, listening on port 25 (need sudo because the port number is less-than 1024).

      steve@cesium:~$ sudo nc -l 25

      Now, on a remote machine, using netcat again, create a connection to the server, and type something, and hit ENTER:

      steve@maezi ~ >nc cesium 25 hello, world!

      If port 25 is open on your server, you'll see your typed message on its console:

      steve@cesium:~$ sudo nc -l 25 hello, world!

      You can also type something while on the server while the nc command is still running on both machines, and the message will show up on the machine you connected to the server with; in essence, a little chat program ;)

        hey stevie, looks like I'm getting through from the local machine:

        $ nc HOSTNAME 25 hello, email world hey stevie, it worked! ^C $

        to the remote target:

        Last login: Thu May 19 00:12:40 2022 wilma@fourth:~$ sudo -i [sudo] password for wilma: root@fourth:~# which nc /usr/bin/nc root@fourth:~# sudo nc -l 25 hello, email world hey stevie, it worked! root@fourth:~#
        You can also type something while on the server while the nc command is still running on both machines, and the message will show up on the machine you connected to the server with; in essence, a little chat program ;)

        Yeah, I guess so.:) Reminds me of the old days when we really used telnet....