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

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

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

Alright, unfortunately, it doesn’t look like something worked properly on your system :slight_smile:

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 :slight_smile:

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

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

Feb 23 16:50:42 postfix/local[30207]: 26BC9B778F: to=<user.dom@dom.com>, orig_to=<user@dom.com>, 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)

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

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.

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

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.

Feb 23 17:36:07 domain last message repeated 2 times Feb 23 17:37:31 domain dovecot: imap-login: Login: user=<domain>, 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=<root> Feb 23 17:37:50 domain postfix/cleanup[3354]: A8C7AB7792: message-id=<20090223163750.A8C7AB7792@domain.com> Feb 23 17:37:50 domain postfix/qmgr[30660]: A8C7AB7792: from=<root@domain.com>, size=6392, nrcpt=1 (queue active) Feb 23 17:37:50 domain postfix/pickup[30659]: CF9CDB778F: uid=0 from=<root> Feb 23 17:37:50 domain postfix/cleanup[3354]: CF9CDB778F: message-id=<20090223163750.CF9CDB778F@domain.com> Feb 23 17:37:50 domain postfix/qmgr[30660]: CF9CDB778F: from=<root@domain.com>, size=6392, nrcpt=1 (queue active) Feb 23 17:37:50 domain postfix/pickup[30659]: E5465B7793: uid=0 from=<root> Feb 23 17:37:50 domain postfix/cleanup[3354]: E5465B7793: message-id=<20090223163750.E5465B7793@domain.com> Feb 23 17:37:50 domain postfix/local[3358]: A8C7AB7792: to=<root@domain.com>, orig_to=<root>, 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=<root@domain.com>, size=6392, nrcpt=1 (queue active) Feb 23 17:37:51 domain postfix/local[3371]: CF9CDB778F: to=<root@domain.com>, orig_to=<root>, 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=<root@domain.com>, orig_to=<root>, 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=<domain>, 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=<root> Feb 23 17:38:40 domain postfix/cleanup[3354]: 3975BB7792: message-id=<20090223163840.3975BB7792@domain.com> Feb 23 17:38:40 domain postfix/qmgr[30660]: 3975BB7792: from=<root@domain.com>, size=530, nrcpt=1 (queue active) Feb 23 17:38:40 domain postfix/local[3371]: 3975BB7792: to=<root@domain.com>, orig_to=<root>, 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=<root>
Here I sent another message locally, from the server to an account domain@domain.com on the server:
Feb 23 17:38:56 domain postfix/cleanup[3354]: D2320B7792: message-id=<20090223163856.D2320B7792@domain.com> Feb 23 17:38:56 domain postfix/qmgr[30660]: D2320B7792: from=<root@domain.com>, 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=<domain@domain.com>, 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

I checked the MX record just to be sure and it is pointing in the right server :slight_smile:
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


#grep -ir ‘gmail’ maillog
I get only logs about smtp messages like:
Feb 23 16:50:11 domain postfix/smtp[29489]: 0CA03B778F: to=<myemail@gmail.com>, 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)

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

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

@Eric.

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

Ahh, good catch!

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

Have a good one!
-Eric

“can’t create user output file”
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.

"Command output: Insecure $ENV{PATH}"
This one I got no clue

“can’t create user output file”
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.

"Command output: Insecure $ENV{PATH}"
This one I got no clue

ronald wrote:

"can't create user output file" 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.

"Command output: Insecure $ENV{PATH}"
This one I got no clue

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?

“can’t create user output file”
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.

"Command output: Insecure $ENV{PATH}"
This one I got no clue

ronald wrote:

"can't create user output file" 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.

"Command output: Insecure $ENV{PATH}"
This one I got no clue

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?

“can’t create user output file”
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.

"Command output: Insecure $ENV{PATH}"
This one I got no clue

This was the old procmail

:0wi VIRTUALMIN=|/etc/webmin/virtual-server/lookup-domain.pl $LOGNAME :0 * ?/usr/bin/test "$VIRTUALMIN" != "" { INCLUDERC=/etc/webmin/virtual-server/procmail/$VIRTUALMIN } DEFAULT=$HOME/Maildir/ ORGMAIL=$HOME/Maildir/

and I replaced it with

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 "$VIRTUALMIN" != "" { INCLUDERC=/etc/webmin/virtual-server/procmail/$VIRTUALMIN } DEFAULT=$HOME/Maildir/ ORGMAIL=$HOME/Maildir/ DROPPRIVS=yes :0 $DEFAULT
[file name=postfixmaincf.txt size=27419]http://www.virtualmin.com/components/com_fireboard/uploaded/files/postfixmaincf.txt[/file]

Now I am getting some logs from procmail.log

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 "/etc/webmin/virtual-server/lookup-domain.pl" procmail: Unable to treat as directory "//Maildir" procmail: Error while writing to "//Maildir" procmail: Unable to treat as directory "//Maildir" procmail: Lock failure on "//Maildir.lock" procmail: Error while writing to "//Maildir" 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

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?

“can’t create user output file”
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.

"Command output: Insecure $ENV{PATH}"
This one I got no clue