My server has been crashed today and i repair almost everything except mail sending.
The strange thing is that i can view mail, but cannot send. I tried to send a message with telnet, it was accepted, but not delivered at all.
Can someone help me to fix this?
P.s. I dont know is this topic is in the right place…
Edit: I noticed something. Mails are sending , but not delivered to rcpt
maillog doesnt tell anything after system crash. No errors, no warnings… nothing at all!
I have installed roundcube as web mail and roud cube sais that message is sent, but rpct didnt recieve the mail.
[root@host]# telnet host 25
Trying MYIP...
Connected to host.
Escape character is '^]'.
220 host ESMTP Postfix
HELO host
250 host
MAIL FROM:<dean@host>
250 2.1.0 Ok
RCPT TO:<dean@host>
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
Subject: test
asdadasd.
.
250 2.0.0 Ok: queued as 1CA36160ADE
quit
221 2.0.0 Bye
Connection closed by foreign host.
Mar 6 22:49:42 host sendmail[32399]: q26KngM0032399: Authentication-Warning: host: apache set sender to dean@host using -f
Mar 6 22:49:42 host sendmail[32399]: q26KngM0032399: from=dean@host, size=353, class=0, nrcpts=1, msgid=<a6f8ab5f9ed4c109e82728949d186b41@host>, relay=apache@localhost
Mar 6 22:49:42 host postfix/smtpd[32402]: connect from localhost[127.0.0.1]
Mar 6 22:49:42 host postfix/trivial-rewrite[32404]: warning: do not list domain host in BOTH mydestination and virtual_alias_domains
Mar 6 22:49:42 host postfix/smtpd[32402]: 5E159160AE8: client=localhost[127.0.0.1]
Mar 6 22:49:42 host postfix/cleanup[32405]: 5E159160AE8: message-id=<a6f8ab5f9ed4c109e82728949d186b41@host>
Mar 6 22:49:42 host sendmail[32399]: q26KngM0032399: to=<dean@host>, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30353, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as 5E159160AE8)
Mar 6 22:49:42 host postfix/qmgr[32326]: 5E159160AE8: from=<dean@host>, size=777, nrcpt=1 (queue active)
Mar 6 22:49:42 host postfix/smtpd[32402]: disconnect from localhost[127.0.0.1]
I think i found the problem… Server is trying to rewrite mail addres and confuses with com.com…
host postfix/smtp[9369]: ABA3A160AF4: to=<dean-host.com@com.com>, orig_to=<root@host>, relay=none, delay=60, delays=0.05/0/60/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=com.com type=A: Host not found, try again)
Ok, I added mydomain directive in main.cf and this is happening:
host postfix/local[4237]: 3EC2E160B09: to=<mail-host.com@host>, orig_to=<root@host>, relay=local, delay=0.01, delays=0/0/0/0, dsn=5.3.0, status=bounced (Command died with status 127: "/usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME". Command output: /bin/sh: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME: No such file or directory )
I think the mymail-mydomain.com@myhost is right thig.
/usr/bin/procmail-wrapper does exist and it is with
# ls -lha | grep procmail
-rwsr-sr-x 1 root root 91K Mar 29 2007 procmail
-rwsr-sr-x 1 root root 6.7K May 10 2007 procmail-wrapper
(Command died with status 127: “/usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME”. Command output: /bin/sh: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME:
Hmm, that’s an unusual error.
So just to be sure, if you run this here command:
ls -l /usr/bin/procmail-wrapper
It is showing the same file that you mentioned above?
What distribution/version are you using there?
Also, if you look in /etc/postfix/master.cf, see where it mentions “chroot”? There’s an entire column in there dedicated to whether or not each Postfix service is set to run in a chroot environment.
They should all be set to ‘n’, as a lot of additional manual configuration needs to be done to get a chroot environment working properly… are any of the Postfix services in the master.cf file there set to try and use a chroot environment?
The problem was in postfix configuration - Postfix>>Local delivery>>"“Shell to use for delivery to external command”" was marked as /bin/sh. It has to be direct exec of commands.