Acme.sh: Report bugs to mail notify

Created on 13 May 2019  路  17Comments  路  Source: acmesh-official/acme.sh

This is the place to report bugs in the mail notify.

If you experience a bug, please report it in this issue.

Thanks!

3rd party api

All 17 comments

Tried to use the new notify mail feature. Using latest acme.sh from git. mail command is installed

export MAIL_BIN="mail"
export MAIL_FROM="[email protected]"
export MAIL_TO="[email protected]"

then used this command to test

"/work/.acme.sh"/acme.sh --debug --cron --set-notify --notify-hook mail --notify-level 3 --notify-mode 1 --home "/work/.acme.sh"

which leads to

[Sat May 18 19:55:44 UTC 2019] Lets find script dir.
[Sat May 18 19:55:44 UTC 2019] _SCRIPT_='/work/.acme.sh/acme.sh'
[Sat May 18 19:55:44 UTC 2019] _script='/work/.acme.sh/acme.sh'
[Sat May 18 19:55:44 UTC 2019] _script_home='/work/.acme.sh'
[Sat May 18 19:55:44 UTC 2019] Using config home:/work/.acme.sh
https://github.com/Neilpang/acme.sh
v2.8.2
[Sat May 18 19:55:44 UTC 2019] Using config home:/work/.acme.sh
[Sat May 18 19:55:44 UTC 2019] ACME_DIRECTORY='https://acme-v02.api.letsencrypt.org/directory'
[Sat May 18 19:55:44 UTC 2019] Set notify level to: 3
[Sat May 18 19:55:44 UTC 2019] Set notify mode to: 1
[Sat May 18 19:55:44 UTC 2019] Set notify hook to: mail
[Sat May 18 19:55:44 UTC 2019] Found /work/.acme.sh/notify/mail.sh
[Sat May 18 19:55:44 UTC 2019] _subject='Hello, this is notification from acme.sh'
[Sat May 18 19:55:44 UTC 2019] _content='If you receive this email, your notification works.'
[Sat May 18 19:55:44 UTC 2019] _statusCode='0'
[Sat May 18 19:55:44 UTC 2019] Not implemented yet.
[Sat May 18 19:55:44 UTC 2019] Error send message by mail_send
[Sat May 18 19:55:44 UTC 2019] Set /work/.acme.sh/notify/mail.sh error.
[Sat May 18 19:55:44 UTC 2019] Can not set notify hook to: mail

are there any extra steps needed for notify to work?

are there any extra steps needed for notify to work?

@jahlives This feature is waiting to be merged into master https://github.com/Neilpang/acme.sh/pull/2259.

Thanks will try with dev branch then

@jahlives Merged into master https://github.com/Neilpang/acme.sh/pull/2272.

Tried it with latest version from master branch and I get the following behavior.

Command used every time:
acme.sh --set-notify --notify-hook mail --debug

_1. try:_
account.conf

MAIL_FROM="[email protected]"
MAIL_TO="[email protected]"

Result:
```[Wed 22 May 2019 05:50:59 PM UTC] Lets find script dir.
[Wed 22 May 2019 05:50:59 PM UTC] _SCRIPT_='/usr/lib/acme.sh/acme.sh'
[Wed 22 May 2019 05:50:59 PM UTC] _script='/usr/lib/acme.sh/acme.sh'
[Wed 22 May 2019 05:50:59 PM UTC] _script_home='/usr/lib/acme.sh'
[Wed 22 May 2019 05:50:59 PM UTC] Using config home:/etc/acme.sh
https://github.com/Neilpang/acme.sh
v2.8.2
[Wed 22 May 2019 05:50:59 PM UTC] Using config home:/etc/acme.sh
[Wed 22 May 2019 05:50:59 PM UTC] ACME_DIRECTORY='https://acme-v02.api.letsencrypt.org/directory'
[Wed 22 May 2019 05:50:59 PM UTC] Set notify hook to: mail
[Wed 22 May 2019 05:50:59 PM UTC] Found /usr/lib/acme.sh/notify/mail.sh
[Wed 22 May 2019 05:50:59 PM UTC] _subject='Hello, this is notification from acme.sh'
[Wed 22 May 2019 05:50:59 PM UTC] _content='If you receive this email, your notification works.'
[Wed 22 May 2019 05:50:59 PM UTC] _statusCode='0'
[Wed 22 May 2019 05:51:00 PM UTC] mail send success.
[Wed 22 May 2019 05:51:00 PM UTC] mail Success

by running command I will receive email but Subject will be empty. And variables will be renamed to SAVED_MAIL_TO/FROM.

_2. try_
Without changing `account.conf` after first try, I've run the same command again and got the same output but this time I didn't receive email. Looking at log file from postfix, I can see that MAIL_FROM and MAIL_TO are not getting properly set.

_3. try_

export MAIL_FROM="acme.[email protected]"
export MAIL_TO="[email protected]"
```
setting ENV variables before running command, I get the same result as in the first try. (Subject is still empty)

_4. try_
export MAIL_BIN="mail"
Running command with MAIL_BIN set to "mail" I receive email and subject is NOT empty.

_5. try_
export MAIL_BIN="sendmail"
This time I get the same result as in the first try.

Conclusion:
Why MAIL_BIN = "sendmail" is not working is because function _mail_body is looking for variable $_MAIL_BIN, but this variable is declared in function _mail_cmnd which is executed after.

As to why FROM and TO variables are not working when they are read from account.conf with prefix SAVED_ I have to clue.

I tried it with ssmtp and it doesn't work
1: _MAIL_CMD=$(_mail_cmnd) does not insert $MAIL_TO into command string. Started to work after moving that string down, above "result=..."
2: $_MAIL_BODY does not contain subject and content type headers.

@zuexo @raven-kg Thanks for feedback. I'll look close to this issues tomorrow.

@honzahommer
Please make sure every command is working as expected.

@zuexo @raven-kg Please see #2293.
Still doesn't work with ssmtp. This is point 1 which I mentioned earlier - $MAIL_TO is not passed to ssmtp.
[Mon May 27 03:46:38 UTC 2019] Set notify level to: 3 [Mon May 27 03:46:38 UTC 2019] Set notify mode to: 0 [Mon May 27 03:46:38 UTC 2019] Set notify hook to: mail [Mon May 27 03:46:38 UTC 2019] Found /opt/acme/notify/mail.sh [Mon May 27 03:46:39 UTC 2019] ssmtp: 503 Error: need RCPT command [Mon May 27 03:46:39 UTC 2019] Error send message by mail_send [Mon May 27 03:46:39 UTC 2019] Set /opt/acme/notify/mail.sh error. [Mon May 27 03:46:39 UTC 2019] Can not set notify hook to: mail

@raven-kg Are you sure you tried with this file from #2293, because it's working for me and I had the same problem.

@zuexo Ooops! It's really works) Looks like I used one of old files. @honzahommer I apologize for the incorrect report above. I confirm that now everything is works fine for me.

A 'Renew Skipped' mail is sent daily even with NOTIFY_LEVEL='1' in account.conf. I tested options 1 and 2 but with the same result. Acme.sh version 2.8.2. For now, I'll add the parameters to the crontab. But I assume this should be used from the configuration file?

A 'Renew Skipped' mail is sent daily even with NOTIFY_LEVEL='1' in account.conf. I tested options 1 and 2 but with the same result. Acme.sh version 2.8.2. For now, I'll add the parameters to the crontab. But I assume this should be used from the configuration file?

@moverman Please see https://github.com/Neilpang/acme.sh/issues/2321 // cc @Neilpang

@honzahommer

Can you please take a look at https://github.com/acmesh-official/acme.sh/issues/2837 ?

Thanks.

acme.sh v 2.8.6
mail.sh line 127 is missing an underscore. Should read
echo "Subject: $_subject"

I've just switched to ssmtp from mailgun and was wondering why I stopped getting a subject in my emails!

acme.sh v 2.8.6
mail.sh line 127 is missing an underscore. Should read
echo "Subject: $_subject"

I've just switched to ssmtp from mailgun and was wondering why I stopped getting a subject in my emails!

https://github.com/acmesh-official/acme.sh/issues/2837#issuecomment-613132014

Was this page helpful?
0 / 5 - 0 ratings