Giter Club home page Giter Club logo

Comments (14)

eworm-de avatar eworm-de commented on May 18, 2024

I have never seen this myself. This must be device or configuration specific. Is there anything bogus with identity name, board and model name or serial number?

You could try to edit the script and comment the lines with extra information to find the causing value.

from routeros-scripts.

Kampfwurst avatar Kampfwurst commented on May 18, 2024

Hi, The causing value is the file backup file.
If i remove the line " file=$Attach;" in tool e-mail then the script runs fine without backup file ;-(
The name config file name is "MikroTik.example.com.rsc" so this should be fine.

The board is a RB433.
Hostname: MikroTik
Channel: long-term
RouterOS: 6.44.5

from routeros-scripts.

eworm-de avatar eworm-de commented on May 18, 2024

You have the default configuration for backup?

:global BackupSendBinary false;
:global BackupSendExport true;

Does it help if you replace file=$Attach with file=[ :tostr $Attach ]?

from routeros-scripts.

Kampfwurst avatar Kampfwurst commented on May 18, 2024

Yes I use the default configuration.

:global BackupSendBinary false;
:global BackupSendExport true;

# send email with status and files / tool e-mail send to=$EmailBackupTo cc=$EmailBackupCc \ subject=("[" . $Identity . "] Backup & Config") \ body=("Backup and config export for " . $Identity . ".\n\n" . \ "Board name: " . $BoardName . "\n" . \ "Model: " . $Model . "\n" . \ "Serial number: " . $SerialNumber . "\n" . \ "Hostname: " . $Identity . "\n" . \ "Channel: " . $Channel . "\n" . \ "RouterOS: " . $InstalledVersion . "\n\n" . \ "Backup file: " . $BackupFile . "\n" . \ "Config file: " . $ConfigFile) \ file=[ :tostr $Attach ]; }

still the same error.

from routeros-scripts.

eworm-de avatar eworm-de commented on May 18, 2024

Does your device's identity contain bogus (possibly invisible) characters? Run...

:global Identity "test";

... then try again.

from routeros-scripts.

Kampfwurst avatar Kampfwurst commented on May 18, 2024

still the same.

I testet it also on a rb1100ahx2. also the same problem. I thought that the backup is taking to long. So I tried it on the rb1100 ,-)

from routeros-scripts.

eworm-de avatar eworm-de commented on May 18, 2024

The device performance is not relevant, I am using this on RB751 with 400 MHz CPU...

Would you mind sending me a mail without backup and copy? Edit the script, remove the line with file=, then run...

:global EmailBackupCc  "[email protected]";

... and run the script. Do not forget to revert the change for EmailBackupCc.

from routeros-scripts.

eworm-de avatar eworm-de commented on May 18, 2024

Well, wondering if your SMTP server is the problem... Can you configure an account from a different SMTP server?

from routeros-scripts.

Kampfwurst avatar Kampfwurst commented on May 18, 2024

If i use my server i get the ":invalid BODY" error.

I try the google server also. I can send over the google server a testmail from Tools/Email
If i try to execute the script i get the error "error talking to server"

from routeros-scripts.

eworm-de avatar eworm-de commented on May 18, 2024

I received two mails from two different addresses.

I guess both servers do not like mails from RouterOS devices when attachments are included... You could enable logging and see if anything useful pops up there:

/system logging add topics=e-mail;

Also if one of the servers is yours... Have a look at the MTA's logs.

Anyway... I think this is out of scope for my scripts. Looks like the issue is how RouterOS assebles the attachment into the mail.

from routeros-scripts.

Kampfwurst avatar Kampfwurst commented on May 18, 2024

very strange. This script is working from the same RB with the server. Also with the attachment

:log info "Starting Backup Script..." :global backupfile ([/system identity get name] . ".rsc") :if ([/file find name=$backupfile] != "") do={/file rem $backupfile} :delay 2s /export file=$backupfile :log info "Waiting 5s for backup to complete..." :delay 5s :log info "Backup being emailed..." /tool e-mail send to="[email protected]" subject=([/system identity get name] . " Backup") [email protected] file=$backupfile server=testsmtp.de :log info "Finished Backup Script!"

from routeros-scripts.

eworm-de avatar eworm-de commented on May 18, 2024

Really strange... Is it possible that the file name confuses the servers? Possibly too many dots? Replace the line for file name with just:

:local FileName $Identity;

... and try again.

from routeros-scripts.

Kampfwurst avatar Kampfwurst commented on May 18, 2024

Ok now its working fine. It seems that "mikrotik" has a problem with the dots

from routeros-scripts.

eworm-de avatar eworm-de commented on May 18, 2024

No, it's you provider that has problems with dots. ;)
Imaging someone sends emails with a file with name holiday.png.exe, stupid mail clients strip the file extension. How many people will click it? Looks like providers try to mitigate by denying attachments with more than one dot in file name.

from routeros-scripts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.