Email related -

23 posts / 0 new
Last post
#1 Sun, 02/22/2009 - 07:09
placebo

Email related -

I just installed VirtualMin GPL on a clean CentOS. Everything looks to work fine exept for the email.

I can sent emails succesfully, but I cannot receive any email in the users mailbox. (and the email does not bounce back to the sender ex googlemail)

I am not sure if the configuration is correct. I see that for the users a MailDir is created under

/home/username.

There I can see the .sent folder and the emails sent. In the incoming folders: new / cur there is no email.

The strange thing is that when I navigate in VirtualMin to edit the Edit Mailbox, I see that the incoming directory for this mail is

Inbox mail file /var/mail/username

The maillog is providing some even stranger errors:

Feb 22 18:04:23 ns205347 postfix/local[16971]: 44BB5B762C: to=<root@domain.com>, orig_to=<root>, relay=local, delay=0.15, delays=0.08/0/0/0.07, dsn=5.2.0, status=bounced (can't create user output file. Command output: Insecure $ENV{PATH} while running with -T switch at /etc/webmin/virtual-server/lookup-domain.pl line 12. procmail: Program failure (255) of "/etc/webmin/virtual-server/lookup-domain.pl" procmail: Unable to treat as directory "//Maildir" procmail: Lock failure on "//Maildir.lock" procmail: Error while writing to "//Maildir" ) Feb 22 18:04:23 ns205347 postfix/cleanup[16964]: 5AD19B7643: message-id=<20090222170423.5AD19B7643@domain.com> Feb 22 18:04:23 ns205347 postfix/qmgr[17488]: 5AD19B7643: from=<>, size=16368, nrcpt=1 (queue active) Feb 22 18:04:23 ns205347 postfix/trivial-rewrite[16951]: warning: do not list domain domain.com in BOTH mydestination and virtual_alias_domains Feb 22 18:04:23 ns205347 postfix/bounce[16969]: 44BB5B762C: sender non-delivery notification: 5AD19B7643 Feb 22 18:04:23 ns205347 postfix/qmgr[17488]: 44BB5B762C: removed Feb 22 18:04:23 ns205347 postfix/local[16953]: 5AD19B7643: to=<root@domain.com>, relay=local, delay=0.15, delays=0.01/0/0/0.14, dsn=5.2.0, status=bounced (can't create user output file. Command output: Insecure $ENV{PATH} while running with -T switch at /etc/webmin/virtual-server/lookup-domain.pl line 12. procmail: Program failure (255) of "/etc/webmin/virtual-server/lookup-domain.pl" procmail: Unable to treat as directory "//Maildir" procmail: Lock failure on "//Maildir.lock" procmail: Error while writing to "//Maildir" ) Feb 22 18:04:23 ns205347 postfix/qmgr[17488]: 5AD19B7643: removed

Any suggestions on the mis-configuration?<br><br>Post edited by: placebo, at: 2009/02/22 07:11

Sun, 06/07/2009 - 07:40
ronald
ronald's picture

&quot;can't create user output file&quot;
I've had this once and turned out that the quota reached the limit, so it had no space to write any mail. Setting a higher quota fixed it.

Another error you have talks about a Lock.
I think this usually is a permission problem. Double check the user/group and folder permissions. If using suexec then folders must not be higher than 755, the user can always write to his folder.

&quot;Command output: Insecure $ENV{PATH}&quot;
This one I got no clue

Sun, 02/22/2009 - 13:53
Joe
Joe's picture

Did you use our install script? There are a number of things in your post that make me think the answer is &quot;no&quot;, and while installing manually you've skipped several steps needed to make all of this work.

--

Check out the forum guidelines!

Sun, 06/07/2009 - 07:40
ronald
ronald's picture

&quot;can't create user output file&quot;
I've had this once and turned out that the quota reached the limit, so it had no space to write any mail. Setting a higher quota fixed it.

Another error you have talks about a Lock.
I think this usually is a permission problem. Double check the user/group and folder permissions. If using suexec then folders must not be higher than 755, the user can always write to his folder.

&quot;Command output: Insecure $ENV{PATH}&quot;
This one I got no clue

Sun, 06/07/2009 - 07:40
placebo

<b>ronald wrote:</b>
<div class='quote'>&quot;can't create user output file&quot;
I've had this once and turned out that the quota reached the limit, so it had no space to write any mail. Setting a higher quota fixed it.

Another error you have talks about a Lock.
I think this usually is a permission problem. Double check the user/group and folder permissions. If using suexec then folders must not be higher than 755, the user can always write to his folder.

&quot;Command output: Insecure $ENV{PATH}&quot;
This one I got no clue</div>

Ronald thank you for replyingy.

Hello Joe,
Yes I use the install script on a clean installation.
During the install I got an error (only) from postfix because the hostname I used had a . in the end (domain.tld.).
I changed the configuration of the Postfix to reflect the correct hostname (myhostname = mydomain.com) and it started with no problem after that.

Any idea how can I solve the problems?

Sun, 06/07/2009 - 07:40
ronald
ronald's picture

&quot;can't create user output file&quot;
I've had this once and turned out that the quota reached the limit, so it had no space to write any mail. Setting a higher quota fixed it.

Another error you have talks about a Lock.
I think this usually is a permission problem. Double check the user/group and folder permissions. If using suexec then folders must not be higher than 755, the user can always write to his folder.

&quot;Command output: Insecure $ENV{PATH}&quot;
This one I got no clue

Sun, 06/07/2009 - 07:40
placebo

<b>ronald wrote:</b>
<div class='quote'>&quot;can't create user output file&quot;
I've had this once and turned out that the quota reached the limit, so it had no space to write any mail. Setting a higher quota fixed it.

Another error you have talks about a Lock.
I think this usually is a permission problem. Double check the user/group and folder permissions. If using suexec then folders must not be higher than 755, the user can always write to his folder.

&quot;Command output: Insecure $ENV{PATH}&quot;
This one I got no clue</div>

Ronald thank you for replyingy.

Hello Joe,
Yes I use the install script on a clean installation.
During the install I got an error (only) from postfix because the hostname I used had a . in the end (domain.tld.).
I changed the configuration of the Postfix to reflect the correct hostname (myhostname = mydomain.com) and it started with no problem after that.

Any idea how can I solve the problems?

Sun, 02/22/2009 - 15:56
andreychek

What does your /etc/procmailrc and /etc/postfix/main.cf look like?

Also, as Ronald mentioned, are you sure your accounts aren't over quota?
-Eric

Sun, 06/07/2009 - 07:41
ronald
ronald's picture

&quot;can't create user output file&quot;
I've had this once and turned out that the quota reached the limit, so it had no space to write any mail. Setting a higher quota fixed it.

Another error you have talks about a Lock.
I think this usually is a permission problem. Double check the user/group and folder permissions. If using suexec then folders must not be higher than 755, the user can always write to his folder.

&quot;Command output: Insecure $ENV{PATH}&quot;
This one I got no clue

Sun, 06/07/2009 - 07:41
placebo

This was the old procmail
<div class='quote'>:0wi
VIRTUALMIN=|/etc/webmin/virtual-server/lookup-domain.pl $LOGNAME
:0
* ?/usr/bin/test &quot;$VIRTUALMIN&quot; != &quot;&quot;
{
INCLUDERC=/etc/webmin/virtual-server/procmail/$VIRTUALMIN
}
DEFAULT=$HOME/Maildir/
ORGMAIL=$HOME/Maildir/</div>

and I replaced it with
<div class='quote'>
LOGFILE=/var/log/procmail.log
TRAP=/etc/webmin/virtual-server/procmail-logger.pl
:0wi
VIRTUALMIN=|/etc/webmin/virtual-server/lookup-domain.pl $LOGNAME
:0
* ?/usr/bin/test &quot;$VIRTUALMIN&quot; != &quot;&quot;
{
INCLUDERC=/etc/webmin/virtual-server/procmail/$VIRTUALMIN
}
DEFAULT=$HOME/Maildir/
ORGMAIL=$HOME/Maildir/
DROPPRIVS=yes
:0
$DEFAULT
</div> [file name=postfixmaincf.txt size=27419]http://www.virtualmin.com/components/com_fireboard/uploaded/files/postfi...

Now I am getting some logs from procmail.log
<div class='quote'>From root@mydomain.com Mon Feb 23 09:21:36 2009
Subject: lfd on mydomain.com: SSH login alert for user root from 141.79.160.12
Folder: **Bounced** 478
/bin/sh: /etc/webmin/virtual-server/procmail-logger.pl: No such file or directory
Insecure $ENV{PATH} while running with -T switch at /etc/webmin/virtual-server/lookup-domain.pl line 12.
procmail: Program failure (255) of &quot;/etc/webmin/virtual-server/lookup-domain.pl&quot;
procmail: Unable to treat as directory &quot;//Maildir&quot;
procmail: Error while writing to &quot;//Maildir&quot;
procmail: Unable to treat as directory &quot;//Maildir&quot;
procmail: Lock failure on &quot;//Maildir.lock&quot;
procmail: Error while writing to &quot;//Maildir&quot;
From MAILER-DAEMON Mon Feb 23 09:21:36 2009
Subject: Undelivered Mail Returned to Sender
Folder: **Bounced** 592
/bin/sh: /etc/webmin/virtual-server/procmail-logger.pl: No such file or directory</div>

I assume that the installation of the postfix/procmail was not successfull. Is there some way of removing and adding this as modules from Virtualmin, or should I compile them from scratch?

Sun, 06/07/2009 - 07:41
ronald
ronald's picture

&quot;can't create user output file&quot;
I've had this once and turned out that the quota reached the limit, so it had no space to write any mail. Setting a higher quota fixed it.

Another error you have talks about a Lock.
I think this usually is a permission problem. Double check the user/group and folder permissions. If using suexec then folders must not be higher than 755, the user can always write to his folder.

&quot;Command output: Insecure $ENV{PATH}&quot;
This one I got no clue

Sun, 06/07/2009 - 07:41
placebo

This was the old procmail
<div class='quote'>:0wi
VIRTUALMIN=|/etc/webmin/virtual-server/lookup-domain.pl $LOGNAME
:0
* ?/usr/bin/test &quot;$VIRTUALMIN&quot; != &quot;&quot;
{
INCLUDERC=/etc/webmin/virtual-server/procmail/$VIRTUALMIN
}
DEFAULT=$HOME/Maildir/
ORGMAIL=$HOME/Maildir/</div>

and I replaced it with
<div class='quote'>
LOGFILE=/var/log/procmail.log
TRAP=/etc/webmin/virtual-server/procmail-logger.pl
:0wi
VIRTUALMIN=|/etc/webmin/virtual-server/lookup-domain.pl $LOGNAME
:0
* ?/usr/bin/test &quot;$VIRTUALMIN&quot; != &quot;&quot;
{
INCLUDERC=/etc/webmin/virtual-server/procmail/$VIRTUALMIN
}
DEFAULT=$HOME/Maildir/
ORGMAIL=$HOME/Maildir/
DROPPRIVS=yes
:0
$DEFAULT
</div> [file name=postfixmaincf.txt size=27419]http://www.virtualmin.com/components/com_fireboard/uploaded/files/postfi...

Now I am getting some logs from procmail.log
<div class='quote'>From root@mydomain.com Mon Feb 23 09:21:36 2009
Subject: lfd on mydomain.com: SSH login alert for user root from 141.79.160.12
Folder: **Bounced** 478
/bin/sh: /etc/webmin/virtual-server/procmail-logger.pl: No such file or directory
Insecure $ENV{PATH} while running with -T switch at /etc/webmin/virtual-server/lookup-domain.pl line 12.
procmail: Program failure (255) of &quot;/etc/webmin/virtual-server/lookup-domain.pl&quot;
procmail: Unable to treat as directory &quot;//Maildir&quot;
procmail: Error while writing to &quot;//Maildir&quot;
procmail: Unable to treat as directory &quot;//Maildir&quot;
procmail: Lock failure on &quot;//Maildir.lock&quot;
procmail: Error while writing to &quot;//Maildir&quot;
From MAILER-DAEMON Mon Feb 23 09:21:36 2009
Subject: Undelivered Mail Returned to Sender
Folder: **Bounced** 592
/bin/sh: /etc/webmin/virtual-server/procmail-logger.pl: No such file or directory</div>

I assume that the installation of the postfix/procmail was not successfull. Is there some way of removing and adding this as modules from Virtualmin, or should I compile them from scratch?

Mon, 02/23/2009 - 05:15
andreychek

Alright, unfortunately, it doesn't look like something worked properly on your system :-)

I'm not sure why, as the install.sh script usually works really well, but we can just move to trying to get it all working :-)

At first glance, it looks like you need to do the following:

* Copy /usr/libexec/webmin/virtual-server/procmail-logger.pl to /etc/webmin/virtual-server/

* Install procmail-wrapper if it isn't already: yum install procmail-wrapper

* Edit your main.cf, and change the mailbox_command line to read: mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME

* Also in main.cf, add the following line: home_mailbox = Maildir/

That should get you started -- once you do those, let us know what (if any) error messages you see if you try to send email locally.
-Eric

Sun, 06/07/2009 - 07:41
ronald
ronald's picture

&quot;can't create user output file&quot;
I've had this once and turned out that the quota reached the limit, so it had no space to write any mail. Setting a higher quota fixed it.

Another error you have talks about a Lock.
I think this usually is a permission problem. Double check the user/group and folder permissions. If using suexec then folders must not be higher than 755, the user can always write to his folder.

&quot;Command output: Insecure $ENV{PATH}&quot;
This one I got no clue

Mon, 02/23/2009 - 05:59
placebo

Hello andreycheck,
Thank you very much for your message. Now I can receive email locally:

<div class='quote'>Feb 23 16:50:42 postfix/local[30207]: 26BC9B778F: to=&lt;user.dom@dom.com&gt;, orig_to=&lt;user@dom.com&gt;, relay=local, delay=8.9, delays=0.04/0/0/8.8, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME)</div>

... but I cannot get any email from outside the server (tested with yahoo and google and the email does not seem to bounce back).

Mon, 02/23/2009 - 06:04 (Reply to #15)
placebo

changes made:
* Copy /usr/libexec/webmin/virtual-server/procmail-logger.pl to /etc/webmin/virtual-server/

* Edit your main.cf, and change the mailbox_command line to read: mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME

* Also in main.cf, add the following line: home_mailbox = Maildir/

procmail-wrapper was installed.

Mon, 02/23/2009 - 06:32 (Reply to #16)
andreychek

Had you been able to receive email from Google and such before?

What all do you see in /var/log/maillog when sending an email from Google?
-Eric

Sun, 06/07/2009 - 07:41
ronald
ronald's picture

&quot;can't create user output file&quot;
I've had this once and turned out that the quota reached the limit, so it had no space to write any mail. Setting a higher quota fixed it.

Another error you have talks about a Lock.
I think this usually is a permission problem. Double check the user/group and folder permissions. If using suexec then folders must not be higher than 755, the user can always write to his folder.

&quot;Command output: Insecure $ENV{PATH}&quot;
This one I got no clue

Mon, 02/23/2009 - 06:46
placebo

Hello Eric,
I don't get any mail from Google and I don't get any log related to this message in maillog.

The logs are from the moment I sent the email from Google.
<div class='quote'>Feb 23 17:36:07 domain last message repeated 2 times
Feb 23 17:37:31 domain dovecot: imap-login: Login: user=&lt;domain&gt;, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
Feb 23 17:37:31 domain last message repeated 2 times
Feb 23 17:37:31 domain dovecot: IMAP(domain): Connection closed
Feb 23 17:37:31 domain last message repeated 2 times
Feb 23 17:37:50 domain postfix/pickup[30659]: A8C7AB7792: uid=0 from=&lt;root&gt;
Feb 23 17:37:50 domain postfix/cleanup[3354]: A8C7AB7792: message-id=&lt;20090223163750.A8C7AB7792@domain.com&gt;
Feb 23 17:37:50 domain postfix/qmgr[30660]: A8C7AB7792: from=&lt;root@domain.com&gt;, size=6392, nrcpt=1 (queue active)
Feb 23 17:37:50 domain postfix/pickup[30659]: CF9CDB778F: uid=0 from=&lt;root&gt;
Feb 23 17:37:50 domain postfix/cleanup[3354]: CF9CDB778F: message-id=&lt;20090223163750.CF9CDB778F@domain.com&gt;
Feb 23 17:37:50 domain postfix/qmgr[30660]: CF9CDB778F: from=&lt;root@domain.com&gt;, size=6392, nrcpt=1 (queue active)
Feb 23 17:37:50 domain postfix/pickup[30659]: E5465B7793: uid=0 from=&lt;root&gt;
Feb 23 17:37:50 domain postfix/cleanup[3354]: E5465B7793: message-id=&lt;20090223163750.E5465B7793@domain.com&gt;
Feb 23 17:37:50 domain postfix/local[3358]: A8C7AB7792: to=&lt;root@domain.com&gt;, orig_to=&lt;root&gt;, relay=local, delay=0.3, delays=0.2/0/0/0.09, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME)
Feb 23 17:37:50 domain postfix/qmgr[30660]: A8C7AB7792: removed
Feb 23 17:37:50 domain postfix/qmgr[30660]: E5465B7793: from=&lt;root@domain.com&gt;, size=6392, nrcpt=1 (queue active)
Feb 23 17:37:51 domain postfix/local[3371]: CF9CDB778F: to=&lt;root@domain.com&gt;, orig_to=&lt;root&gt;, relay=local, delay=0.4, delays=0.24/0/0/0.15, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME)
Feb 23 17:37:51 domain postfix/qmgr[30660]: CF9CDB778F: removed
Feb 23 17:37:51 domain postfix/local[3358]: E5465B7793: to=&lt;root@domain.com&gt;, orig_to=&lt;root&gt;, relay=local, delay=0.24, delays=0.09/0/0/0.14, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME)
Feb 23 17:37:51 domain postfix/qmgr[30660]: E5465B7793: removed
Feb 23 17:38:12 domain dovecot: imap-login: Login: user=&lt;domain&gt;, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
Feb 23 17:38:12 domain last message repeated 2 times
Feb 23 17:38:12 domain dovecot: IMAP(domain): Connection closed
Feb 23 17:38:12 domain last message repeated 2 times
Feb 23 17:38:40 domain postfix/pickup[30659]: 3975BB7792: uid=0 from=&lt;root&gt;
Feb 23 17:38:40 domain postfix/cleanup[3354]: 3975BB7792: message-id=&lt;20090223163840.3975BB7792@domain.com&gt;
Feb 23 17:38:40 domain postfix/qmgr[30660]: 3975BB7792: from=&lt;root@domain.com&gt;, size=530, nrcpt=1 (queue active)
Feb 23 17:38:40 domain postfix/local[3371]: 3975BB7792: to=&lt;root@domain.com&gt;, orig_to=&lt;root&gt;, relay=local, delay=0.12, delays=0.03/0/0/0.09, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME)
Feb 23 17:38:40 domain postfix/qmgr[30660]: 3975BB7792: removed
Feb 23 17:38:56 domain postfix/pickup[30659]: D2320B7792: uid=0 from=&lt;root&gt;
</div>
Here I sent another message locally, from the server to an account domain@domain.com on the server:
<div class='quote'>
Feb 23 17:38:56 domain postfix/cleanup[3354]: D2320B7792: message-id=&lt;20090223163856.D2320B7792@domain.com&gt;
Feb 23 17:38:56 domain postfix/qmgr[30660]: D2320B7792: from=&lt;root@domain.com&gt;, size=283, nrcpt=1 (queue active)
Feb 23 17:38:56 domain postfix/trivial-rewrite[3355]: warning: do not list domain domain.com in BOTH mydestination and virtual_alias_domains
Feb 23 17:39:05 domain postfix/local[3358]: D2320B7792: to=&lt;domain@domain.com&gt;, relay=local, delay=8.5, delays=0.02/0/0/8.4, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME)
Feb 23 17:39:05 domain postfix/qmgr[30660]: D2320B7792: removed</div>

I checked the MX record just to be sure and it is pointing in the right server :)
Any thing I should debug? It is really strange that I don't see the message or that the message does not get bounced back.

From <div class='quote'>
#grep -ir 'gmail' maillog
</div>
I get only logs about smtp messages like:
<div class='quote'>Feb 23 16:50:11 domain postfix/smtp[29489]: 0CA03B778F: to=&lt;myemail@gmail.com&gt;, relay=gmail-smtp-in.l.google.com[66.249.93.27]:25, delay=1.8, delays=0.04/0/0.56/1.2, dsn=2.0.0, status=sent (250 2.0.0 OK 1235404212 e33si8697724ugd.24)</div>

Mon, 02/23/2009 - 06:48 (Reply to #19)
placebo

by the way: the only strange message I see is: <b>Feb 23 17:38:56 domain postfix/trivial-rewrite[3355]: warning: do not list domain domain.com in BOTH mydestination and virtual_alias_domains</b>

Mon, 02/23/2009 - 06:49 (Reply to #20)
andreychek

Yeah, it doesn't look like the messages from Google are hitting your server at all.

Are you sure that port 25 is available externally? Do you have an external server you can use to test if port 25 is available on your box?

I'd also verify that the MX record is really pointing to the correct IP address.
-Eric

Mon, 02/23/2009 - 07:02 (Reply to #21)
placebo

@Eric.

Thank you very much for your assistance!
I changed to listen on all interfaces and not only on Localhost. Now it works fine!

Mon, 02/23/2009 - 07:04 (Reply to #22)
andreychek

Ahh, good catch!

I'm glad it's working for you now.

Have a good one!
-Eric

Topic locked