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

6
  • unusual approach for small config files: show the file with cat, copy the text from terminal into new file (directly under linux), try again. Jul 17, 2014 at 20:46
  • dos2unix is your friend.
    – user9517
    Jul 17, 2014 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, 2014 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 <filename>. 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, 2014 at 22:37
  • Are you sure you don't have a syntax error in a previous line? Jul 17, 2014 at 23:06

2 Answers 2

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

3
  • how would I search and replace it with nano w/o replacing all the others spaces ?
    – nailoxx
    Jul 17, 2014 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, 2014 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, 2014 at 11:42
-1

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

1
  • obviously. but what he's asking is how to get rid of it. Jul 17, 2014 at 22:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .