Community discussions

MUM Europe 2020
 
thecoder
just joined
Topic Author
Posts: 7
Joined: Fri Feb 06, 2015 6:13 am

System Error sending email timeout occurred

Fri Feb 20, 2015 9:08 am

Hi,

I put this Script into Mikrotik :
:log info "backup beginning now"
:local backupfile ([/system identity get name] . "-" . [/system clock get time])
/tool user-manager database save name=$backupfile
:log info "backup pausing for 25s"
:delay 25s
:log info "backup being emailed"
/tool e-mail send to="moon002233@gmail.com" start=yes subject=([/system identity get name] . \
" User-Manager Backup") file=$backupfile
:log info "backup finished"
:delay 50s;
/file remove $backupfile;
:log info message=fileremoved
and I have messege error :
Error sending e-mail ... timeout occured

Can anyone explain what is the problem ?

thanx
 
Rudios
Forum Veteran
Forum Veteran
Posts: 966
Joined: Mon Mar 11, 2013 12:58 pm
Location: The Netherlands

Re: System Error sending email timeout occurred

Fri Feb 20, 2015 12:34 pm

How are your email settings?
Server, username etc.
Testing setup with: 2 x RB750UP | 2 x RB750GL | 1 x RB951G-2HnD | 1 x RB2011UiAS-IN
 
User avatar
satman1w
Member Candidate
Member Candidate
Posts: 111
Joined: Mon Oct 02, 2006 11:47 am
Location: Croatia

Re: System Error sending email timeout occurred

Fri Feb 20, 2015 3:28 pm

Hi,

I put this Script into Mikrotik :
:log info "backup beginning now"
:local backupfile ([/system identity get name] . "-" . [/system clock get time])
/tool user-manager database save name=$backupfile
:log info "backup pausing for 25s"
:delay 25s
:log info "backup being emailed"
/tool e-mail send to="moon002233@gmail.com" start=yes subject=([/system identity get name] . \
" User-Manager Backup") file=$backupfile
:log info "backup finished"
:delay 50s;
/file remove $backupfile;
:log info message=fileremoved
and I have messege error :
Error sending e-mail ... timeout occured

Can anyone explain what is the problem ?

thanx
#Backup_send-mail V.1.0 [20130330]

:local mailsender ([/system identity get name]."@domain.com");
:local mailrec *your.email@domain.com*;
:local mailpass *mailpassword*;
:local mailbody "B.A.C.K.U.P.";
:local mailserver [:resolve *your-mailserver.domain.com*];
:local mailuser *user@domain.com*;
:local mailsubject ("Backup from /".[/system identity get name]."/".[/system clock get date]."/".[/system clock get time]);

:local backupfile ([/system identity get name].".backup");


/system backup save name=[/system identity get name];
:log info "----- Backup Created";

:delay 1000ms;

/tool e-mail send from=$mailsender to=$mailrec subject=$mailsubject body=$mailbody server=$mailserver user=$mailuser password=$mailpass file=$backupfile;
:log info "----- Backup Sent to $mailrec";

*******************************************************************************************************************************

replace:

*your.email@domain.com..* - with receivers mail address (without "*")
*your-mailserver.domain.com* - with name of mailserver that will send the mail
*user@domain.com* - with username to log on to the mailserver
*mailpassword* - with password used to logon to the mailserver

that's it !
 
thecoder
just joined
Topic Author
Posts: 7
Joined: Fri Feb 06, 2015 6:13 am

Re: System Error sending email timeout occurred

Fri Feb 20, 2015 3:34 pm

My email settings is correct
becuase I sent an email form inside mikrotik and it is working


and I will try this new script

thanx
 
thecoder
just joined
Topic Author
Posts: 7
Joined: Fri Feb 06, 2015 6:13 am

Re: System Error sending email timeout occurred

Fri Feb 20, 2015 4:25 pm

Hi,

I put this Script into Mikrotik :
:log info "backup beginning now"
:local backupfile ([/system identity get name] . "-" . [/system clock get time])
/tool user-manager database save name=$backupfile
:log info "backup pausing for 25s"
:delay 25s
:log info "backup being emailed"
/tool e-mail send to="moon002233@gmail.com" start=yes subject=([/system identity get name] . \
" User-Manager Backup") file=$backupfile
:log info "backup finished"
:delay 50s;
/file remove $backupfile;
:log info message=fileremoved
and I have messege error :
Error sending e-mail ... timeout occured

Can anyone explain what is the problem ?

thanx
#Backup_send-mail V.1.0 [20130330]

:local mailsender ([/system identity get name]."@domain.com");
:local mailrec *your.email@domain.com*;
:local mailpass *mailpassword*;
:local mailbody "B.A.C.K.U.P.";
:local mailserver [:resolve *your-mailserver.domain.com*];
:local mailuser *user@domain.com*;
:local mailsubject ("Backup from /".[/system identity get name]."/".[/system clock get date]."/".[/system clock get time]);

:local backupfile ([/system identity get name].".backup");


/system backup save name=[/system identity get name];
:log info "----- Backup Created";

:delay 1000ms;

/tool e-mail send from=$mailsender to=$mailrec subject=$mailsubject body=$mailbody server=$mailserver user=$mailuser password=$mailpass file=$backupfile;
:log info "----- Backup Sent to $mailrec";

*******************************************************************************************************************************

replace:

*your.email@domain.com....* - with receivers mail address (without "*")
*your-mailserver.domain.com* - with name of mailserver that will send the mail
*user@domain.com* - with username to log on to the mailserver
*mailpassword* - with password used to logon to the mailserver

that's it !

I put this script , and it show me this message :
Image

like message with past script

I tried to send backup file manual, and I went to System > Email
and I make attach for file backup

and it give me same message

I notice all the script work good , but when it arrived to load backup file to attached , it show the message
I thought because size of backup file, but the size is 800kb
 
User avatar
karincanet
just joined
Posts: 17
Joined: Thu Feb 19, 2015 3:38 pm
Location: EU
Contact:

Re: System Error sending email timeout occurred

Fri Feb 20, 2015 4:35 pm

I use this backup script and works fine. Also .rsc file compatible for all mikrotik devices.
/export file=("backup-" . \
[:pick [/system clock get date] 7 11] . [:pick [/system clock get date] 0 3] . [:pick [/system clock get date] 4 6])

/tool e-mail send to="TO MAIL ADRESS" subject=("System Backup " . \
[/system clock get date]) file=("backup-" . [: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=("backup-" . [: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 Backup emailed at " . [/sys cl get time] . " " . [/sys cl get date])
 
thecoder
just joined
Topic Author
Posts: 7
Joined: Fri Feb 06, 2015 6:13 am

Re: System Error sending email timeout occurred

Mon Feb 23, 2015 12:23 am

your Script for Mikrotik System backup
and My Script for user manger bakup

as I said before the problem not in the Script
because I saw the log , and it is work very good
but when it arrived to load backup user manger , to attached to my email
It failed , I don't know what the reason?
 
User avatar
eworm
Member
Member
Posts: 472
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: System Error sending email timeout occurred

Mon Mar 02, 2015 11:49 am

Looks like I am effected, too.

Sending e-mail used to work up to and including RouterOS 6.25. My last backup via e-mail is from feb/02/2015.
I updated to RouterOS on feb/04/2015. After that I did not receive a mail from my routerboards.

RouterOS logs:
10:37:02 system,e-mail,error Error sending e-mail <Testmail>: timeout occured
While mailserver logs:
Mar 02 10:37:02 mx postfix/smtpd[16003]: connect from unknown[xx.xx.xx.xx]
Mar 02 10:37:02 mx postfix/smtpd[16003]: disconnect from unknown[xx.xx.xx.xx]
Manage RouterOS scripts and extend your devices' functionality: RouterOS Scripts
 
User avatar
strods
MikroTik Support
MikroTik Support
Posts: 1424
Joined: Wed Jul 16, 2014 7:22 am
Location: Riga, Latvia

Re: System Error sending email timeout occurred

Thu Mar 19, 2015 7:36 am

At least in my test configuration exact same script is working correctly:

1) Is this command executed:
*) Through console;
*) Through Script running it form console;
*) Through Script running it by pressing button in Winbox;
*) Through Script running it by Scheduler?
2) What is the size of attached file?
3) What kind of policy options are enabled if command is executed from Script?
4) What kind of policy options are enabled if command is executed from Scheduler?
 
User avatar
eworm
Member
Member
Posts: 472
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: System Error sending email timeout occurred

Thu Mar 19, 2015 10:59 am

For me this is not related to scripts. Just sending a mail from terminal fails:
[admin@carpo] > /system routerboard print 
       routerboard: yes
             model: 750GL
     serial-number: 467A0XXXXXXX
  current-firmware: 3.22
  upgrade-firmware: 3.22
[admin@carpo] > /system package print 
Flags: X - disabled 
 #   NAME                    VERSION        SCHEDULED
 0   system                  6.28rc14
 1   ipv6                    6.28rc14
 2   advanced-tools          6.28rc14
 3   ntp                     6.28rc14
 4   security                6.28rc14
[admin@carpo] > /tool e-mail print
    address: 10.XX.XX.XX
       port: 587
  start-tls: yes
       from: admin@XXXXX.XXXXX.XX
       user: smtp-only@XXXXX.XX
   password: XXXXXXXXXX
[admin@carpo] > /tool e-mail send body=Test subject=Testmail... to=mail@XXXXX.XX

[admin@carpo] > /log print
[...]
09:50:22 system,e-mail,error Error sending e-mail <Testmail...>: timeout occured
Of course it fails from script as well. ;)
The mails server address is private and accessible via VPN connection.
Manage RouterOS scripts and extend your devices' functionality: RouterOS Scripts
 
User avatar
eworm
Member
Member
Posts: 472
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: System Error sending email timeout occurred

Wed Mar 25, 2015 10:32 pm

I thought the connection is encrypted and did not try to dump it so far... Just did that now. And guess what? No encryption. :roll:

RSET
220 mx.xxxxxxx.de ESMTP Postfix
530 5.7.0 Must issue a STARTTLS command first

QUIT
221 2.0.0 Bye

Red ist from RouterBoard, blue is from mailserver.

The connection is started with RSET, which the mailserver does not like.
Manage RouterOS scripts and extend your devices' functionality: RouterOS Scripts
 
mgisbers
just joined
Posts: 5
Joined: Fri Mar 27, 2015 4:14 pm

Re: System Error sending email timeout occurred

Fri Mar 27, 2015 4:22 pm

RFC 3207:

----
A SMTP server that is not publicly referenced may choose to require
that the client perform a TLS negotiation before accepting any
commands. In this case, the server SHOULD return the reply code:

530 Must issue a STARTTLS command first

to every command other than NOOP, EHLO, STARTTLS, or QUIT.
If the client and server are using the ENHANCEDSTATUSCODES
ESMTP extension [RFC2034], the status code to be returned
SHOULD be 5.7.0.
----

Maybe the problem is that you try to connect to the submission port (587) which does not allow other commands than those referenced in RFC 3207.

Please try to connect using port 25 on.

But, anyway, RouterOS should work using port 587 also.

Regards,

Michael
 
mgisbers
just joined
Posts: 5
Joined: Fri Mar 27, 2015 4:14 pm

Re: System Error sending email timeout occurred

Fri Mar 27, 2015 4:26 pm

RFC 3207:

----
A SMTP server that is not publicly referenced may choose to require
that the client perform a TLS negotiation before accepting any
commands. In this case, the server SHOULD return the reply code:

530 Must issue a STARTTLS command first

to every command other than NOOP, EHLO, STARTTLS, or QUIT.
If the client and server are using the ENHANCEDSTATUSCODES
ESMTP extension [RFC2034], the status code to be returned
SHOULD be 5.7.0.
----

Maybe the problem is that you try to connect to the submission port (587) which does not allow other commands than those referenced in RFC 3207.

Please try to connect using port 25 on.

But, anyway, RouterOS should work using port 587 also.

Regards,

Michael
 
User avatar
eworm
Member
Member
Posts: 472
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: System Error sending email timeout occurred

Mon Mar 30, 2015 5:56 pm

Sending on port 25 fails as well:

220 mx.xxxxx.de ESMTP Postfix
RSET
250 2.0.0 Ok
QUIT
221 2.0.0 Bye
Manage RouterOS scripts and extend your devices' functionality: RouterOS Scripts
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6283
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: System Error sending email timeout occurred

Wed Apr 01, 2015 3:14 pm

if you can give us details for us to try to log in we would appreciate that. So, if you can, send them to support@mikrotik.com reference this post.
 
User avatar
eworm
Member
Member
Posts: 472
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: System Error sending email timeout occurred

Thu Apr 02, 2015 3:37 pm

This is fixed in version 6.28rc20. Thanks a lot MikroTik!
Manage RouterOS scripts and extend your devices' functionality: RouterOS Scripts
 
theadmiral
just joined
Posts: 2
Joined: Fri Oct 11, 2013 6:32 am

Re: System Error sending email timeout occurred

Sun May 17, 2015 3:51 am

This is fixed in version 6.28rc20. Thanks a lot MikroTik!
Thank you, version 6.28 did correct the short smtp connection timeout problem. However, other short timeouts now exist within the communication session. On high latency connections (or those with intentional anti-spam post-connection delays), if RouterOS 's e-mail tool does not receive a reply within 15 seconds, it will abort the session without generating any error message or attempting a retry. This specific problem only popped up in 6.28.

A 15 second response delay appears to be enough to trigger the behavior. This can be duplicated by configuring a Postfix based mail server using the "sleep" directive. For example the e-mail tool will drop out (without generating syslog error messages) after sending "RCPT TO:" with the remote Postfix mail server configured as follows:

smtpd_recipient_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
sleep 16,
reject_unauth_destination,
reject_unauth_pipelining,
reject_invalid_helo_hostname,
reject_non_fqdn_sender,
reject_non_fqdn_recipient,
(etc..)

This is not a critical problem (since removing the sleep line resolves the problem); however, it does introduce a new, undesirable behavior. Increasing the time-out or adding a debug syslog event would be most useful.

Thanks again for fixing the original connection timeout bug :-)

Thanks Much.

Who is online

Users browsing this forum: gramels, l0ft13 and 155 guests