Postfix problem - cannot send any messages, but says it is ok

12 posts / 0 new
Last post
#1 Tue, 03/06/2012 - 12:11
deanski79

Postfix problem - cannot send any messages, but says it is ok

Heloo, all!

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

Tue, 03/06/2012 - 13:17
andreychek

Howdy,

When email isn't working, you can often find what's wrong by reviewing the error logs.

Those are in either /var/log/maillog, or /var/log/mail.log, depending on your Linux distribution.

-Eric

Tue, 03/06/2012 - 13:36
deanski79

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.

seems to be ok, but no e-mail recieved :/

Regards, Dean Iliev

Tue, 03/06/2012 - 14:34
andreychek

Howdy,

Well, the mail log should be telling you about every message that is sent and received.

Even if there aren't errors, it would at least show you that it was delivered.

If you aren't seeing anything at all, if the mail log is blank -- well, you'll want to get that fixed first :-)

You may want to try restarting both syslog and postfix, and see if your mail logs begin showing up at that point.

-Eric

Tue, 03/06/2012 - 16:47
deanski79

Here is the log after I send a message:

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]

P.S. Very strange...

 postfix/smtpd[4379]: warning: unknown[IP]: SASL LOGIN authentication failed: authentication failure

But I can Login and read mails.

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)

But how to fix it ?

Regards, Dean Iliev

Mon, 02/18/2013 - 10:28 (Reply to #5)
gianiweed

alternatives --config mta service postfix stop chkconfig --level 345 postfix off service sendmail start chkconfig --level 345 sendmail on

Tue, 03/06/2012 - 22:16
andreychek

Hmm, is your hostname in FQDN format -- host.domain.com? You can determine that by running the command "hostname".

Also, is there a Virtual Server with the same name as your hostname? That can sometimes cause problems.

You'd also want to make sure that your hostname appears in /etc/hosts, next to your public IP.

Lastly, you may want to try running System Settings -> Re-Check Config, just to make sure it doesn't see anything unusual.

-Eric

Tue, 03/06/2012 - 23:31
deanski79
# hostname
myhostname.com

Yes, there IS a virtual server with the same name.

# cat /etc/hosts
127.0.0.1 localhost
MYIP   myhostname.com

Re-check config says that everything is OK.

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

atributes.

Regards, Dean Iliev

Wed, 03/07/2012 - 09:36
andreychek

(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?

-Eric

Wed, 03/07/2012 - 13:42
deanski79

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.

Thanks for help, Best regards, Dean

Regards, Dean Iliev

Wed, 03/07/2012 - 14:06
andreychek

Great, I'm glad you got it working, thanks for letting us know how you fixed it!

-Eric

Sun, 03/11/2012 - 01:32
deanski79

Since that failure the system still tries to send messages to @com.com Webmin>Postfix>Mail Queue says 0 messages. How to stop them manually?

Regards, Dean Iliev

Topic locked