amtm Email Notifications from router rejected - Code 552 5.2.0 Message contains bare LF

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Weblee2407

Regular Contributor
I have my router configured to send a CC email to text (phone-number@email.domain) for some events, which has been working until about a month ago. I haven't been able to get any display of line feed/carriage return sequences in the file that is uploaded using either Nano or VI. So from what I have read, I can either get the event scripts to add them as it builds the file that becomes the email body (no detailed info mentioned of how), OR make some adjustment to the curl command that uploads the file to the SMTP server. Again - no specific info on how.

Anyone got any pointers or ideas on this?
 
Can you provide a sample email text file that is failing for everyone to look at? Are you using any formatting ie: MIME type etc
Others may be able to help with some more information provided. If it were me I'd export your generated email file to Notepad++ (windows) and enable show all characters
 
Thanks for your response.
I am using plain wan-event header and lots of 'echo "Write this line in the file" >> email-file statements. I do see the LF in notepad++ but I have found no way to manually update the file and generate CRLF.

wanEventEmail.PNG
 

Attachments

Use 'Programmer's Notepad' it has a option to 'flip' the line ending on a file.
[http://www.pnotepad.org/]

[Yes, I know about dos2unix but this is easier if you are not *nix aware !!!]

1736377557794.png
 
Thanks for your response.
I am using plain wan-event header and lots of 'echo "Write this line in the file" >> email-file statements. I do see the LF in notepad++ but I have found no way to manually update the file and generate CRLF.
...

In the status bar at the bottom of Notepad++ it should be the option to change the EOL char:

Notepad++_CRLF.jpg
 
Notepad++ does work and after being able to see results I have made progress. I was tracing my steps and I found I have been "had" by bogus info in Chat GPT - it gave me a format for unix2dos old-file converted-file!!!

Once I corrected it, I can generate a CRLF formatted email without a problem.

Thanks for the help!!!

I don't know why it stopped working, probably security or something put in place on email to text - but a win is a win
 
Last edited:
Im curious, was this only failing to your CC: address? and not to your TO: address?

Limited reading and assuming the above, it seems your CC recipient enforces the RFC standards for composition

So running unix2dos on the generated txt file before sending w/curl resolved the issue?
 
Im curious, was this only failing to your CC: address? and not to your TO: address?

Limited reading and assuming the above, it seems your CC recipient enforces the RFC standards for composition

So running unix2dos on the generated txt file before sending w/curl resolved the issue?
Correct, and that's exactly what fixed it. I had never used unix2dos and was using the wrong command format. :oops:
 
Thanks.

Well very interesting I must say. All these years no ones mentioned this issue (that Im aware of) using curl for sending Emails from the router.

Makes me wonder if we should all start using the file conversion for generated email files...

You could probably edit your informational post and redact the personal info if you wanted.
 
Thanks.

Well very interesting I must say. All these years no ones mentioned this issue (that Im aware of) using curl for sending Emails from the router.

Makes me wonder if we should all start using the file conversion for generated email files...

You could probably edit your informational post and redact the personal info if you wanted.
The info is generalized and not real personal data.
 
Thanks.

Well very interesting I must say. All these years no ones mentioned this issue (that Im aware of) using curl for sending Emails from the router.

Makes me wonder if we should all start using the file conversion for generated email files...
There's no need. You simply add the --crlf parameter to the curl command to convert <LF> to <CR><LF> during upload. I've never had EOL char problems using my custom email library for several years in all my shell scripts. The AMTM email testing routine uses the parameter as well.
 
The info is generalized and not real personal data.
Wasn't 100% 👍

There's no need. You simply add the --crlf parameter to the curl command to convert <LF> to <CR><LF> during upload. I've never had EOL char problems using my custom email library for several years in all my shell scripts. The AMTM email testing routine uses the parameter as well.
Thank you, I've looked at your code somewhere and ended up following your email formatting closely in wicens awhile back but overlooked your curl and I swear when I reviewed email.mod from amtm that wasn't there I must have completely overlooked it as well
 
Great information everyone. I learn a lot here!
 

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top