N1v0k / docktartar

Docker container for periodically and recursively taring docker volumes.
MIT License
2 stars 0 forks source link

emails are empty #6

Open hanscees opened 7 years ago

hanscees commented 7 years ago

Hi,

the email sent are empty I am afraid

This is what the email source looks like ############################################### Received: by ba0302860cf5 (sSMTP sendmail emulation); Fri, 13 Oct 2017 14:07:11 +0200 Date: Fri, 13 Oct 2017 14:07:11 +0200 From: Docktartar docktartar@hanscees.com Subject: Docktartar ################################################

I also get a number of completely empty emails from root.

running a backup by hand show this:

docker exec -it backup_docktartar_1 /root/docktartar.sh From: Docktartar docktartar@hanscees.com Subject: Docktartar Starting Backup - Fri Oct 13 14:39:30 CEST 2017 . Mounting the SMB share Error response from daemon: No such container: nextcloud Stopping Looking for sockets to exclude them from the archive... Creating TAR-Archive from /backupSource Error response from daemon: No such container: nextcloud Error: failed to start containers: nextcloud Restarting Chown the archive chown: /backupTarget/dockertar.14.39.30-13.10.17.tar.gz: Permission denied Archive size: 64.0K Unmounting the SMB share Backup dockertar took 0 minutes and 14 seconds. Sending email to hans@cees.com Finished.

N1v0k commented 7 years ago
  1. It seems like you have no container named 'nextcloud' can you post your output of docker ps

  2. You can check if inside the container there is a file called log.mail in the directory /root This file is piped into ssmtp, which is the application responsible for sending the mail.

You can check it like:

docker exec -it docktartar cat /root/log.mail

(replace docktartar with the name of the docktartar container)

And post the output please.

Is the sendmail script working that tests the mail sending feature?

hanscees commented 7 years ago

hi, don't worry about the nextcloud thing, thats a configuration mistake on my side.

The email send by the test script is empty too: root@core containers/BACKUP2017-10-07# docker exec -it backup_docktartar_1 /root/test-mail.sh Sending test email Success

Received: by 6ed52cc03f24 (sSMTP sendmail emulation); Fri, 13 Oct 2017 21:17:37 +0200 Date: Fri, 13 Oct 2017 21:17:37 +0200 From: Docktartar docktartar@hanscees.com Subject: Docktartar

root@core containers/BACKUP2017-10-07# docker exec -it backup_docktartar_1 cat /root/log.mail Archive size: 48.4M Backup dockertar took 0 minutes and 5 seconds. Archive size: 48.4M Backup dockertar took 0 minutes and 4 seconds. Archive size: 64.0K Backup dockertar took 0 minutes and 14 seconds.

If I log into the container with bash and send email with ssmtp it also does not sent any text in the email body

docker exec -it backup_docktartar_1 bash cd / bash-4.3# cat testmail.mail From: Docktartar docktartar@hanscees.com Subject: Docktartar Your e-mail settings seem to work fine! bash-4.3# cat testmail.mail | ssmtp hans@cees.com

The email than again is empty.

So ssmtp does not send anything in the body I am afraid.

hanscees commented 7 years ago

If I make an tcpdump, ssmtp seems to make a mistake. So looks like a bug in ssmtp or something.

21:35:13.476085 IP pc-00066.hanscees.net.41069 > mail.hanscees.net.smtp: Flags [P.], seq 89:95, ack 238, win 229, length 6 E...C.@.?.v....B...o.m../I..)..oP...(...DATA

21:35:13.476752 IP pc-00066.hanscees.net.41069 > mail.hanscees.net.smtp: Flags [P.], seq 95:182, ack 252, win 229, length 87 E...C.@.?.u....B...o.m../I..)..}P...9...Received: by 6ed52cc03f24 (sSMTP sendmail emulation); Fri, 13 Oct 2017 21:35:13 +0200

21:35:13.515989 IP pc-00066.hanscees.net.41069 > mail.hanscees.net.smtp: Flags [P.], seq 182:332, ack 252, win 229, length 150 E...C.@.?.u....B...o.m../I..)..}P.... ..Date: Fri, 13 Oct 2017 21:35:13 +0200 From: Docktartar docktartar@hanscees.com Subject: Docktartar Your e-mail settings seem to work fine!

.

21:35:13.543634 IP pc-00066.hanscees.net.41069 > mail.hanscees.net.smtp: Flags [P.], seq 332:338, ack 288, win 229, length 6 E...C.@.?.v....B...o.m../I..)...P...%...QUIT

hanscees commented 7 years ago

I am trying to use mailx

apk add --updat mailx

If I change the line ############################# ssmtp ${EMAIL_TO} < log.mail to

mail -s docktartar ${EMAIL_TO} < log.mail

I get an email fine.

content of email is: Received: by 6ed52cc03f24 (sSMTP sendmail emulation); Fri, 13 Oct 2017 22:24:23 +0200 From: "root" root@6ed52cc03f24 Date: Fri, 13 Oct 2017 22:24:23 +0200 To: hanscees@hanscees.com Subject: docktartar

Archive size: 48.4M Backup dockertar took 0 minutes and 5 seconds. Archive size: 48.4M Backup dockertar took 0 minutes and 4 seconds. Archive size: 64.0K Backup dockertar took 0 minutes and 14 seconds. Archive size: 64.0K Backup dockertar took 0 minutes and 13 seconds.

N1v0k commented 7 years ago

This is strange, it has to be something with ssmtp. The master branch is working fine and I also get the same bug with the newest version of ssmtp.

I will see if i can fix this by switching to mailx.

Thanks for your efforts!

hanscees commented 7 years ago

No worries! I am not sure mailx can use auth though. But for simple smtp its rock solid