1

edit: it was a syntax error - the IP is not supposed to be in this line. so nothing to do with encoding.

Startup error: Error in "108.174.194.111 mta10.domain.com": invalid character (' ', 0x20) in domain

Im getting this error when trying to start a program (PowerMTA). I've edited the config file under windows and I guess its some encoding error? I tried using dos2unix but still getting the same error. This 0x20 is the code for space. (The space in the string in the error message is supposed to be there) I edited the file under linux too but still the same. Any ideas? tyia

nailoxx
  • 61
  • 2
  • 5
  • unusual approach for small config files: show the file with cat, copy the text from terminal into new file (directly under linux), try again. – Dennis Nolte Jul 17 '14 at 20:46
  • dos2unix is your friend. – user9517 Jul 17 '14 at 20:51
  • @DennisNolte the file is too large to get in one terminal window with cat. I tried doing what you suggested only to the problematic line with grep but still no result. @ Iain I tried using it : dos2unix -n file1 file2 still getting the same error – nailoxx Jul 17 '14 at 21:13
  • I've resolved some odd encoding/transcoding/characterset issues with the `-b` switch in vi/vim e.g. `env LANG=C vi -b `. In general Windows tends to do some interesting things with following typesetting conventions (even in a primitive text editor like WordPad) which are correct for print but not so much for editing configuration files... – HBruijn Jul 17 '14 at 22:37
  • Are you sure you don't have a syntax error in a previous line? – Michael Hampton Jul 17 '14 at 23:06
  • @user233347 is what you pasted here literal including the quotes? Have you got it thinking the domain is `""` by wrapping everythig in double quotes instead of `"" ""` or just ` ` ? – TessellatingHeckler Jul 18 '14 at 03:27

2 Answers2

0

it's likely a problem with how windows handles newlines vs. linux's method. Linux uses \n whereas Windows uses \r\n. You'd have to delete the character at the end of the line to remove it. Or you can use something like vim to search and replace it.

check this out for help https://kb.iu.edu/d/acux

chizou
  • 477
  • 3
  • 8
  • 18
  • how would I search and replace it with nano w/o replacing all the others spaces ? – nailoxx Jul 17 '14 at 21:27
  • @user233347 i edited my response. check the link provided. that should help. although, it doesn't offer a nano solution. – chizou Jul 17 '14 at 22:51
  • I tried with vi and I get: E486: Pattern not found: ^M I also tried with tr like shown in the link but still nothing . The strange thing is I removed the line in question and typed it manually in nano but still getting the error on that line. Is it possible the problem is somewhere else ? – nailoxx Jul 18 '14 at 11:42
-1

0x20 is a space, so it sounds like you have extra space somewhere.

alexus
  • 13,112
  • 32
  • 117
  • 174