# Perl Warning issue



## studyete (Dec 20, 2013)

Halo, I am trying to run the following command: `setuidgid qscand /var/qmail/bin/qmail-scanner-queue.pl -z`, and getting below error:

```
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LC_ALL = "en_US",
        LANG = "en_US"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
```

I have set locale settings from csh terminal with below commands: 

`setenv LC_ALL "C"`
`setenv LANG "en_US"`

And my local settings become as below. But still I am getting the same error.


```
LANG=en_US
LC_CTYPE="C"
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=C
```

I'm providing `locale -a` report below.


```
el_GR.UTF-8
en_AU.ISO8859-1
en_AU.ISO8859-15
en_AU.US-ASCII
en_AU.UTF-8
en_CA.ISO8859-1
en_CA.ISO8859-15
en_CA.US-ASCII
en_CA.UTF-8
en_GB.ISO8859-1
en_GB.ISO8859-15
en_GB.US-ASCII
en_GB.UTF-8
en_IE.UTF-8
en_NZ.ISO8859-1
en_NZ.ISO8859-15
en_NZ.US-ASCII
en_NZ.UTF-8
en_US.ISO8859-1
en_US.ISO8859-15
en_US.US-ASCII
en_US.UTF-8
```

Note that I am using FreeBSD 9.2 64bit.  Any assistance would be highly appreciated.


----------



## AngryWolf (Dec 21, 2013)

Hi @studyete,

I am not 100% sure but I think those variable values should be specified with a character encoding as you can see from the pasted `locale -a` output. Ie. take one of

`en_US.ISO8859-1
en_US.ISO8859-15
en_US.US-ASCII
en_US.UTF-8`

and then configure LANG (and maybe LC_ALL too depending on what you need) accordingly. (C is the only notable exception, because that's a 7-bit encoding.)

I would personally set those variables from ~/.login.conf or in /etc/login.conf, because then all the rest of the variables are set up for you. For example:

`me:\
	:charset=UTF-8:\
	:lang=en_US.UTF-8:`

And that's enough to set all locale related variables.

More information: http://www.freebsd.org/doc/handbook/usi ... ation.html


----------



## ShelLuser (Dec 21, 2013)

There's definitely something weird about your environment. Because I don't think it's healthy if your system doesn't at least support the POSIX and C locales, which yours doesn't seem to do. Even though these are standards.

Is it possible that you have the environment variable PATH_LOCALE set and pointed to somewhere else?

Or have you by any chance made changes in /etc/login.conf recently?


----------



## wblock@ (Dec 21, 2013)

Are the settings being made for the qscand user?


----------



## studyete (Dec 21, 2013)

Thanks all for replying. I have actually have read http://www.freebsd.org/doc/handbook/using-localization.html link and tried to set accordingly, but it did not work either. Then I have tied what @AngryWolf said and modified as below and rebooted the PC. Still I am getting same output of command locale from bash shell.


```
me:\
:charset=UTF-8:\
:lang=en_US.UTF-8:
```

And yes, I am trying to setup qmail onf FreeBSD and the setting is made for qscand User. I have made change in /etc/login.conf after having the  @AngryWolf's advice. Though I have fall back to FreeBSD 9.0 from 9.2 at the moment and doing the configuration again.


----------



## studyete (Dec 21, 2013)

Nope, no luck. As I have updated the port, I think FreeBSD 9.0 is not matter anymore. Moreover I am getting some other error which I am unable to resolve. I am getting the info from qscanner log.


```
cannot read /var/spool/qscand/quarantine-events.db - No such file or directory
```

I know qmail is not FreeBSD supported MTA, but if any one may have interest, please suggest how do I resolve this perl and qmail scanner issue. If any one interested, I would like to provide root access to the machine. Thanks


----------



## wblock@ (Dec 21, 2013)

Offering random people root access to your system is a very bad idea.


----------



## studyete (Dec 21, 2013)

Thanks you @wblock@ for your warning. However, before we deploy any production level server, we run a test server which we configure for test. There nothing much to harm if I provide root access to test server. I have tried postfix on FreeBSD but qmail is easy to maintain and that's why I am trying to deploy qmail. Would you kindly look up my problems stated above?


----------

