Explanation of possible mail issues

General forum for ~green, if we get a lot of more users and activity we'll add more topics
Post Reply
User avatar
alexlehm
Posts: 33
Joined: Thu Jun 29, 2023 11:29 pm
Location: Germany
Contact:

Explanation of possible mail issues

Post by alexlehm »

I'd like to propose a sentence about possible mail problems on the signup page

The registration process sends a reply mail from the admin which may get lost due to spam filtering in some cases, this means that if you have not received a reply after a few days, it might have gotten lost and you could either
- go to IRC and ask about your account
- send a mail to root@tilde.green from another email
- create a ticket on the osticket system
- send a mail to a user on their non-tilde email (this would require listing a few like my email, I could create a sl email for that)
- contact anyone on xmpp (here list of users)

we do not necessarily have to list all options, what do you think?
User avatar
jmjl
System Operator
Posts: 51
Joined: Mon Feb 06, 2023 3:10 pm

Re: Explanation of possible mail issues

Post by jmjl »

alexlehm wrote: Thu Nov 21, 2024 10:52 am I'd like to propose a sentence about possible mail problems on the signup page

The registration process sends a reply mail from the admin which may get lost due to spam filtering in some cases, this means that if you have not received a reply after a few days, it might have gotten lost and you could either
You might also check if you can access your account, the same email is sent to the username you requested to sign up, and it's unlikely it got lost locally, so you can try to ssh, and run the command shown below after you connect to get your account's password, after which you can connect to the mail server, and read the registratilon email using your email client.

Code: Select all

cat /var/mail/$USER |grep Your\ password|cut -d\" -f2
(maybe I should store this as /usr/local/bin/tildegreen_getpw? or make a signup hook somewhere (likely in /etc/bashrc) that checks if the above command gives output, and if it does, runs the code below which prints the first email begining from the To: header)

Code: Select all

awk '/^From/{p++} /^To:/{p++} p==4{exit} p>=2' /var/mail/$USER
alexlehm wrote: Thu Nov 21, 2024 10:52 am - go to IRC and ask about your account
Unlikely to succed, unless you give the username, and I read your message, but then you should go to #tilde.green, not #helpdesk (at least on ~chat)
alexlehm wrote: Thu Nov 21, 2024 10:52 am - send a mail to root@tilde.green from another email
That's a true and valid possibility.
alexlehm wrote: Thu Nov 21, 2024 10:52 am - create a ticket on the osticket system
OsTicket
Would be neat to get more users to use this :)
alexlehm wrote: Thu Nov 21, 2024 10:52 am - send a mail to a user on their non-tilde email (this would require listing a few like my email, I could create a sl email for that)
I should probably list another tilde, and put my acct there, instead of needing to involve users.
alexlehm wrote: Thu Nov 21, 2024 10:52 am - contact anyone on xmpp (here list of users)
xmpp:jmjl@tilde.green is my main XMPP account, also the ~green muc: xmpp:tilde.green@muc.tilde.green
User avatar
jmjl
System Operator
Posts: 51
Joined: Mon Feb 06, 2023 3:10 pm

Re: Explanation of possible mail issues

Post by jmjl »

jmjl wrote: Thu Nov 21, 2024 4:02 pm

Code: Select all

cat /var/mail/$USER |grep Your\ password|cut -d\" -f2
(maybe I should store this as /usr/local/bin/tildegreen_getpw? or make a signup hook somewhere (likely in /etc/bashrc) that checks if the above command gives output, and if it does, runs the code below which prints the first email begining from the To: header)

Code: Select all

awk '/^From/{p++} /^To:/{p++} p==4{exit} p>=2' /var/mail/$USER
This is likely to annoy users who keep that email in their mailbox, as it would show it on every login, maybe make the code thing be:

Code: Select all

if ! [ -f "/opt/tilde.green/bashrc/mailmsg/hushed/$USER" ]; then
if cat /var/mail/$USER | grep -q 'Your password'; then
awk '/^From/{p++} /^To:/{p++} p==4{exit} p>=2' /var/mail/$USER
cat <<EoC
If you're annoyed by seeing this every time you login, type the next line onto your shell:
/opt/tilde.green/bashrc/mailmsg/bin/opt-out
EoC
fi
fi
Having /opt/tilde.green/bashrc/mailmsg/bin/opt-out be:

Code: Select all

#!/bin/sh
[ "$(id -un)" != "tildegreen-bashrc" ] && { sudo -u tildegreen-bashrc /opt/tilde.green/bashrc/mailmsg/bin/opt-out "$1"; exit "$?"; }

# this let's admins set user instead of having to run the script manually, or edit it.
: "${user:=$SUDO_USER}"
opt_file="/opt/tilde.green/bashrc/mailmsg/hushed/$user"

case "$1" in
"in") rm "$opt_file"
"out") touch "$opt_file"
*) touch "$opt_file"
esac
And having /etc/sudoers.d/tildegreen-bashrc-mailmsg-optouts be:

Code: Select all

ALL ALL=(tildegreen-bashrc) NOPASSWD: /opt/tilde.green/bashrc/mailmsg/bin/opt-out
Having /opt/tilde.green/bashrc/mailmsg/hushed/ be owned by tildegreen-bashrc (or another service user name).
User avatar
jmjl
System Operator
Posts: 51
Joined: Mon Feb 06, 2023 3:10 pm

Re: Explanation of possible mail issues

Post by jmjl »

I just applied a little configuration change to do what I said in
jmjl wrote: Thu Nov 21, 2024 4:14 pm This is likely to annoy users who keep that email in their mailbox, as it would show it on every login, maybe make the code thing be:
But instead of having the "hush" feature be on a system stored folder, I put it on their "$HOME/.config".
Post Reply