EXIM4 configuration not working for only 1 machine. - email

Here is the deal.
We have a printer and all our machines have debian in our office. I've configured the printer to send mails to the server (pc00) via its IP (which is static). I created a hubbed_hosts file that tells exim each machine, which IP it has. So my own personal mahcine is ariela#pc01 since I have pc01 and my username is ariela. This should get received in the mbox file. This works in every other machine except mine.
If I print the exim log I get:
ariela#pc01 R=hubbed_hosts T=remote_smtp defer (-44): SMTP error from remote mail server after RCPT TO:<ariela#pc01>: host 192.168.2.101 [192.168.2.101]: 451 Temporary local problem - please try later
It seems as if the problem is in my client machine, howerver I've runned the exim4-config with dpkg-reconfigure for my machine and It is the exact same things as the others that do work. I'm clueless.
Any help would be appreciated.

Related

Configure root#localhost mail on postfix dovecot postfixadmin virtual mail server using postgresql freebsd 12

Using freebsdI I setup a postfix, dovecot, postgresql and postfixadmin virtual email server. Everything is working to my satisfaction except email to root#localhost and my user email to localhost. Having done a lot of investigation and some trial I'm not finding the answer.
I looked at mydestination I have localhost listed, I think that is correct.
I tried adding localhost as a postfixadmin domain, this fails the x.x edit. localhost. does not work either. Don't really want to change code for obvious reasons. Localhost will resolve to the correct local ip 127.0.0.1.
Tried using mail to send root#localhost and get a dead.letter file with the message in it.
I am not a email server expert only the first time I've done this so much learning to do.
how do I solve this issue?
Thanks in advance for your help.

Sendmail Relay Issue

I have installed sendmail on Centos 7 and setup relay server using SMART_HOST.
But sendmail is not using my relay server when sending email, it keeps using localhost.
Can anyone help me to solve this problem?
Sendmail-8.12+ by default relays messages submitted locally to local main sendmail daemon running at 127.0.0.1:25. It does it as a security precaution to avoid installation as set root uid.
Have you checked sendmail log files? They should show where main local sendmail daemon relays messages to non local email addresses.
Documentation: SECURITY file in sendmail distribution
I found the answer myself.
The mistake was with LOCAL_DOMAIN.
I had put my local domain (which was used for mail server and email address) here.
And all of my emails were being handled as local emails.
Local emails were meant for excluding from relay, lol.

Mail not getting send to specific domains

We have a VPS with CentOS combined with DirectAdmin which we use for a Magento shop. This runs fine, except for sending email.
Problem:
It appears that some specific domains won't receive our emails and we get a bounce. If we use any other email sending systems, the mails arrive without problems.
The bounce mail contains the following error:
SMTP error from remote mail server after HELO Company-Shops:
host mx-cluster-b2.one.com [IP ADRESS]: 504 5.5.2 :
Helo command rejected: need fully-qualified hostname
After googling and trying things for a week now, I am a bit lost. I tried checking postfix in CentOS, but this is not installed and I'm not quite sure if this is needed.
Possible issue?
I believe the hostfile in CentOS is setup incorrectly:
127.0.0.1 localhost localhost.localdomain localhost4 ... etc
OUR IP Company-Shops
'Company-Shops' should probably be a domain name, am I right? The same as the rDNS. But I'm afraid if I change this it will kill my site and whatnot. I'm not sure if this entry correlates with the 'company-Shops' helo label in the bounce error.
Some extra info:
- We use the webmail Roundcube from DirectAdmin
- At the moment we run one shop, but this might grow a bit (multiple sites on 1 IP)
- We don't use subdomains
- We've set up a reverse DNS, with the domain
Is there anyone with similiar experiences or with a bit more knowledge about this subject? I appreciate any advice we can get, as we are stuck..
Many thanks.
Yes, that's right: your mail server should identify itself using a fully-qualified domain name when it connects to send mail via SMTP. You don't say what mail server you're running, but since you're using DA, it's probably Exim. If so, you want to edit /etc/exim.conf and set primary_hostname to the FQDN of your server.
This would also be a good time to double-check that reverse DNS is set up properly for your IP address. Many hosts will also reject email from servers on IPs without a valid rDNS record.
I'm not familiar with Magento, but I can't see any way that changing the Exim configuration in this way could impact that program.

Can send mail but can't receive SMTP failure

I've got dedicated server to run all my sites from.
I created domain and updated all DNS records to this server, everything is fine and propagated however when i try and receive mail nothing happens but it can send.
I went to dnsstuff.com and this is the error i got...
All connections to Mailservers port 25 have failed. The standard port
for SMTP transactions is 25, so your servers should be operating on
that port. It is recommended that it be fixed in order for your mail
service to operate properly. The Mail Servers that failed are:
xx.xxx.xxx.xxx | failed message send with: failed cx open with: failed socket connect with: Operation now in progress
/*****************
UPDATE
*****************/
Running a linux box using centOS.
The mailserver being used is, I believe, Postfix.
How do i fix this problem?
Check your firewall configuration on your server. If you can send from localhost (that is, direclty from your server), but mail can't be delivered from remote servers to your box, your firewall is the best bet to look at. Basically port 25 should be open to any IP. It's hard to give you specific details on how to configure your firewall, as you do not specify your OS and dikstribution. Most Linux distro's run some flavour of iptables. If iptables is what you have, you could try this command from the command line:
iptables -A INPUT -p tcp --dport 25 -j ACCEPT
Before you open up your firewall, you might want to dive into configuring postfix. It would not be nice to the rest of the world if you started running an open relay. That will get your server blacklisted in no time. This artice on the postfix website will give you a decent start.

How do I fix "501 Syntactically invalid HELO argument(s)"?

I'm using exim on both the sending and relay hosts, the sending host seems to offer:
HELO foo_bar.example.com
Response:
501 Syntactically invalid HELO argument(s)
Possibly a problem with underscores in the hostname?
http://www.exim.org/lurker/message/20041124.113314.c44c83b2.en.html
Underscores aren't actually valid in internet host names, despite some people using them anyway. A sane DNS server should not allow you to have records for them.
Change your system's host name so it's valid, hopefully this will fix it.
After spending so many hours trying to fix this problem, which in my case just come up from nothing, I ended up with a solution. In my case, only the systems deployed to Suse OSs suddenly stopped sending emails but not those ( the same ) running on Ubuntu. After exhausting and eliminating all the suggested possibilities of this problem and even considering to change de OS of those machines, I found out that somehow the send email service is sensible to the hostname of the host machine. In the Ubuntu machines the file /etc/hosts have only the following line:
127.0.0.1 localhost
and so were the Suse machines, which stopped sending the emails. After editing the /etc/hosts from Suse machines to
127.0.0.1 localhost proplad
where proplad is the hostname of the machine, the errors were vanished. It seems that some security policy ( maybe from the smtp service ) uses the hostname information carried through the API, which was being ignored in the case of the Ubuntu machines, but not in the case of Suse machines. Hope this helps others, avoiding massive hours of research over the internet.
Diago's answer helped me solve the problem I have been trying to figure out.
Our Suse OS also stopped working out of nowhere. Tried every suggestion that I found here and on google. Nothing worked. Tried adding our domain to etc/hosts but that did not help.
Got the hostname of server with the hostname command. Added that hostname to the etc/hosts file just like Digao suggested.
127.0.0.1 localhost susetest
I saved the changes, then ran postfix stop, postfix start. And works like a charm now.
The argument to HELO should be a hostname or an IP address. foo_bar.example.com is neither an IP address nor a hostname (underscores are illegal in hostnames), so the error message is correct and there is nothing to fix.
Using qmail I came across this problem. I realised this was because of a previously unfinished installation.
1) When sending email qmail announces itself to other SMTP servers with "HELO ..." and then it adds what is in the file at: /var/qmail/control/me
(sometimes the file is located at /var/qmail/control/helohost)
2) This file should have a hostname with a valid DNS entry in.
Mine did not it had (none) which is why mails were failing to be sent.
I found that my local dev server suddenly stopped sending emails (using external SMTP) and on the server logs I found:
rejected EHLO from cpc96762-*******.net [..**.68]: syntactically invalid argument(s): 127.0.0.1:8888/app_dev.php
127.0.0.1:8888/app_dev.php is my local URL, I am using Docker, Symfony and Swift Mailer.
The only solution that helped in my case was adding the parameter:
local_domain = "localhost"
to my Swift Mailer configuration. That solved all the problems.
See the docs for the Swift Mailer local_domain option: https://symfony.com/doc/current/reference/configuration/swiftmailer.html#local-domain