This guide will illustrate on how you can setup Script in Mikrotik RouterOS , which can send Mikrotik Backup & Export (or user manager database = optional) file via GMAIL on daily basis. This way you can have offline backup set for DR purposes in case of any disaster recovery
Important Note: Please make sure to Enable the ‘access to the less secure applications’ in your gmail account settings otherwise sending will not be allowed by Gmail.
1) Adding the Script
The below script perform following functions …
- Backup Complete Mikrotik Configuration in a file
- Export Complete Mikrotik Configuration in a file
- UPload to FTP
- Send files via Email (using Gmail SMTP)
Let’s Start …
Goto System > Scripts
Click on + icon to add script.
Name it backup
In the Source box, paste the below script.
# Mikrotik Backup Script for Mikrotik 6.x Series, well tested with 6.4x # with Email & FTP Feature (FTP feature added at 20-JUL-2019] # Syed Jahanzaib / aacable AT hotmail DOT com / https://aacable.wordpress.com # Configure following options :local SLEEP "30s"; :log warning "Mikrotik Router Backup JOB Script Started . . . Powered by Syed Jahanzaib" # Set FTPUPLOAD to FALSE if you dont want the FTP feature :local FTPUPLOAD true; # Set EMAILUPLOAD to FALSE if you dont want the EMAIL feature :local EMAILUPLOAD true; :local company "ZAIB Ltd" # Set Adminmails to email addressess on whcih you want to receive Backup emails, I am using 2 email accounts for primary/secondary backup purposes :local adminmail1 zaib1@gmail.com :local adminmail2 zaib2@hotmail.com # GMAIL SMTP DYNAMIC Config Section, Make sure to change these values to match your's / Jz # GMAIL SMTP will be set dynamically later, each time the script runs :local gmailid zaib1@gmail.com :local gmailuser zaib1 :local gmailpwd zaib1Password :local gmailport 587 # Set FTP Server, or set FTPUPLOAD to flase in top config section :local FTPSRV "10.0.0.1" :local FTPUSER "ftpid" :local FTPPASS "ftppass" ###################################### ###### Configurable options ends here ###### Donot EDIT below ###################################### :local ID ([/system identity get name]) :local DATE ([/system clock get date]) :local TIME [/system clock get time]; :local name [/system identity get name]; :local DAYIN3DIGIT "" :local months ("jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"); :local daytbl [:toarray "sun,mon,tue,wed,thu,fri,sat"] :local month [:pick $DATE 0 3] :local day [:pick $DATE 4 6] :local dayc [:pick $DATE 5 6] :local year [:pick $DATE 7 11] # if the first char is a 0 (zero) only read last char, else script fails :if ([:pick $DATE 4 5] = 0) do={ :set day ($dayc)} :local sum 0 :local aaa 0 :local yyy 0 :local mmm 0 :local nmonth 1 :for mindex from=0 to=[:len $months] do={ :if ([:pick $months $mindex] = $month) do={:set nmonth ($mindex + 1) } } :set aaa ((14 - $nmonth) / 12) :set yyy ($year - $aaa) :set mmm ($nmonth + 12 * $aaa - 2) :set sum (7000 + $day + $yyy + ($yyy / 4) - ($yyy / 100) + ($yyy / 400) + ((31 * $mmm) / 12)) :set sum ($sum - (($sum / 7) * 7)) :set DAYIN3DIGIT [:pick $daytbl $sum] :local hour [:pick $TIME 0 2]; :local min [:pick $TIME 3 5]; :local sec [:pick $TIME 6 8]; :local month [:pick $DATE 0 3]; :local monthname [ :pick $DATE 0 3 ] :set month ([ :find $months $month -1 ] + 1); :if ($month < 10) do={ :set month ("0" . $month); } :local day [:pick $DATE 4 6]; :local year [:pick $DATE 7 11]; :local backupconfig; :local backupexport; #:set backupconfig ($name. "-" .$year."-".$month."-".$day."-".$hour.$min."."."backup"); #:set backupexport ($name. "-" .$year."-".$month."-".$day."-".$hour.$min."."."rsc"); :set backupconfig ($name. "-" .$DAYIN3DIGIT."-".$day."-".$monthname."-".$year."-"."hhmm".$hour.$min."."."backup"); :set backupexport ($name. "-" .$DAYIN3DIGIT."-".$day."-".$monthname."-".$year."-"."hhmm".$hour.$min."."."rsc"); :log error "$backupconfig"; :log error "$backupexport"; # Additional Check for GMAIL SMTP Resolving. # If gmail SMTP failed to resolve, then it should set manual IP for gmail smtp # So that email should go even if there is a dns failure. # By ZAIB - 18-Aug-2017 :local GMAILSMTPDNSNAME "smtp.gmail.com" :global GMAILSMTP "" :local RESOLVELIST {"$GMAILSMTPDNSNAME"} :foreach addr in $RESOLVELIST do={ :do {:resolve server=8.8.8.8 $addr} on-error={:set GMAILSMTP "0";}} :if ($GMAILSMTP = 0) do={ :set GMAILSMTP "64.233.167.108"; } else={ :set GMAILSMTP [:resolve "$GMAILSMTPDNSNAME"]; } # Setting gmail options in tool email as well, useful when u dont have configured toosl email option /tool e-mail set address=$GMAILSMTP port=$gmailport start-tls=yes from=$gmailid user=$gmailuser password=$gmailpwd :if ($EMAILUPLOAD) do={ :log warning "Email Upload is Enabled."; :put "Email Upload is Enabled."; } else={ :log warning "Email Upload is Disabled."; :put "Email Upload is Disabled."; } :if ($FTPUPLOAD) do={ :log warning "FTP Upload is Enabled."; :put "FTP Upload is Enabled."; } else={ :log warning "FTP Upload is Disbled."; :put "FTP Upload is Disbled."; } ####################################################### # Start creating Backup files backup and export both :log warning "$company : Creating new up to date backup files . . . " /system backup save name=$backupconfig dont-encrypt=yes /export file=$backupexport ####################################################### :log warning "$company : Backup JOB process pausing for $SLEEP so that it can complete creating backup. Usually it is required for Slow systems ..." :delay $SLEEP :if ($EMAILUPLOAD) do={ :log warning "Backup JOB is now sending Backup File via Email using GMAIL SMTP . . ." # Start Sending email files, make sure you ahve configured tools email section before this. or else it will fail /tool e-mail send to=$adminmail1 subject="$ID - $DATE $TIME - Configuration BACKUP File" file=$backupconfig start-tls=yes /tool e-mail send to=$adminmail1 subject="$ID - $DATE $TIME - Configuration EXPORT File" file=$backupexport start-tls=yes # Send same backup files to second email account , just for duplication and backup /tool e-mail send to=$adminmail2 subject="$ID - $DATE $TIME - Configuration BACKUP File" file=$backupconfig start-tls=yes /tool e-mail send to=$adminmail2 subject="$ID - $DATE $TIME - Configuration EXPORT File" file=$backupexport start-tls=yes } #Upload to FTP if its set to TRUE :if ($FTPUPLOAD) do={ :log warning "Backup JOB is now sending Backup to FTP Server $FTPSRV File . . ." /tool fetch address=$FTPSRV src-path="$backupconfig" user=$FTPUSER mode=ftp password=$FTPPASS dst-path="/$backupconfig" upload=yes /tool fetch address=$FTPSRV src-path="$backupexport" user=$FTPUSER mode=ftp password=$FTPPASS dst-path="/$backupexport" upload=yes } :log warning "$company : BACKUP JOB: Sleeping for $SLEEP so email can be delivered & FTP can be uploaded, " :delay $SLEEP # REMOVE Old backup files to save MIKROTIK ROS DISK space. /file remove $backupconfig /file remove $backupexport # Print Log for done :log warning "$company : Backup JOB: Process Finished & Backup File Removed. All Done. You should verify your inbox for confirmation, Regard's Syed Jahanzaib" :put "$company : Backup JOB: Process Finished & Backup File Removed. All Done. You should verify your inbox for confirmation, Regard's Syed Jahanzaib" # Script ENDs here
Click on OK to save the script.
Schedule to run it daily & you are good to go. !
Adding (GMAIL) Email Server in tools/e-mail for mikrotik 6.x (not required with above script, but still as a reference you can use it)
Open Terminal & paste the following config
(first resolve the gmail smtp by using command ‘ping smtp.gmail.com and note down the IP address and use it in below section)
/tool e-mail set address=64.233.167.108 from=YOURGMAILID@gmail.com password=GMAILPASSWORD port=587 start-tls=yes user=YOURGMAILID
ENABLE EMAIL LOGGING FOR DEBUG !!
First we will enable script logging, so we can see its result / errors etc.
/system logging add action=echo disabled=no prefix="" topics=scrip
Now Test the script by using following command at terminal. (Also open the log window so you can see the script results or any error)
/tool e-mail send to=aacable@hotmail.com subject="test from gmail" start-tls=yes from=YOURGMAILID@gmail.com password=GMAILPASS agp port=587 user=YOURGMAILID
Now execute the script.
/sys script run backup
Open the LOG window. You may see the following screens if every thing is setup correctly.
Adding Scheduler to run the script on daily basis
Open Terminal & paste the following command
/system scheduler add comment="Scheduler for daily backup of MT" interval=1d name=daily-backup on-event=backup policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive start-date=jan/01/1970 start-time=00:00:00
Finally RECEIVED!
[Short Reference]
To Send Email, use this command.
/tool e-mail send server=173.194.66.108 port=587 start-tls=yes user="mygmailid" passwo rd="gmailpassword" from="mygmailid@gmail.com" to="aacable@hotmail.com" subject="test" body="test"
DONE 😀
GMAIL Configuration on Mikrotik 5.2x [Short Reference]
[admin@MikroTik] > /tool e-mail pr address: 74.125.45.108 port: 587 starttls: no from: gmailid@gmail.com user: gmailid password: mypassword [admin@MikroTik] > /tool e-mail ex # dec/12/2012 10:45:57 by RouterOS 5.20 # /tool e-mail set address=74.125.45.108 from=gmailid@gmail.com password=mypassword port=587 starttls=no user=gmailid [admin@MikroTik] > /tool e-mail> send server=74.125.45.108 port=587 tls=yes user=gmailid@gmail.com password=xxxxxx to=aacable@hotmail.com subject=test body=test
Regard’s
Syed Jahanzaib
One thing i found lately working with scrips. There is no ‘ftp’ policy checkbox in WebFig interface, so, i can’t add it. When i edit script in WebFig, ‘ftp’ policy will disappear and “/export” command will not work without it…
LikeLike
Comment by Raul Viikna — November 19, 2012 @ 2:53 PM
hmmm
LikeLike
Comment by Syed Jahanzaib / Pinochio~:) — November 20, 2012 @ 7:39 PM
WebFig 5.21, but i think that ftp policy checkbox is missing in earlier versions too…
LikeLike
Comment by Raul Viikna — November 20, 2012 @ 8:35 PM
Does not work automatically.
Only when I manually paste the script in Terminal
Please help me
Mikrotik x86 5.21
LikeLike
Comment by basil — November 20, 2012 @ 6:30 AM
It can’t auto work, until you schedule it to run on specific timings.
LikeLike
Comment by Syed Jahanzaib / Pinochio~:) — November 20, 2012 @ 11:26 AM
nt done
LikeLike
Comment by Malik mussawar — November 25, 2012 @ 2:21 PM
[…] Mikrotik Auto Backup & Email using PTCL SMTP […]
LikeLike
Pingback by Mikrotik Auto Backup & Email using PTCL SMTP « TechFresh — November 30, 2012 @ 1:01 PM
Hi Sir
I finally succeed to set a new pppoe server using ospf to allow public ip on lan side
WAN:100.135.xxx.4/28
LAN:100.135.220.1/24
now I have only one pool
/ip pool add name=public_220 ranges=100.235.220.2-100.235.220.254
but I would like to follow configuration with the non payment reminder
and your tuto says:
Adding IP pool for Expired / Non Payment Users
/ip pool add name=Expired-Pool ranges=172.16.1.1-172.16.1.255
Adding Profile for Expired / Non Payment Users
/ppp profile add change-tcp-mss=default dns-server=10.0.0.1 local-address=10.0.0.1 name=pppoe-expired only-one=default rate-limit=128k/128k remote-address=\ Expired-Pool use-compression=default use-encryption=default use-ipv6=yes use-mpls=default use-vj-compression=default
Can you please point me how I can adapt this reminder since my config is very different to the main tutorial
and if possible maybe using private ip and how can I set Rule to redirect Expired since I´m not using NAT ?
thanks a lot
LikeLike
Comment by Marcel Fossua — December 3, 2012 @ 3:47 AM
You can create a NAT rule that will redirect Only specific IP (or address list with desired ips) to local web proxy.
then on proxy, create an access rule that will deny request from specific IP’s and redirect it to your ad page.
LikeLike
Comment by Syed Jahanzaib / Pinochio~:) — December 3, 2012 @ 8:38 AM
how to restore all these backup file ? i have make the email back worked fine but in the process corrupted the userman database, now i want to restore it from these.
plz help
LikeLike
Comment by Abdur Rehman — December 3, 2012 @ 4:41 PM
Respected Sir,
Alla Hafiz, and You are made for The Network Genius in the world Your Script is Superb to backup all things in mikrotik and your service is awesome to help others.i follow your messages past one year.
sir one small doupt in this script. As some one said in this script only succed when we past your script on new terminal.if we paste in system script it is not working. after that i made some changes in this script its working.please tell me what is the difference.the script is here:
/system backup save name=wifiworld_backupfile.backup
/tool user-manager database save name=wifiworld_umbackup.umb
/export file=wifiworld_mikrotikexport.rsc
:log info “Backup process pausing for 10s so it complete creating backup file”
:delay 20s
:log info “Start Sending Backup File via Email using GMAIL SMTP . . .”
/tool e-mail send to=”wifiworlddatabase@gmail.com” subject=([/system clock get date] . \
” Mikrotik Config Backup “) tls=yes from=wifiworldcommunications@gmail.com file=wifiworld_backupfile.backup server=173.194.79.108
/tool e-mail send to=”wifiworlddatabase@gmail.com” subject=([/system clock get date] . \
” Mikrotik UM Backup “) tls=yes from=wifiworldcommunications@gmail.com file=wifiworld_umbackup.umb server=173.194.79.108
:delay 50s
/tool e-mail send to=”wifiworlddatabase@gmail.com” subject=([/system clock get date] . \
” Mikrotik Export Backup “) tls=yes from=wifiworldcommunications@gmail.com file=wifiworld_mikrotikexport.rsc server=173.194.79.108
:delay 40s
:log info “Backup Finished”
:log info “Deleting Backup File. All Done. Allah Hafiz”
/file remove wifiworld_backupfile.backup
/file remove wifiworld_umbackup.umb
/file remove wifiworld_mikrotikexport.rsc
LikeLike
Comment by saravanan siva — December 19, 2012 @ 9:36 AM
You have to paste the script by going to system/script and create new script. then paste this script in the body section.
LikeLike
Comment by Syed Jahanzaib / Pinochio~:) — December 19, 2012 @ 10:10 AM
Syed Jahanzaib AOA
Sir very use full thanks for share but i not sucesfull after apply this rule
we face “auth fail” plz mail me this script
ghouri67@gmail.com
i confuse with gmail_ID, password=GMAILPASSWD, password=mypassword & to=”YourGMAIL-ID@gmail.com”, from=YourGMAIL-ID@gmail.com
LikeLike
Comment by M Azam Ghouri — January 21, 2013 @ 10:04 AM
See the Example below.
/tool e-mail send to="ghouri67@gmail.com" subject=([/system clock get date] . \
" Mikrotik Config Backup by zaib") from=ghouri67@gmail.com@gmail.com password=pakistan123 file=$backupfile server=173.194.69.109 tls=yes
(Change the pakistan123 to match your Gmail account password)
LikeLike
Comment by Syed Jahanzaib / Pinochio~:) — January 21, 2013 @ 10:31 AM
I’m confused. Should i copy past the entire part given below int system script body?
/system backup save name=wifiworld_backupfile.backup
/tool user-manager database save name=wifiworld_umbackup.umb
/export file=wifiworld_mikrotikexport.rsc
:log info “Backup process pausing for 10s so it complete creating backup file”
:delay 20s
:log info “Start Sending Backup File via Email using GMAIL SMTP . . .”
/tool e-mail send to=”wifiworlddatabase@gmail.com” subject=([/system clock get date] . \
” Mikrotik Config Backup “) tls=yes from=wifiworldcommunications@gmail.com file=wifiworld_backupfile.backup server=173.194.79.108
/tool e-mail send to=”wifiworlddatabase@gmail.com” subject=([/system clock get date] . \
” Mikrotik UM Backup “) tls=yes from=wifiworldcommunications@gmail.com file=wifiworld_umbackup.umb server=173.194.79.108
:delay 50s
/tool e-mail send to=”wifiworlddatabase@gmail.com” subject=([/system clock get date] . \
” Mikrotik Export Backup “) tls=yes from=wifiworldcommunications@gmail.com file=wifiworld_mikrotikexport.rsc server=173.194.79.108
:delay 40s
:log info “Backup Finished”
:log info “Deleting Backup File. All Done. Allah Hafiz”
/file remove wifiworld_backupfile.backup
/file remove wifiworld_umbackup.umb
/file remove wifiworld_mikrotikexport.rsc
LikeLike
Comment by anas — February 3, 2013 @ 9:42 PM
yes with proper instructions as Syed Jahanzaib told and you must change your email id ,create two email id one forsend another for recieve and change the backup name wise versa
LikeLike
Comment by saravanan siva — February 9, 2013 @ 7:14 PM
AOA
When sending this command
/tool e-mail send to=”magbackup@gmail.com” subject=([/system clock get date] .” Mikrotik Config Backup by zaib”) from=ghouri67@gmail.com password=Pakistan123 file=PPPOE-22012013-0936.backup server=173.194.69.109 tls=yes
get this error ” Error sending e-mail : AUTH failed”
LikeLike
Comment by M Azam Ghouri — February 17, 2013 @ 10:01 AM
What version u using
LikeLike
Comment by siva — February 17, 2013 @ 8:44 PM
5.20
LikeLike
Comment by Syed Jahanzaib / Pinochio~:) — February 18, 2013 @ 12:41 PM
First configure SMTP server in mikrotik.
look at Adding (GMAIL) Email Server in tools/e-mail subject in this guide.
LikeLike
Comment by Syed Jahanzaib / Pinochio~:) — February 18, 2013 @ 12:50 PM
G Bhai i m using ver 5.20
LikeLike
Comment by M Azam Ghouri — February 18, 2013 @ 3:02 PM
Thanks Bhai Now We Success full
Thankx Again
LikeLike
Comment by M Azam Ghouri — February 18, 2013 @ 4:35 PM
Glad to hear that finally you made it 🙂
LikeLike
Comment by Syed Jahanzaib / Pinochio~:) — February 19, 2013 @ 8:29 AM
Small update in the Backup script for CCR1036 Cloud Router.
:log info “Router Backup JOB Started . . . !!”
:global backupfile configbackup
:global mikrotikexport mtexport_backup
:log info “Deleting old Backup File If available otherwise ignore & process further . . . ”
/system backup save name=$backupfile
/export file=$mikrotikexport
:log info “Backup process pausing for 10s so it complete creating backup file”
:delay 10s
:log info “Start Sending Backup File via Email using SMTP . . .”
/tool e-mail send to=”xxxx@xxxxxxxx.com” password=xxxxxxxx subject=([/system clock get date] . \
” Router Config Backup!!”) from=xxxx@xxxxxxxx.com file=$backupfile server=173.194.69.109 start-tls=yes
/tool e-mail send to=”xxxx@xxxxxxxx.com” password=xxxxxx subject=([/system clock get date] . \
” Router Export Backup!!”) from=xxxx@xxxxxxxx.com file=$mikrotikexport server=173.194.69.109 start-tls=yes
:delay 40s
:log info “Backup Finished”
:log info “Deleting Backup File. All Done.”
/file remove $backupfile
/file remove $mikrotikexport
LikeLike
Comment by Vijay — March 15, 2013 @ 11:24 AM
Thanks for the contribution!
LikeLike
Comment by Syed Jahanzaib / Pinochio~:) — March 18, 2013 @ 9:28 AM
i want to know how to two vpn client network combine in one network using mikrotik 2.9
LikeLike
Comment by Ghufran Khizar — May 1, 2013 @ 4:38 AM
Sir user-manager kay backup ki email recieve nahi ho rahi jab kay mikrotik ki settings ki email recive ho rahi hay. script bi doobara laga kay dekh liya hay same problem aa rahi hay. user-manager kay backup ka size 3.2 mb ban raha hay … please guide me how to resolve this problem.
LikeLike
Comment by Jasim — May 27, 2013 @ 11:48 PM
pahlay same settings pr ye problem nahi aa rahi thi ab aisa kiun ho raha hay..sending jb ho rahi hotie hay email to log mai achanak email sending failed ka log creat ho jaata hay or ye msg aata hay. ” Error sending email :abnormail termination [timeout]
LikeLike
Comment by Jasim — May 27, 2013 @ 11:53 PM
Thanks Vijay for the update on the ‘start-tls=yes’
Thanks & Regards,
Don
LikeLike
Comment by Don — June 11, 2013 @ 1:44 PM
I too seem to be having a tough time getting this to work. I’m running ROS 6.3. my email conifg is:
address: 74.125.45.108
port: 587
start-tls: no
from: steveb@gmail.com
user: steveb
password: xxxxxxxxxxxx
last-status: failed
For my most recent test I got the error:
13:35:18 system,e-mail,error Error sending e-mail : abnormal termination (timeout)
13:35:18 system,e-mail,error Error sending e-mail : abnormal termination (timeout)
The exact syntax of what i sent from the CLI was:
/tool email send server=74.125.45.108 port=587 start-tls=yes user=steveb@gmail.com password=xxxxxxxxxxxx \
to=aacable@hotmail.com subject=test body=test
LikeLike
Comment by steve — September 15, 2013 @ 1:47 AM
Possibly ver 6.x syntax issue. I have not tested v6.x yet, Its sunday today, I will give it a try tomorrow, and will let you know.
LikeLike
Comment by Syed Jahanzaib / Pinochio~:) — September 15, 2013 @ 10:14 AM
Got it working now. It was a two part problem – 1) since I use two-factor authentication I needed an application specific password; 2) I had added some additional code to resolve the SMTP server address before running the script that needed to be fine-tuned.
#Resolve Gmail DNS to IP
:log info “Resolving smtp.gmail.com to IP”
:global gmailIP
:set gmailIP [:resolve “smtp.gmail.com”];
/tool e-mail set address $gmailIP
The latter allowed me to replace the server address with $gmailIP. Should be helpful should Google change the IP to the server.
LikeLike
Comment by Steve — September 18, 2013 @ 3:20 AM
[…] Source : https://aacable.wordpress.com/2012/11/19/mikrotik-auto-backup-email-using-gmail-smtp/ […]
LikeLike
Pingback by Mikrotik Auto Backup & Email using GMAIL SMTP | Mung Hasil Copy Paste — September 30, 2013 @ 8:48 AM
hi dear the backup is going good but when i want to restore user manager backup it doesnt show any main database or logs in that file, why is this so ?
LikeLike
Comment by Roger — January 7, 2014 @ 2:54 AM
Hi,
I agree This is a very helpful post for me. and this very information………
LikeLike
Comment by maya ace — February 4, 2014 @ 8:53 AM
The config file sends fine. But as the Usermanager backup does not send because of a timeout error. I think it is because the backup file is 1.6mb and the config file is only 50kb.
Using v6 mikrotik
LikeLike
Comment by Owais — February 10, 2014 @ 3:31 AM
hello
it is very good script i do that step by step
but after open my
I found this Message
Delivery to the following recipient failed permanently:
aacable@hotmail
Technical details of permanent failure:
DNS Error: Domain name not found
—– Original message —–
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=message-id:date:from:to;
bh=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=;
b=sj0A/0Nsx5SiPigfDUwYLKkg85I/L8cLn4RN9qEIwO+8J7gKd60pvq0kyMfJD/jEWR
i5KoGU2WGEsHU19fLvrBjMbf6M6wATNZq/3GGWFmgOi+sKuY9RG/KT3+YvyWJxG8KVQV
qCIiuFHt+8o4gB3H6mPl9GGhevLuWvQxZFS1Hf45buU0Io0CkSZ9QSq0/EbKAkmFRs8X
HqAo7reM45TPHtAL2WhjfNyzM2r3zSXAZUVO13CucbxidnDv5+2Ws8TXQPd64vKv9GNY
apJ/dw8Mxn9z9IFynbGP2i1GF7saQwaCCb0/XhUz8ECV3tEz1mcp36q48iCFDKgmqFt6
9RLw==
X-Received: by 10.204.197.203 with SMTP id el11mr10424403bkb.24.1392502046307;
Sat, 15 Feb 2014 14:07:26 -0800 (PST)
Return-Path:
Received: from [5.175.64.207] ([5.175.64.207])
by mx.google.com with ESMTPSA id i8sm8211354bko.10.2014.02.15.14.07.21
for
(version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
Sat, 15 Feb 2014 14:07:25 -0800 (PST)
Message-ID:
Date: Sun, 16 Feb 2014 00:07:24 +0200
From: alsanoce.saad@gmail.com
To: aacable@hotmail
plz u can help me for this problem
LikeLike
Comment by alsanoce — February 16, 2014 @ 3:34 AM
Syed, my system is backing up and pushing to my mail. I’m truly saying “Big Thanks”
LikeLike
Comment by Timi green — July 9, 2014 @ 12:27 AM
I am glad its working for you 🙂
LikeLike
Comment by Syed Jahanzaib / Pinochio~:) — July 9, 2014 @ 9:32 AM
HI , i had configured the scripts accordingly and getting mails too, but attachment were not into this mails .. what can be the issue
LikeLike
Comment by WinuxAdmin — September 1, 2014 @ 10:58 AM
hi.. i have to save a traffic logging for hotspot center but i don’t know how to create a backup file to send.
From the script above i have done that and it works well (thank you very much :)).
I can receive backup log files but they don’t have a traffic log with them …
Can you help me with these please, thank you..
LikeLike
Comment by chawalit — October 12, 2014 @ 8:02 AM
Good work Sayed Jazak Allah Khayra
LikeLike
Comment by Mohm — October 25, 2014 @ 2:13 AM
i get errors like this] > system script run backup-script
expected end of command (line 15 column 99)
[wireless@Router_Oprek_Hotspot_Wireless] >
LikeLike
Comment by waduk — January 7, 2015 @ 11:07 AM
what mikrotik version you have? it was tested with 5.x version.
for 6.x version, you may need to change tls=ye to start-tls=yes
LikeLike
Comment by Syed Jahanzaib / Pinochio~:) — January 10, 2015 @ 12:15 PM
Salam Alaycom
I have problems as below Error
Error sending e-mail : AUTH failed
Error sending e-mail : AUTH failed
I test this with Hotmail and Gmail
BR,
LikeLike
Comment by Mohammad — February 8, 2015 @ 5:30 PM
what version of mikroitk you are using?
LikeLike
Comment by Syed Jahanzaib / Pinochio~:) — February 9, 2015 @ 3:31 PM
6.25
I gess the problem from google mail securtiy
LikeLike
Comment by Mohammad — February 9, 2015 @ 10:13 PM
Updated Gmail SMTP Server Address
Address: 173.194.66.108
Port: 587
LikeLike
Comment by Mubashir Shahzad — March 11, 2015 @ 11:53 AM
want a velid email addres
LikeLike
Comment by syed ahmed — August 4, 2015 @ 11:48 PM
i always take “system,e-mail,error Error sending e-mail : AUTH failed”
i see that i have the same problem with my dvr (when i was setup it the first time it work correct)
LikeLike
Comment by afric — January 24, 2016 @ 7:25 PM
enable e-mail on syslog, and check google url from LOG.
You must to enable less secure applications from url that appear on mikrotik log.
LikeLike
Comment by Andres Gregori — July 21, 2016 @ 5:38 AM
i forget to say that gmail sent me a e-mail for Blocked connection attempt to both email i try… i enable “Less secure applications” in both accounts but nothing…..
LikeLike
Comment by afric — January 24, 2016 @ 7:31 PM
plz help me i have big strang problem usermanger remove account automatic and i have’t any script
when i past /tool usermanger history print in new terminal i watch my users was removed
and my users decreas daily my mikrotik x86 v5.20 and this problem happend 3 day ago any advice plz
LikeLike
Comment by Ahmed Motaher — April 1, 2016 @ 2:41 AM
Thank you very Much!!!
At start I get “AUTH FAIL” error, how ever e-mail mikrotik’s syslog print a URL from google in order to authorize script.
When you authorize external apps, it works like a charm!
Excelent BLOG !!
LikeLike
Comment by Andres Gregori — July 21, 2016 @ 5:37 AM
Morning Master, ..
Please help me… I cant setting mail server behind mikrotik. Configuration mikrotik is full new or fresh.
Topologi :
Internet —- Mikrotik —- LAN NETWORK
ip publik Mikrotik (Eth1) : 182.253.xxx.xx
ip local Mikrotik (Eth2 Master LAN – Bridge) : 192.168.69.1
ip mail server : 192.168.69.3
LAN Network can access internet with : Masquerade :
mail server have connect with dstnat port 25.
but i have error : gmail relay access denied.
dns static : have set too…
please help me master
Thank you very much
LikeLike
Comment by simanusiabodoh — August 25, 2016 @ 6:03 AM
Doesn’t work for me :(….
ROS v6.40.2 – RB850Gx2.
Always error sending email – error handling file.
But, i’m tested sending email manually (Winbox : Tools => Email => Send Email) for backup file and export file succesfully.
Please help me sir, i’m very confused.
Thanks for your help 🙂
LikeLike
Comment by qferiz — August 30, 2017 @ 2:50 PM
in file name, add extension. it will work fine.
LikeLike
Comment by Syed Jahanzaib / Pinochio~:) — September 5, 2017 @ 4:35 PM
Works like a charm! thank you
LikeLike
Comment by Valeri — September 5, 2017 @ 10:29 AM
gr8
LikeLike
Comment by Syed Jahanzaib / Pinochio~:) — September 5, 2017 @ 4:34 PM
i trid this script but somthing wrong
/ tool e-mail send to=/tool user-man database 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]); \
:log info (“System Backup emailed at ” . [/sys cl get time] . ” ” . [/sys cl get date]) subject=”name-backup” body=”name” start-tls=yes 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] . “.umb”); :log info (“System Backup emailed at ” . [/sys cl get time] . ” ” . [/sys cl get date])
LikeLike
Comment by mohammed hameed — January 21, 2018 @ 12:34 AM
For the AUTH failed(6) problem, just login your gmail account and go to account settings. From “Sign-in and Security Section” select “apps with account access” option.enable the “allow less secure apps” feature.
the only problem I am having is the autodelete of the backup and export file from the Files. All is working good though.
LikeLike
Comment by KenDC — September 12, 2019 @ 2:26 PM