What's new

amtm amtm - e-mail settings.

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

miazza

Regular Contributor
Hi all, I'm trying to set e-mail from amtm em Option and I'm getting crazy.

I have tried with gmail, tiscali, yahoo but I always get an error.

I have the following settings:

1. Edit From address: asus-merlin@router.com
2. Edit To name: Matteo
3. Edit To address: user@tiscali.it
4. Edit Router name: ASUS
5. Edit User name: user@tiscali.it
6. Edit Password: mypassword
7. Edit SMTP Server: smtp.tiscali.com
8. Edit Server port: 465
9. Edit Protocol: smtps
10. Edit SSL flag: --insecure
11. Send testmail to confirm settings

Tiscali account does not use 2FA and the same settings are well working within Outlook client.

When I try to test mail I get this error:

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (55) MAIL failed: 550

sending testmail failed

Note the curl: error above and check your settings

I tried also with my gmail account and also the Yahoo one with the App PAssword and it does not work.
May be I'm doing something wrong ?
 
Now succeeded with Yahoo account and APP Password with one space every 4 digit:

1. Edit From address: user@yahoo.com (this shall exist !!!)
2. Edit To name: Matteo
3. Edit To address: user@tiscali.it
4. Edit Router name: ASUS
5. Edit User name: user@yahoo.com
6. Edit Password: select Edit to view (if Yahoo App Password is used it shall be with space xxxx xxxx xxxx xxxx)
7. Edit SMTP Server: smtp.mail.yahoo.com
8. Edit Server port: 465
9. Edit Protocol: smtps
10. Edit SSL flag: --insecure
11. Send testmail to confirm settings

Thanks
 
Last edited:
How do you get this to work with Gmail? I have tried with two different accounts. And I get login failed on both.
There is no typo.
That will likely be the particular Google Account you are using will not allowing send from "insecure" or "less secure" apps.
Best to enable 2 step verification and then set an App Password for the amtm email account you want to use. You use that App password in place of the normal password for the Google account.
 
How do you get this to work with Gmail? I have tried with two different accounts. And I get login failed on both.
There is no typo.

If use less secure app is turned ON it works with the SSL flag --anyauth.
Though this will only work for 30 days.
Google will remove this permanently.

https://support.google.com/accounts/answer/6010255?hl=en&authuser=1
I did not manee either on gmail. I lost hours with all the possible different try without success.
I managed with Yahoo and App Password.

Looking at the wiky: https://github.com/RMerl/asuswrt-merlin.ng/wiki/Sending-Email
A good solution is the free smtp server: https://www.mailjet.com/feature/smtp-relay/

200 e-mail per day is more than enough for my home needs :)
 
That will likely be the particular Google Account you are using will not allowing send from "insecure" or "less secure" apps.
Best to enable 2 step verification and then set an App Password for the amtm email account you want to use. You use that App password in place of the normal password for the Google account.
How do you set the App Password in Gmail ? I did not manage ...
 
How do you set the App Password in Gmail ? I did not manage ...
You go to accounts.google.com and sign in.
Under security you turn on 2-step verification (2FA)
Under Security you choose App Password.
You select mail and then choose custom.

in amtm -> em -> password -> set the App password
you can use --anyauth as SSL flag

you only have to do this for the account you are going to send the email from. You can ofcourse use the same mail adress from both from and to as adress.
 
You go to accounts.google.com and sign in.
Under security you turn on 2-step verification (2FA)
Under Security you choose App Password.
You select mail and then choose custom.

in amtm -> em -> password -> set the App password
you can use --anyauth as SSL flag

you only have to do this for the account you are going to send the email from. You can ofcourse use the same mail adress from both from and to as adress.
My question is, where did you get the App pasword in Gmail .
I cannot find it on Gmail (but I found it in Yahoo).
 
My question is, where did you get the App pasword in Gmail .
I cannot find it on Gmail (but I found it in Yahoo).
I went to the website myaccount.google.com then i setup the 2FA which lies under the tab "security".
After that, on the very same page under the tab "security" where 2FA is, there is an option called App Password. Click on that, its like a setup tutorial.
 
Could someone advise what the amtm email settings script is used for. Can I use it for example to notify me when a client connects or disconnects the open on server?

Many thanks
 
Could someone advise what the amtm email settings script is used for. Can I use it for example to notify me when a client connects or disconnects the open on server?

Many thanks
Might as well answer here since you PMd me the same question.

I developed a solution to send email with an attachment from the router a long time ago for AB-Solution, the predecessor of Diversion.
With the success and widespread use of Diversion other script writers began to use my email code and especially the already set user credentials for their own scripts.

I eventually decided to copy the email code over to amtm so that a wider user base could use the now common way of setting up email settings.

If you use an Asuswrt-Merlin script (through amtm or otherwise) that uses a mail function, it will most likely depend on the settings being set in amtm.
 
I have successful sent a test mail via amtm mail settings. If I want a script to send an email as use the amtm config settings what would the command line look like? Many thanks.
 
If I want a script to send an email as use the amtm config settings what would the command line look like? Many thanks.

Code:
. /jffs/addons/amtm/mail/email.conf
EMAIL_DIR=/jffs/addons/amtm/mail
/usr/sbin/curl $verbose --url $PROTOCOL://$SMTP:$PORT \
--mail-from "$FROM_ADDRESS" --mail-rcpt "$TO_ADDRESS" \
--upload-file /tmp/divmail-body \
--ssl-reqd \
--user "$USERNAME:$(/usr/sbin/openssl aes-256-cbc $emailPwEnc -d -in "${EMAIL_DIR}/emailpw.enc" -pass pass:ditbabot,isoi)" $SSL_FLAG

Change /tmp/divmail-body to the path of your Email text. Your Email will need the Subject/From/Date Header fields and the body of your text at minimum. Merlin Wiki
 
Last edited:
thank you. I ran that on the command line and got the following:

Can't open /emailpw.enc for reading, No such file or directory
4151582736:error:02001002:lib(2):func(1):reason(2):NA:0:fopen('/emailpw.enc','rb')
4151582736:error:2006D080:lib(32):func(109):reason(128):NA:0:
-sh: /jffs/addons/amtm/mail/email.conf: Permission denied
 
thank you. I ran that on the command line and got the following:

Can't open /emailpw.enc for reading, No such file or directory
4151582736:error:02001002:lib(2):func(1):reason(2):NA:0:fopen('/emailpw.enc','rb')
4151582736:error:2006D080:lib(32):func(109):reason(128):NA:0:
-sh: /jffs/addons/amtm/mail/email.conf: Permission denied
You'll have to either set variable EMAIL_DIR or replace ${EMAIL_DIR} with /jffs/addons/amtm/mail/
 
Sorry was missing the directory variable... edited original
 
Hello. I'm trying to set up sending to a simple local gateway without smtp-to-telegram authorization, but I keep getting an error.

my settings:

Code:
# Server settings #
SMTP="192.168.0.3"
PORT="2525"
PROTOCOL="smtp"
SSL_FLAG="--insecure"


Code:
*   Trying 192.168.2.3:2525...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* Connected to 192.168.0.3 (192.168.0.3) port 2525 (#0)
< 220 kostyaesmukov-smtp_to_telegram1 SMTP Guerrilla(unknown) #19 (1) 2022-12-07T13:37:22Z
> EHLO amtm-mail-body
< 250-kostyaesmukov-smtp_to_telegram1 Hello
< 250-SIZE 50000000
< 250-PIPELINING
< 250-ENHANCEDSTATUSCODES
< 250 HELP
* STARTTLS not supported.
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
* Closing connection 0
curl: (64) STARTTLS not supported.
sending testmail failed


Is it possible to still enable sending without encryption?
 
Hello. I'm trying to set up sending to a simple local gateway without smtp-to-telegram authorization, but I keep getting an error.

Code:
# Server settings #
SMTP="192.168.0.3"
PORT="2525"
PROTOCOL="smtp"
SSL_FLAG="--insecure"

Is it possible to still enable sending without encryption?
Try unsetting the '--insecure' flag to nothing

My guess is curl won't revert to plainauth if there is an ssl flag set
 

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top