From 774b65510c58e86fdc207506df869a5d9378c107 Mon Sep 17 00:00:00 2001 From: croax Date: Wed, 14 Sep 2022 22:18:24 +0200 Subject: [PATCH] Mail avec quoted-printable --- scripts/rapport_activite.sh | 9 +++------ scripts/sendmail_account.sh | 12 ++++++++++-- scripts/sendmail_redirect.sh | 12 ++++++++++-- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/scripts/rapport_activite.sh b/scripts/rapport_activite.sh index 4e0e517..b16b9a9 100755 --- a/scripts/rapport_activite.sh +++ b/scripts/rapport_activite.sh @@ -1,11 +1,8 @@ #!/bin/sh -users_num_robot=13 echo -n "Pre-processing..." -users_num_all=$( ls /home/ | wc -w ) -users_num_human=$(( $users_num_all-$users_num_robot )) - +users_num_all=$( wc -l /etc/postfix/virtual_members | awk '{print $1 - 1}') size_home=$( du -sh /home | awk '{print $1}' ) size_per_user=$( du -h --max-depth=1 /home | sort -rh ) @@ -15,5 +12,5 @@ echo "[done]" echo "Total number of mailboxes: " $users_num_all echo "Number of real human mail users: " $users_num_human echo "Home storage: " $size_home -echo "Users: " -echo $size_per_user | xargs -n 2 echo +#echo "Users: " +#echo $size_per_user | xargs -n 2 echo diff --git a/scripts/sendmail_account.sh b/scripts/sendmail_account.sh index d7a40e9..e51c71f 100755 --- a/scripts/sendmail_account.sh +++ b/scripts/sendmail_account.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash if [ $# -ne 3 ] ; then echo -e "Params:\t " >&2 @@ -11,13 +11,19 @@ password=$3 echo -n "Sending mail to \"$email\" for account creation \"$user\"..." date=$( date -R ) -sendmail $email < To: <$email> Date: $date Subject: Mise en place de vos services Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: quoted-printable +EOF + ) + +message=$(cat < " >&2 @@ -12,13 +12,18 @@ date=$( date -R ) echo -n "Sending mail to \"$email\": account redirection from \"$user\"..." -sendmail $email < To: <$email> Date: $date Subject: Mise en place de vos services Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: quoted-printable +EOF + ) + +message=$(cat <