namo
August 31, 2010, 4:59am
1
I have Mikrotik RouterOs 4.11 and I used a a backup scrip but it has stoped working two days ago
:log info "backup beginning now"
:global backupfile ([/system identity get name] )
/system backup save name=$backupfile
:log info "backup pausing for 10s"
:delay 10s
:log info "backup being emailed"
/tool e-mail send to="namo@hotmail.com" subject=([/system identity get name] . \
" Backup") from=namo@yahoo.com file=$backupfile server=69.147.102.58
:log info "backup finished"
Tool—>email setting
server IP: 69.147.102.58
port:587
from: namo@yahoo.com
user:namo@yahoo.com
password:xxxxxxxx
the backup file size is around 250kB. Do I need to split the code or increase the delay?
I saw a topic in the forum using 5min between backup and sending the email. Do I need that much time? Is it better to have delay with one script and two scripts
Note: the backup is working but I am not getting the email. what is wrong?
mrz
August 31, 2010, 7:23am
2
check your file list;
try to send email directly without $backupfile variable.
namo
August 31, 2010, 7:32am
3
It used to work. I ran the script below in new Terminal which mean I should get empty emty email:
/tool e-mail send to="namo@hotmail.com" subject=([/system identity get name] . \
" Backup") from=namo@yahoo.com server=69.147.102.58
but I got nothing. I tried gmail but I also get nothing. If thier is problem with SMTP or ports. What is the best email server?
mrz
August 31, 2010, 7:58am
4
If you are using gmail, make sure that correct settings and correct server address and port is specified
following config works
/tool e-mail send body=lala subject=aa to=me@somewhere.com from=router@lala.com server=209.85.227.16:587 password=xxxx user=yyyy@gmail.com tls=yes
namo
August 31, 2010, 8:15am
5
mrz:
If you are using gmail, make sure that correct settings and correct server address and port is specified
following config works
/tool e-mail send body=lala subject=aa to=me@somewhere.com from=router@lala.com server=209.85.227.16:587 password=xxxx user=yyyy@gmail.com tls=yes
I tried : /tool e-mail send body=lala subject=aa to=namo@hotmail.com tls=yes
after setting Tool–> email with
server:209.85.227.16
Port:587
from=Mikrotik
user=xxx@gmail.com
password=xxxx
mrz
August 31, 2010, 8:22am
6
you can enable email debug logs on the router and see error messages.
/system logging add action=memory topics=e-mail
namo
August 31, 2010, 8:41am
7
how can I copy the log to past it here
edit:
It seems that when I try yahoo email, I get error that free email can not use the service;
and when I use gmail I get nothing in the logging
I recommend this (for hotmail to addresses only) in the router:
/tool e-mail
set server=65.55.37.72
set from=namo@hotmail.com
Then try a test:
send to=namo@hotmail.com subject=“test email” body=“test email”
If you have trouble with this, try telnet to check the connection:
/system
telnet 65.55.37.72 25
The port should be 25, insure your dns is set correctly. The from email address must be valid, at least the format and domain, or the server will reject it.
namo
August 31, 2010, 9:29am
9
telnet result
Trying 65.55.37.72...
Connected to 65.55.37.72.
Escape character is '^]'.
220 col0-mc1-f16.Col0.hotmail.com Sending unsolicited commercial or bulk e-mail to Mi
crosoft's computer network is prohibited. Other restrictions are found at http://priv
acy.msn.com/Anti-spam/. Violations will result in use of equipment located in Califor
nia and other states. Tue, 31 Aug 2010 02:27:20 -0700
That is the correct response. I sent a test email from my router to your hotmail address using those settings. Did you get it?
namo
August 31, 2010, 9:38am
11
that’s afake email try namo1983@hotmail.com
I sent another with the correct address. It usually takes a few minutes for it to show up. I guess namo@hotmail.com is going to wonder who I am!
namo
August 31, 2010, 9:42am
13
I get test email from test@wififoryou.com . Is that you?
Yes, that’s me! So the settings above work. I used test@wififoryou.com instead of your from address, but all else is the same.
namo
August 31, 2010, 9:46am
15
I try those setting but I get nothing. Is the problem my ISP or my Mikrotik router?
If the email server is responding to the telnet, then it is probably something in your router. I know that hotmail and gmail only accept a few emails per hour from and to the same addresses, and then the email servers will not accept the email for a while.
Check your trash or spam folder also. There is a possibility they ended up there.
namo
August 31, 2010, 9:59am
17
log
13:55:31 e-mail,debug recv: 220 COL0-MC1-F4.Col0.hotmail.com Sending unsolicited comm
ercial or bulk e-mail to Microsoft's computer network is prohibited. Other restrictio
ns are found at http://privacy.msn.com/Anti-spam/. Violations will result in use of e
quipment located in Cal
13:55:31 e-mail,debug ifornia and other states. Tue, 31 Aug 2010 02:56:38 -0700
13:55:31 e-mail,debug send EHLO [192.168.1.60]
13:55:31 e-mail,debug recv: 250-COL0-MC1-F4.Col0.hotmail.com (3.11.0.113) Hello [82.1
78.18.160]
13:55:31 e-mail,debug recv: 250-SIZE 29696000
13:55:31 e-mail,debug recv: 250-PIPELINING
13:55:31 e-mail,debug recv: 250-8bitmime
13:55:31 e-mail,debug recv: 250-BINARYMIME
13:55:31 e-mail,debug recv: 250-CHUNKING
13:55:31 e-mail,debug recv: 250-AUTH LOGIN
13:55:31 e-mail,debug recv: 250-AUTH=LOGIN
13:55:31 e-mail,debug recv: 250 OK
13:55:31 e-mail,debug send AUTH LOGIN bmFtbzE5ODNAaG90bWFpbC5jb20=
13:55:31 e-mail,debug recv: 334 UGFzc3dvcmQ6
13:55:31 e-mail,debug send bWFuYWgxOTg=
13:55:32 e-mail,debug recv: 535 Authentication unsuccessful
13:55:32 e-mail,debug send RSET
13:55:32 e-mail,debug recv: 250 Resetting
13:55:32 e-mail,debug send QUIT
13:55:32 e-mail,debug recv: 221 COL0-MC1-F4.Col0.hotmail.com Service closing transmis
sion channel
13:55:32 system,e-mail,error Error sending e-mail: AUTH failed
mrz
August 31, 2010, 10:00am
18
13:55:32 e-mail,debug recv: 535 Authentication unsuccessful
wrong password or username
Do you have your user and password blank in “/tool e-mail”? For this, they should be blank. And send to port 25, not port 587.
namo
August 31, 2010, 10:05am
20
you mean I should not use my email and its password?