Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

[OT] Completing a debian install with the appropriate trimmings

by Aldebaran (Curate)
on Oct 16, 2022 at 06:54 UTC ( [id://11147451] : note . print w/replies, xml ) Need Help??


in reply to Re: Google scripts, google, and email
in thread Google scripts, google, and email

I could tell you, but I don't think you're old enough for that sort of language.

I think a lot of our attitudes regarding data usage line up with our ages. At 56 belly-button years old, I was lucky to be introduced to computers at a relatively-young age, 12. I have the experience of doing telnet, and I thought I could always return and "do things from scratch." I used to love autoexec.bat. I miss the days of bulletin boards and usenet, comp.lang.c, comp.lang.perl.misc. After the Perlpocalypse, I checked out the latter, and it was the saddest post from Keith Thompson about whether the lights were on. (They're not) Gone like the hogshead, cask, and demijon. "Kids nowadays" seem profligate in their data consumption to me who wants to count his bytes by the packet.

As far as email is concerned, I run my own servers. I've built them at work & helped a friend do the same. It's not that hard and, for me, runs very comfortably on a Pi 1 with 256Mb RAM. If you want help on this, I'll gladly do my best.

Well, John, I was glad to see this response because I'd like to get back on track with finishing it off. This is gonna be long enough that I'm gonna put the rest in readmore tags to reserve vertical space for respondents:

Completing a debian install with the appropriate trimmings

We covered a lot of ground in my last thread along these lines: getting SMTP capability working, and I had gotten this link from Alexander: Installing_and_Configuring_Postfix_on_Debian as a pole star. The way I remember it, /etc/hosts didn't look right yet. Also "normative" in my view is haukex's setup guide for rpi with new hosting at gitlab. This isn't an rpi, but it is debian, so it's the same ballpark.

Q1) Is gitlab a better source host than github (or google)?

First of all, I've had these messages bouncing around since I sent them:

root@mail:~# mailq -Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient------- C9F8BFC224 966 Sun Oct 9 20:00:01 root@merrillpjensen.com (Host or domain name not found. Name service error for name=merrillpje +nsen.com type=MX: Host not found, try again) root@merrillpjensen.com ... (Host or domain name not found. Name service error for name=merrillpje +nsen.com type=MX: Host not found, try again) root@merrillpjensen.com 16ED0FC226 966 Mon Oct 10 20:00:02 root@merrillpjensen.com (Host or domain name not found. Name service error for name=merrillpje +nsen.com type=MX: Host not found, try again) root@merrillpjensen.com -- 19 Kbytes in 10 Requests. root@mail:~#

This is what the output is with either sendmail -bp or mailq. Upgrading and rebooting doesn't get rid of it, which is probably good if it weren't noise.

Q2) How do I silence this noise?

I created some architecture for receiving mail. Firstly, I created a group for anything that should have mail privileges:

root@mail:~# cat /etc/group ... mymail:x:1003:sammy,root,wilma,www-data sammy:x:1004:

It seemed to me I needed "someone" dedicated to being the mailchimp, who is not in the sudo group:

root@mail:~# cd /home root@mail:/home# ls fritz sammy wilma root@mail:/home# cd sammy root@mail:/home/sammy# ll total 24 drwxr-x--- 3 sammy sammy 4096 May 18 22:18 ./ drwxr-xr-x 5 root root 4096 May 16 23:50 ../ -rw-r--r-- 1 sammy sammy 220 Oct 7 2021 .bash_logout -rw-r--r-- 1 sammy sammy 3771 Oct 7 2021 .bashrc -rw-r--r-- 1 sammy sammy 0 May 16 22:24 .cloud-locale-test.skip -rw-r--r-- 1 sammy sammy 807 Oct 7 2021 .profile drwxrwx--x 2 sammy mymail 4096 May 18 22:18 Maildir/ root@mail:/home/sammy#

Along with:

root@mail:~# sudo newaliases root@mail:~# cat /etc/aliases # See man 5 aliases for format postmaster: root

Q3) Should I substitute sammy for root in the above?

Unattended upgrades

I think I got this squared away:

root@mail:~# sudo vi /etc/apt/apt.conf.d/50unattended-upgrades root@mail:~# sudo vi /etc/apt/apt.conf.d/20auto-upgrades root@mail:~# cat /etc/apt/apt.conf.d/20auto-upgrades APT::Periodic::Update-Package-Lists "1"; APT::Periodic::Unattended-Upgrade "1"; APT::Periodic::Download-Upgradeable-Packages "1"; //APT::Periodic::Verbose "1"; APT::Periodic::AutocleanInterval "7"; root@mail:~# sudo dpkg-reconfigure --priority=low unattended-upgrades root@mail:~#

Configuring /etc/hosts

I've made considerable progress here, having now figured out that this file does not get overwritten as it threatens:

root@mail:~# cat /etc/hosts # Your system has configured 'manage_etc_hosts' as True. # As a result, if you wish for changes to this file to persist # then you will need to either # a.) make changes to the master file in /etc/cloud/templates/hosts.de +bian.tmpl # b.) change or remove the value of 'manage_etc_hosts' in # /etc/cloud/cloud.cfg or cloud-config from user-data # 127.0.1.1 fourth fourth 127.0.0.1 localhost 192.168.12.1 mail.merrillpjensen.com mail # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts root@mail:~#

I conjured this from thin air:

192.168.12.1 mail.merrillpjensen.com mail

, but I'm trying to square it with:

root@mail:~# hostname -d merrillpjensen.com root@mail:~# hostname -f mail.merrillpjensen.com

and

root@mail:~# host -t MX mail mail has no MX record root@mail:~# host -t MX mail.merrillpjensen.com Host mail.merrillpjensen.com not found: 2(SERVFAIL) root@mail:~# host -t MX merrillpjensen.com Host merrillpjensen.com not found: 2(SERVFAIL) host -t MX fourth ;; connection timed out; no servers could be reached root@mail:~#

Less the gory details, my questions are:

Q1) Is gitlab a better source host than github (or google)?

Q2) How do I silence the mail queue?

Q3) Should I substitute sammy for root in the above?

Q4) What does /etc/aliases look like on a working install?

Thanks all for comments,

Replies are listed 'Best First'.
Re: [OT] Completing a debian install with the appropriate trimmings
by davies (Prior) on Oct 16, 2022 at 11:26 UTC

    I, too, have referred to the debian.org document to which you link. I have spent more time linking to https://samhobbs.co.uk/2013/12/raspberry-pi-email-server-part-1-postfix, which is a bit dated. I have written my own guide which works for me. If you (or anyone else) /msg me an email address, I'll gladly send you a copy with a few caveats.

    Q1) Is gitlab a better source host than github (or google)?

    How long is a piece of string? Everything is a compromise and it must depend on how those compromises fit your use case. If you are trying to build a library of code for a CV, Github is where people will start looking. I run my own server, turned off most of the time, using gogs https://gogs.io/, which ISTR is available on apt.

    Q2) How do I silence the mail queue?

    If by "silence" you mean "purge obsolete entries", sudo postsuper -d ALL is another option.

    "It seemed to me I needed "someone" dedicated to being the mailchimp, who is not in the sudo group" is not my experience.

    Q3) Should I substitute sammy for root in the above?

    I'm not sure. I have a dedicated Pi running postfix, so root and any "boss" user of postfix are essentially the same, so I haven't had to work through your problem.

    3.1 - Unattended upgrades

    Raspbian (or whatever it's called now) comes with this set up by default. The file contains lots of comments, removed below:

    dr@mail:~ $ cat /etc/apt/apt.conf.d/50unattended-upgrades Unattended-Upgrade::Origins-Pattern { "origin=Debian,codename=${distro_codename},label=Debian-Securi +ty"; }; Unattended-Upgrade::Package-Blacklist { };

    3.2 /etc/hosts

    dr@mail:~ $ cat /etc/hosts 127.0.0.1 localhost mail ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters 127.0.1.1 mail

    Q4) What does /etc/aliases look like on a working install

    dr@mail:~ $ sudo cat /etc/aliases [sudo] password for dr: # See man 5 aliases for format #postmaster: root postmaster: dr root: dr

    Regards,

    John Davies

      Thx, John, your examples are very helpful. I've taken some more steps to get squared away, added a little architecture. So I see postsuper is how to deal with mailq:

      wilma@mail:~$ sudo -i [sudo] password for wilma: root@mail:~# which postsuper /usr/sbin/postsuper root@mail:~# man postsuper root@mail:~# mailq ... 18AEEFCBE8 2970 Mon Oct 17 20:14:02 MAILER-DAEMON (Host or domain name not found. Name service error for name=merrillpje +nsen.com type=MX: Host not found, try again) root@merrillpjensen.com -- 19 Kbytes in 10 Requests. root@mail:~# postsuper -d 18AEEFCBE8 postsuper: 18AEEFCBE8: removed postsuper: Deleted: 1 message root@mail:~# mailq -Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient------- ... 6105EFCBD7 2970 Fri Oct 14 20:16:08 MAILER-DAEMON (Host or domain name not found. Name service error for name=merrillpje +nsen.com type=MX: Host not found, try again) root@merrillpjensen.com -- 16 Kbytes in 9 Requests. root@mail:~# postsuper -d ALL postsuper: Deleted: 9 messages root@mail:~# mailq Mail queue is empty root@mail:~#

      I'm glad to be able to do that. I wondered upthread aloud whether these wraiths would live forever. Apparently, these 10 didn't.

      aliases in etc

      I think I'm getting closer to the mark here.

      root@mail:~# vi /etc/hosts root@mail:~# cat /etc/hosts ... 127.0.1.1 mail.merrillpjensen.com mail 127.0.0.1 localhost 192.168.12.1 mail.merrillpjensen.com mail ...

      I don't know which numbers on the left a person can use, and I'm taking my best 2 guesses with:

      127.0.1.1 mail.merrillpjensen.com mail 192.168.12.1 mail.merrillpjensen.com mail

      , figuring that one or the either might be right, given other settings. We shall see.

      Moving on to /etc/alias, I tried to imitate davies' scheme:

      root@mail:~# vi /etc/aliases root@mail:~# cat /etc/aliases # See man 5 aliases for format postmaster: sammy root: sammy root@mail:~# newaliases root@mail:~# cat /etc/aliases # See man 5 aliases for format postmaster: sammy root: sammy

      Looking at the mx records

      So, I think this is where I have a glitch, and you have to start with your service provider, which, in my case is Digital Ocean. I've had the account for long enough that port 25 isn't blocked, which we determined at the end of the last thread. (Which reminds me, what's stevieb up to? If I'm OT, let's have some quality threaddrift.)

      This screenshot shows my DNS records as they appear on my account with DO. In creating this MX record, I found myself unable to enter anything other than the @ character for the hostname, which outputs it like you see.

      Q1) Is it plausibly correct?

      I think write-ups are good for people. I was about to lay out all the host commands I had spewed out that hadn't worked:

      , and then I hit paydirt looking at my own data during the writeup:

      root@mail:~# host -t MX www.merrillpjensen.com www.merrillpjensen.com mail is handled by 5 mail.merrillpjensen.com. root@mail:~#

      Q2) Is it plausibly correct? Here is what the hostname command reveals:

      root@mail:~# man hostname root@mail:~# hostname -f mail.merrillpjensen.com root@mail:~# hostname -d merrillpjensen.com root@mail:~#

      other architecture

      I checked the architecture for /etc/bash.bashrc:

      root@mail:~# cat /etc/bash.bashrc # System-wide .bashrc file for interactive bash(1) shells. ... export MAIL=~/Maildir root@mail:~#

      This looks right to me. Changed this:

      postconf -e "mydestination = mail.merrillpjensen.com, localhost.locald +omain, localhost"

      Q3) Is it plausibly correct?

      I thought there was a utility to add the appropriate subdirectories of Maildir, but I couldn't hook it up, so I did it on the command line:

      cd /home/sammy/Maildir/ mkdir new cur temp

      I have tried everything but the kitchen sink with telnet, I still don't have anything getting to sammy:

      root@mail:/home/sammy/Maildir# telnet localhost 25 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 220 mail ESMTP Postfix (Ubuntu) mail from:<root@www.merrillpjensen.com> rcpt to:<sammy@www.merrillpjensen.com> data To: sammy@www.merrillpjensen.com From: root@www.merrillpjensen Subject: Hey my first email This is my first email on debian postfix after installing configuring +it. It was easy. (like hell) Sounds good!250 2.1.0 Ok 250 2.1.5 Ok 354 End data with <CR><LF>.<CR><LF> . quit . 250 2.0.0 Ok: queued as 8BC30FCD5B quit 221 2.0.0 Bye Connection closed by foreign host. root@mail:/home/sammy/Maildir# ll -R .: total 20 drwxrwx--x 5 sammy mymail 4096 Oct 18 05:27 ./ drwxr-x--- 3 sammy sammy 4096 May 18 22:18 ../ drwxr-xr-x 2 sammy mymail 4096 Oct 18 05:27 cur/ drwxr-xr-x 2 sammy mymail 4096 Oct 18 05:27 new/ drwxr-xr-x 2 sammy mymail 4096 Oct 18 05:27 temp/ ./cur: total 8 drwxr-xr-x 2 sammy mymail 4096 Oct 18 05:27 ./ drwxrwx--x 5 sammy mymail 4096 Oct 18 05:27 ../ ./new: total 8 drwxr-xr-x 2 sammy mymail 4096 Oct 18 05:27 ./ drwxrwx--x 5 sammy mymail 4096 Oct 18 05:27 ../ ./temp: total 8 drwxr-xr-x 2 sammy mymail 4096 Oct 18 05:27 ./ drwxrwx--x 5 sammy mymail 4096 Oct 18 05:27 ../ root@mail:/home/sammy/Maildir# mailq -Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient------- 8BC30FCD5B* 479 Wed Oct 19 06:33:56 root@www.merrillpjensen.com sammy@www.merrillpjensen.com 7AFE9FCD5F 966 Tue Oct 18 20:00:01 root@merrillpjensen.com (Host or domain name not found. Name service error for name=merrillpje +nsen.com type=MX: Host not found, try again) root@merrillpjensen.com 0AB56FCD57 460 Tue Oct 18 05:50:04 root@merrillpjensen.com (Host or domain name not found. Name service error for name=merrillpje +nsen.com type=MX: Host not found, try again) sammy@merrillpjensen.com -- 1 Kbytes in 3 Requests. root@mail:/home/sammy/Maildir#

      That last try looked particularly wrong with the www in it, but I have previous versions failing without that. I wouldn't say that I have a strong handle on fqdn:

      THE FQDN The FQDN (Fully Qualified Domain Name) of the system is the n +ame that the resolver(3) returns for the host name, such as, ursula.exam +ple.com. It is usually the hostname followed by the DNS domain name ( +the part after the first dot). You can check the FQDN using hostname -- +fqdn or the domain name using dnsdomainname. You cannot change the FQDN with hostname or dnsdomainname. The recommended method of setting the FQDN is to make the hos +tname be an alias for the fully qualified name using /etc/hosts, DNS, +or NIS. For example, if the hostname was "ursula", one might have a + line in /etc/hosts which reads 127.0.1.1 ursula.example.com ursula Technically: The FQDN is the name getaddrinfo(3) returns for t +he host name returned by gethostname(2). The DNS domain name is the pa +rt after the first dot. Therefore it depends on the configuration of the resolver (usu +ally in /etc/host.conf) how you can change it. Usually the hosts file i +s parsed before DNS or NIS, so it is most common to change the +FQDN in /etc/hosts.

      I was hoping to break through with this effort, but I seem to have come up short again.

[OT] Completing a debian install with the appropriate trimmings
by hippo (Bishop) on Oct 16, 2022 at 10:27 UTC
    Q1) Is gitlab a better source host than github (or google)?

    Yes, because it isn't owned by a malignant corporation and because it's open source.

    Q2) How do I silence the mail queue?

    You don't want to silence it, you just want to remove the messages which are stuck in the queue and will never be delivered. qtool.pl is probably best for this.

    Q3) Should I substitute sammy for root in the above?

    You could if someone is going to be sure to read sammy's email. So long as someone is getting and reading the postmaster emails it can be any user.

    Q4) What does /etc/aliases look like on a working install?

    I'm not sure what you mean by this. The format is as described in the man page. Are you asking for someone to post an in-production aliases file?


    🦛