LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Sendmail on CentOS not working properly (https://www.linuxquestions.org/questions/linux-server-73/sendmail-on-centos-not-working-properly-4175504685/)

ps1x0 05-12-2014 02:12 AM

Sendmail on CentOS not working properly
 
I've been searching for some time how to resolve my issue, but from the threads/tutorials I found, nothing actually described my problem.

So there are some emails, that aren't sent or that are delayed with days and in the end flushed from the queue.

I have 2 domains which I use on the machine, let's say domain1.com and domain2.com.

Code:

I am trying to send an email to void@domain1.com but i get the following reply:
"550 5.1.1 void@domain1.com... User unknown"

The actual hosting on the mailboxes is on another machine (paid hosting) and the mailbox exists.

Second problem is with domain2.com:

Quote:

s4A603Tc015479 4347 Sat May 10 09:00 MAILER-DAEMON
8BITMIME (Deferred: Connection refused by subdomain.domain2.com.)
<noreply@subdomain.domain2.com>
Here is the log from maillog:

Code:

May 12 10:06:53 domain1 sendmail[11658]: dangerous permissions=40777 on queue directory /var/spool/clientmqueue/
May 12 10:06:53 domain1 sendmail[11658]: s4C76rEa011658: from=root, size=224, class=0, nrcpts=1, msgid=<201405120706.s4C76rEa011658@domain1.com>, relay=root@localhost
May 12 10:06:53 domain1 sendmail[11659]: s4C76rFQ011659: <void@domain1.com>... User unknown
May 12 10:06:53 domain1 sendmail[11658]: s4C76rEa011658: to=void@domain1.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30224, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.1, stat=User unknown
May 12 10:06:53 domain1 sendmail[11659]: s4C76rFQ011659: from=<root@domain1.com>, size=224, class=0, nrcpts=0, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
May 12 10:06:53 domain1 sendmail[11658]: s4C76rEa011658: s4C76rEb011658: DSN: User unknown
May 12 10:06:53 domain1 sendmail[11659]: s4C76rFS011659: from=<>, size=2099, class=0, nrcpts=1, msgid=<201405120706.s4C76rEb011658@domain1.com>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
May 12 10:06:53 domain1 sendmail[11658]: s4C76rEb011658: to=root, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31248, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (s4C76rFS011659 Message accepted for delivery)

Most of the emails to outside providers (like gmail) are sent without an issue, but some are queued and send after some time...
Example:


Code:

450 4.7.1 <....@gmail.com>: Recipient address rejected: Service is temporarily unavailable. Please try again later.
<....9@gmail.com>... Deferred: 450 4.7.1 <....9@gmail.com>: Recipient address rejected: Service is temporarily unavailable. Please try again later.


lleb 05-12-2014 08:00 PM

im no expert, but here are a few things that im seeing:

1. If domain1 is telling you user unknown, then the issue is not on the domain2 system you are sending it from, but the other end.
2. your logs tell you right off the bat you have a major issue, that is not just your issue but the rest of the worlds issue as it will drastically increase the odds of your system spamming the world:

Quote:

dangerous permissions=40777 on queue directory /var/spool/clientmqueue/
bad bad bad bad bad bad bad bad bad, 777 on a public directory... this is bad.

as for the connection refused, what mode is your SELinux configured to run and have you properly set both the IPTables and SELinux to allow for sendmail to function both inbound and out?

ps1x0 05-13-2014 11:28 AM

Code:

can not chdir(/var/spool/clientmqueue/): Permission denied
Program mode requires special privileges, e.g., root or TrustedUser.

Probably that's why I've set that permission. I chowned the directory to smmtp user, but without effect.

SELinux is disabled. Firewall has the needed ports open.

Regarding "1" - emails from gmail for example are send without an issue to void@domain1.com

dijetlo 05-16-2014 09:06 PM

Does void@domain1 have a hosted email account or is he just a user on Domain1?
Can you post the complete header from the rejected email please?


All times are GMT -5. The time now is 05:19 PM.