Community discussions

MikroTik App
 
dormador
Member Candidate
Member Candidate
Topic Author
Posts: 107
Joined: Sat Mar 28, 2009 12:57 pm

v3.25 script backup not work !

Fri Jun 19, 2009 10:54 pm

Hi all

two days to make that script do the job. but but but


it not work !!!!!!!!!!
ok

am testing many e males in gmail & my won ISP mail..... not work !?
why

mikrotik cant have SMTP inside its own os !

its possible or what ?

am very angry i know that from two days a go .... but i need answer its work gentleman for any one !

we need any solution for that thing...

sorry

regards
dormador
6-19-2009 10-52-00 PM.jpg
You do not have the required permissions to view the files attached to this post.
 
fosben
Frequent Visitor
Frequent Visitor
Posts: 81
Joined: Thu Dec 14, 2006 4:50 pm

Re: v3.25 script backup not work !

Sat Jun 20, 2009 4:26 am

your post make no sense at all....

post your script..
Last edited by fosben on Thu Jul 02, 2009 10:43 am, edited 1 time in total.
 
dormador
Member Candidate
Member Candidate
Topic Author
Posts: 107
Joined: Sat Mar 28, 2009 12:57 pm

Re: v3.25 script backup not work !

Sat Jun 20, 2009 6:22 pm

fosben
i have many script tested all

:log info "backup beginning now"
:global backupfile ([/system identity get name] . "-" . [/system clock get time])
/system backup save name=$backupfile
:log info "backup pausing for 10s"
:delay 10s
:log info "backup being emailed"
/tool e-mail send to="xxxxxxx@gmail.com" subject=([/system identity get name] . \
" Backup") from= mikrotikbackup@yourhost.com file=$backupfile server=mail.google.com
:log info "backup finished"
/ system script
add name="backup_mail" source="/system backup save name=email_backup \n/tool \
   e-mail send file=email_backup.backup to=\"xxxxxxx@gmail.com\" body=\"See \
   attached file for System Backup\" subject=\(\[/system identity get name\] \
   . \" \" .  \[/system clock get time\] . \" \" . \[/system clock get date\] \
   . \"  Backup\"\)\n"

:log info "Starting Backup Script..."
:global backupfile ([/system identity get name] . ".umb")
/file rem $backupfile
:delay 2s
/system backup save name=$backupfile
:log info "Waiting 5s for backup to complete..."
:delay 5s
:log info "Backup being emailed..."
/tool e-mail send to="xxxxxx@gmail.com" subject=([/system identity get name] . " Backup") from=xxxxx@yourhost.com file=$backupfile server=mail.google.com
:log info "Finished Backup Script!"

and by the way, you try to hide the mac address of your card, but its very visible...
i am trying to hide the name not the mac....
 
fosben
Frequent Visitor
Frequent Visitor
Posts: 81
Joined: Thu Dec 14, 2006 4:50 pm

Re: v3.25 script backup not work !

Sat Jun 20, 2009 7:49 pm

just tested on a 3.25 board here with my msn account, and it works.


try to add this in your gateway nat:

add action=masquerade chain=srcnat comment="email test" disabled=no dst-port=25 protocol=tcp src-address="ip the routerboard that is sending mail"
 
dormador
Member Candidate
Member Candidate
Topic Author
Posts: 107
Joined: Sat Mar 28, 2009 12:57 pm

Re: v3.25 script backup not work !

Sun Jun 21, 2009 1:19 am

just tested on a 3.25 board here with my msn account, and it works.


try to add this in your gateway nat:

add action=masquerade chain=srcnat comment="email test" disabled=no dst-port=25 protocol=tcp src-address="ip the routerboard that is sending mail"
before any thing which script work with you ?
are you accommodate email setting ?
you write any thing in user or password column isn't you ?

some details to do effectually please..

thanks a lot for your comment ..

regards
 
fosben
Frequent Visitor
Frequent Visitor
Posts: 81
Joined: Thu Dec 14, 2006 4:50 pm

Re: v3.25 script backup not work !

Sun Jun 21, 2009 1:06 pm

I didnt use any of your scripts, I only used the email line since it is the one that fails.

I tested using this line:
/tool e-mail send to="myhotmail@hotmail.com" from="myhotmail@hotmail.com" user="myhotmail@hotmail.com" password="myhotmailpass" server=65.55.172.254 s
ubject="testing" body="testing testing" file=testfile
(the server ip there is resolved from smtp.live.com)

That worked, so then I filled out the smtp settings in /tools email menu, and only had to use
/tool e-mail send to="myhotmail@hotmail.com" subject="testing2" body="testing testing2" file=testfile
I dont know about gmail, but hotmail smtp requires smtp authentication, so user and password have to be sent, otherwise it will be ignored..
 
dormador
Member Candidate
Member Candidate
Topic Author
Posts: 107
Joined: Sat Mar 28, 2009 12:57 pm

Re: v3.25 script backup not work !

Sun Jun 21, 2009 6:32 pm

thanks alot Mr.Fosben

its work perfectly

i give this script to my frind but never work ! he use 3.13

that version not have user or password in email window.

is that the cause ?

any solution for old versions .

thanks very much once again.

regard
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: v3.25 script backup not work !

Mon Jun 22, 2009 1:06 am

What's new in 3.21:

*) added authorization and TLS support to email tool;
he should upgrade
 
User avatar
jordantrx
Long time Member
Long time Member
Posts: 505
Joined: Tue Oct 23, 2007 8:58 pm
Location: WAY upstate NY

Re: v3.25 script backup not work !

Wed Jul 08, 2009 4:42 pm

What's new in 3.21:

*) added authorization and TLS support to email tool;
he should upgrade
So now we have the availability to set username and password for an STMP server or to log into our Gmail account to send mail via our Routers? -Jordan B
 
User avatar
Campano
Frequent Visitor
Frequent Visitor
Posts: 63
Joined: Mon Apr 17, 2006 2:35 am
Location: Ñuñoa - Chile
Contact:

Re: v3.25 script backup not work !

Sun Aug 16, 2009 9:29 pm

hello im using 3.28

and not problem with gmail account

the correct configuration is:

smtp.gmail.com

port 25

from account@gmail.comm

user account

pass yourpass

and done...

y probe and all OK

and i can send to my own domain managed by google apps , only change the user, because required a complete email ex: carlos@campano.cl

sorry mi bad english
 
Twas
just joined
Posts: 21
Joined: Tue Dec 30, 2008 2:13 am

Re: v3.25 script backup not work !

Mon Dec 14, 2009 5:33 pm

I have been using backup scripts very successfully through Gmail Apps on my own domain for sometime. 3.22 worked perfect and I could almost do no wrong. Then I upgraded to 3.30. After spending a good 5 hours of time, I have come to the conclusion that 3.30 does not work for Gmail, period.

Image

Now, 3.22 still works perfectly. But, I don't want to switch back to because of licensing issues. That 7 digit / 8 digit license problem for downgrading is dangerous. And, all current versions from 4 up have more bugs than I can deal with at this time as well.
Any ideas
 
dormador
Member Candidate
Member Candidate
Topic Author
Posts: 107
Joined: Sat Mar 28, 2009 12:57 pm

Re: v3.25 script backup not work !

Fri Feb 05, 2010 1:33 pm

 
Ixti
just joined
Posts: 5
Joined: Wed Jun 18, 2008 2:23 am

Re: v3.25 script backup not work !

Thu Feb 25, 2010 9:46 pm

Port 587, for those who can't read the video.
 
Twas
just joined
Posts: 21
Joined: Tue Dec 30, 2008 2:13 am

System Backup using Gmail with 3.30

Fri Feb 26, 2010 4:01 am

Thanks a bunch for the help. My script works perfectly now. The problem I was having was two fold.
1. I was putting the user name, password, server ip, port, and from field in the script (don't do that on 3.30)
2. Tools > email > Don't put an email address in the From field. Just put a word with no spaces or "@" character.

Thanks to all of you for your help.
 
piotrjamroz
just joined
Posts: 17
Joined: Thu Jun 21, 2007 1:18 pm
Location: Poland

Re: v3.25 script backup not work !

Sat Feb 27, 2010 1:33 pm

@dormador I did try EXACTLY same config (ROS 3.28) using gmail and i get in log:

"Error sending email: AUTH fail"

any idea how to solve this?
 
Twas
just joined
Posts: 21
Joined: Tue Dec 30, 2008 2:13 am

Re: v3.25 script backup not work !

Sat Feb 27, 2010 4:18 pm

Ok, here is my full script for doing both binary (full backups) and exports. I like to do both. This also includes the scheduler. It works perfect and is plug in play less changing a few basic things.
/system script add name=ebackup source={/system backup save \
name=([/system identity get name] . "-" . \
[:pick [/system clock get date] 7 11] . [:pick [/system clock get date] 0 3] . \
[:pick [/system clock get date] 4 6]); :delay 10; \
/tool e-mail send to="youremail@gmail.com" \
subject=([/system identity get name] . " Backup " . \
[/system clock get date]) file=([/system identity get name] . "-" . \
[:pick [/system clock get date] 7 11] . [:pick [/system clock get date] 0 3] . \
[:pick [/system clock get date] 4 6] . ".backup"); :delay 10; \
/file rem [/file find name=([/system identity get name] . "-" . \
[:pick [/system clock get date] 7 11] . [:pick [/system clock get date] 0 3] . \
[:pick [/system clock get date] 4 6] . ".backup")]; \
:log info ("System Binary Backup emailed at " . [/sys cl get time] . " " . [/sys cl get date])}


/system script add name=eexport source={/export file=([/system identity get name] . "--" . \
[:pick [/system clock get date] 7 11] . [:pick [/system clock get date] 0 3] . \
[:pick [/system clock get date] 4 6]); :delay 10; \
/tool e-mail send to="youremail@gmail.com" \
subject=([/system identity get name] . " Export " . \
[/system clock get date]) file=([/system identity get name] . "--" . \
[:pick [/system clock get date] 7 11] . [:pick [/system clock get date] 0 3] . \
[:pick [/system clock get date] 4 6] . ".rsc"); :delay 10; \
/file rem [/file find name=([/system identity get name] . "--" . \
[:pick [/system clock get date] 7 11] . [:pick [/system clock get date] 0 3] . \
[:pick [/system clock get date] 4 6] . ".rsc")]; \
:log info ("System Export Backup emailed at " . [/sys cl get time] . " " . [/sys cl get date])}


/system scheduler
add name="email-backup" on-event=ebackup \
start-date=sep/12/2009 start-time=00:36:00 \
interval=1d comment="Daily Backups" disabled=no
add name="email-export" on-event=eexport \
start-date=sep/12/2009 start-time=00:38:00 \
interval=1d comment="Daily Export" disabled=no
Now, I use the free Google Apps that allows backups to our own domain email addresses, but it makes no difference.

Mods you must make:
1. Change the email address

2. Configure in Winbox Tools>email
Server: 74.125.45.109
Port: 587
From: just a single word, not email address. This is really important otherwise Auth problems.
User: youremail@gmail.com
Pass: I think you got that one.

3. Adjust the time start time on the scheduler. Don't run them at exactly the same time. Put a few minutes in between.

This backup script and scheduler works perfect on 9 AP's on three different subnets.

Hope that helps

Note: Copy the code, make the changes mentioned, and paste it into a terminal window, that's it.
 
piotrjamroz
just joined
Posts: 17
Joined: Thu Jun 21, 2007 1:18 pm
Location: Poland

Re: v3.25 script backup not work !

Sun Feb 28, 2010 9:28 pm

check my log:

echo: e-mail,debug recv: 220 mx.google.com ESMTP 34sm816898yxf.65
echo: e-mail,debug send EHLO [172.30.0.2]
echo: e-mail,debug recv: 250-mx.google.com at your service, [83.3.251.75]
echo: e-mail,debug recv: 250-SIZE 35651584
echo: e-mail,debug recv: 250-8BITMIME
echo: e-mail,debug recv: 250-STARTTLS
echo: e-mail,debug recv: 250-ENHANCEDSTATUSCODES
echo: e-mail,debug recv: 250 PIPELINING
echo: e-mail,debug send STARTTLS
echo: e-mail,debug recv: 220 2.0.0 Ready to start TLS
echo: e-mail,debug send EHLO [172.30.0.2]
echo: e-mail,debug recv: 250-mx.google.com at your service, [83.3.251.75]
echo: e-mail,debug recv: 250-SIZE 35651584
echo: e-mail,debug recv: 250-8BITMIME
echo: e-mail,debug recv: 250-AUTH LOGIN PLAIN
echo: e-mail,debug recv: 250-ENHANCEDSTATUSCODES
echo: e-mail,debug recv: 250 PIPELINING
echo: e-mail,debug send AUTH PLAIN AHBpb3RyamFtcm96QGdtYWlsLmNvbQBhZHJpYW5uYQ==\
B0
echo: e-mail,debug recv: 501 5.5.2 Cannot Decode response 34sm816898yxf.65
echo: e-mail,debug send RSET
echo: e-mail,debug recv: 250 2.1.5 Flushed 34sm816898yxf.65
echo: e-mail,debug send QUIT
echo: system,e-mail,error Error sending e-mail: AUTH failed


I'm sure everything is set OK - but I still get AUTH failed - anyone can help me with this?

UPDATE:
it's difficult for me to believe it, but I checked and found out that, on mipsbe architecture (ROS 3.30) sending emails to gmail DOESNT work - u get AUTH failed ERROR. However on x86 architecture ROS 3.30 device - everything works fine!!!!
Anyone can verify that????

UPDATE 2:
the above problem seems to be limited to RB411A and RB433AH (both running ROS 3.30)
 
Twas
just joined
Posts: 21
Joined: Tue Dec 30, 2008 2:13 am

4.6 e-mail issues with tls resolved. Gmail works

Sat Mar 20, 2010 9:48 pm

I can't say thanks enough MT other than I wish the changes made were better documented pertaining to the usage of the e-mail tool.
For those of you that have taken the chance to move on to 4.6 (We have on 4% of our network) you might run across more issues trying to use scripts that include the use of the e-mail tool. I have got probably 20 combined hours over the last two years trying to make these scripts work when OS versions change. Since 3.22, I have ran into multiple problems.

One key problem was to use Winbox > Tools> e-mail. Why? Because I found in some versions you have to put info in there and others you don't. Plus, there were bugs in the field entries that made it almost impossible to use. Space, no space, @ no @, etc. I could be wrong on all of this but some of you have probably had the same problems.

Guess what, Gmail, and MT 4.6 get along once again like they did with 3.22. Here is what I just found a few minutes ago.

First set the Winbox > Tools> e-mail properties to default.
Server 0.0.0.0
All other fields blank. Yes blank.
Here is the code if you want to do it from a terminal:
/tool e-mail 
set from="" password="" server="0.0.0.0:0" username=""
Now open a terminal window wide enough to paste in this code/script. (you might have it open already)
Make sure you put your password, send to email address, from address is not important, your password, and user.
/tool e-mail 
send body="testing" from="test@testme2.com" password="yourpass" server="74.125.45.109:587" \
subject="this is it" tls="yes" to="youraccount@gmail.com" user="youraccount@gmail.com"
In my case this works perfect for my backup script. I have my own domain with the free Google Apps, and it works with that as well.

The ability to turn on or off TLS with Gmail fixed everything. Finally!!!

Who is online

Users browsing this forum: No registered users and 10 guests