Exim Mail Transfer Agent can't deliver mail - email

I have problem with exim MTA, it can not send any mail.
I have followed a simple and straight forward guide in how to setup the MTA : https://library.linode.com/email/exim/send-only-mta-ubuntu-12.04-precise-pangolin
But when I test the configuration at the end it fails to send.
I don't get any error message when issuing the commands :
echo "This is test 1." | mail -s Testing_1 myemail#gmail.com
echo "This is test 2." | mail -s Testing_2 myemail#hotmail.com
But I can read in the log (/var/log/exim4/mainlog) that it was not successfully sent (and I don't receive any of the emails).
What should I do, I have no idea about what's wrong...??
My first thought was that the router (or firewall) was blocking my MTA, but the log shows that it has been in contact with the out side, so I don't think tht is the issue
I appriciate all the help I can get.
Edit : I had to use ISPs mailhost by setting config : dc_smarthost='mailout.isp.com' and adding a rewrite rule for Exim, matching my email adress for the account with the ISP.
/John
exim4.conf-file (/etc/exim4/update-exim4.conf.conf):
dc_eximconfig_configtype='internet'
dc_other_hostnames='PandaBoard; mydomain.net; meetup; localhost.localdomain; localhost'
dc_local_interfaces='127.0.0.1'
dc_readhost=''
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost=''
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname=''
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool'
Exim4 Log:
2013-09-13 00:13:35 exim 4.76 daemon started: pid=17823, -q30m, listening for SMTP on [127.0.0.1]:25 [::1]:25
2013-09-13 00:13:35 Start queue run: pid=17825
2013-09-13 00:13:35 End queue run: pid=17825
2013-09-13 00:23:11 exim 4.76 daemon started: pid=18570, -q30m, listening for SMTP on [127.0.0.1]:25 [::1]:25
2013-09-13 00:23:11 Start queue run: pid=18572
2013-09-13 00:23:11 End queue run: pid=18572
2013-09-13 00:24:17 1VKFJB-0004pm-Uf <= john#mydomain.net U=john P=local S=404
2013-09-13 00:24:18 1VKFJB-0004pm-Uf gmail-smtp-in.l.google.com [2a00:1450:4008:c01::1b] Network is unreachable
2013-09-13 00:25:22 1VKFJB-0004pm-Uf gmail-smtp-in.l.google.com [173.194.71.26] Connection timed out
2013-09-13 00:25:22 1VKFJB-0004pm-Uf alt1.gmail-smtp-in.l.google.com [2607:f8b0:4003:c02::1a] Network is unreachable
2013-09-13 00:26:26 1VKFJB-0004pm-Uf alt1.gmail-smtp-in.l.google.com [173.194.64.27] Connection timed out
2013-09-13 00:26:26 1VKFJB-0004pm-Uf == myemail#gmail.com R=dnslookup T=remote_smtp defer (101): Network is unreachable
2013-09-13 00:46:26 exim 4.76 daemon started: pid=19280, -q30m, listening for SMTP on [127.0.0.1]:25
2013-09-13 00:46:26 Start queue run: pid=19282
2013-09-13 01:03:55 1VKFvX-00052n-9V <= john#mydomain.net U=john P=local S=402
2013-09-13 01:05:00 1VKFvX-00052n-9V mx3.hotmail.com [65.54.188.94] Connection timed out
2013-09-13 01:06:04 1VKFvX-00052n-9V mx3.hotmail.com [65.54.188.72] Connection timed out
2013-09-13 01:07:08 1VKFvX-00052n-9V mx3.hotmail.com [65.55.37.72] Connection timed out
2013-09-13 01:08:13 1VKFvX-00052n-9V mx3.hotmail.com [65.55.92.136] Connection timed out
2013-09-13 01:09:18 1VKFvX-00052n-9V mx3.hotmail.com [65.55.92.168] Connection timed out
2013-09-13 01:09:18 1VKFvX-00052n-9V == myemail#hotmail.com R=dnslookup T=remote_smtp defer (110): Connection timed out
2013-09-13 01:16:26 Start queue run: pid=19436

Looks to me like your ISP has blocked connections outbound to tcp/25. Why did you reject your initial supposition that it was the firewall? The logs you quoted indicate that your server can make DNS requests, but there are no successful attempts to connect to a mail server. It could still be a local firewall issue but these days its very common for ISPs to prevent their clients from sending email to tcp/25 unless you have explicitly requested the ability to do so (and sometimes not even then).
Take exim out of the equation and run this from the command line of your mail server:
telnet 65.54.188.94 25
if you can connect, it's a problem with your exim install. If you can't connect, it's a network issue, whether a local firewall, ISP firewall, etc.

Use should check to see that any firewall(iptables, csf...) is running on your server first.
If yes, turn it off and try to test telnet to external mail server like :
telnet external_mail_server 25
If ok, you should check the exim configuration.
If no , you should contact your hosting provider

Related

Can receive but can not send email ubuntu 20.04

I'm using Postfix, Roundcube 1.4.3 and devcot to receive and send emails on my vps server.
I'm able to receive emails but the errors are occurring when sending the email, the mail never reaches the destination.
Port 587 is what roundcube is using.
Roundcube error.log
[25-Dec-2021 07:18:35 +0000]: <669e8q7l> PHP Error: Connection refused (POST /?_task=mail&_unlock=loading1640416601599&_framed=1&_action=send)
[25-Dec-2021 07:18:35 +0000]: <669e8q7l> PHP Error: Failed to connect socket: Connection refused (POST /?_task=mail&_unlock=loading1640416601599&_framed=1&_action=send)
[25-Dec-2021 07:18:35 +0000]: <669e8q7l> SMTP Error: Connection failed: Failed to connect socket: Connection refused in /usr/share/roundcube/program/lib/Roundcube/rcube.php on line 1702 (POST /?_task=mail&_unlock=loading1640416601599&_framed=1&_action=send)
[25-Dec-2021 07:31:29 +0000]: <eb91q6is> PHP Error: Connection refused (POST /?_task=mail&_unlock=loading1640417491382&_framed=1&_action=send)
[25-Dec-2021 07:31:29 +0000]: <eb91q6is> PHP Error: Failed to connect socket: Connection refused (POST /?_task=mail&_unlock=loading1640417491382&_framed=1&_action=send)
Error I'm getting in Roundcube ui
SMTP Error (-1): Connection to server failed.
You don't have anything listening on the port you are trying to send mail through. You need to configure your postfix to listen and accept mails on port 587.

Can syslog pri value can be negative?

First i will tell you my architecture
client--->haproxy--->syslog-ng--->kafka
the client is Cisco ASA and haproxy is server for load-balancing and syslog-ng is for receiving ,filtering and sending logs to kafka(destination)
The client sends logs to haproxy and haproxy send logs to syslog-ng using tcp transport
As in tcp the client-server timeout breaks whenever client restored the connection its PRI value is negative which we seeing in wireshark.With this issue the messages gets mixup
Connection restored is normal but PRI value is negative this is incorrect.
I am showing you the the logs
<-1>May 24 2021 17:40:28: %ASA--1-6414004: TCP Syslog Server private:xx.xx.xx.xx/1470 -
Connection restored\\nCAL\\\\John Mike/xxxxxxxxxxxxxxxxxx) to private:xx.xx.xx.xx/xx duration 0:00:00 bytes 142
(John Mike/xxxxxxxxxxxxxxxxxx)\\nxxxxxxx)\\n4 2021 17:40:28: %ASA-6-302016: Teardown UDP connection 1733810491
we've increase the client connection timeout from 1min to 12 hr but the problem is not resolved
Some version of the Cisco ASA TCP Syslog code are affected by bug CSCvz85683:
Symptom:
Wrong syslog message format, ex for 414004:
-1>Sep 08 2021 10:46:25: %ASA--1-6414004: TCP Syslog Server private:xx.xx.xx.xx/1470 - Connection restored\n (xx.xx.xx.xx/64437)
Conditions:
External logging to TCP server is enabled
Workaround:
NA
Further Problem Description:
ASA syslog messages have 6-digit ID
The valid range for message IDs is between 100000 and 999999.
Source: Cisco ASA Series Syslog Messages. About ASA Syslog Messages.
When logging via TCP on versions with the defect code, will shift the priority (6 in this case) into the message code (414004 in this case) and use an illegal priority -1.
According to the bug, this has been fixed in version 9.14.4.

Cannot send mail through an internal network,java.net.SocketException: Permission denied: connect

I cannot send an email through an internal network through an exchange mail server.
it gives me this exception
Exception in thread "main" javax.mail.MessagingException: Could not connect to SMTP host: exchange.server, port: 25;
nested exception is:
java.net.SocketException: Permission denied: connect
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1961)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:654)
at javax.mail.Service.connect(Service.java:317)
at javax.mail.Service.connect(Service.java:176)
at javax.mail.Service.connect(Service.java:125)
at javax.mail.Transport.send0(Transport.java:194)
at javax.mail.Transport.send(Transport.java:124)
Create an exception in your firewall for port 25. If it isnt enought (Port 25 is used for spam it may come from that), try to change your method to use an other port. Configure your exchange server and firewall accordingly.

WHM Email Stuck in Manager Queue after Cloudflare Setup

My WHM server seems to be storing all its email in the queue manager, I get the following errors from EXIM
LOG: MAIN
cwd=/usr/local/cpanel/whostmgr/docroot 4 args: /usr/sbin/exim -v -M 1ZHBnT-0003rU-0v
delivering 1ZHBnT-0003rU-0v
LOG: MAIN
SMTP connection identification H=localhost A=::1 P=60184 M=1ZHBnT-0003rU-0v U=root ID=0 S=root B=authenticated_local_user
Connecting to gmail-smtp-in.l.google.com [74.125.70.27]:25 ... failed: Connection timed out (timeout=5m)
LOG: MAIN
H=gmail-smtp-in.l.google.com [74.125.70.27] Connection timed out
Connecting to alt1.gmail-smtp-in.l.google.com [173.194.204.27]:25 ... failed: Connection timed out (timeout=5m)
LOG: MAIN
H=alt1.gmail-smtp-in.l.google.com [173.194.204.27] Connection timed out
Connecting to alt2.gmail-smtp-in.l.google.com [74.125.141.27]:25 ... failed: Connection timed out (timeout=5m)
LOG: MAIN
H=alt2.gmail-smtp-in.l.google.com [74.125.141.27] Connection timed out
Connecting to alt3.gmail-smtp-in.l.google.com [64.233.190.27]:25 ... failed: Connection timed out (timeout=5m)
LOG: MAIN
H=alt3.gmail-smtp-in.l.google.com [64.233.190.27] Connection timed out
Port 25 is open.
I think your server mail IP is blocked on gmail server and due to that you are getting this issues. May be your one of the user is sending spam mails from your server and that is the reason your server IP is blocked. You can check your mail server IP status through http://mxtoolbox.com/blacklists.aspx URL.

Unable to send mail using JAMES mail server?

I have setup JAMES email server on my local windows system. Now I am trying to send mail to my yahoo account but I am getting the following error
13/11/10 12:39:56 INFO James.Mailet: RemoteAddrNotInNetwork: Authorized addresses: [127.0.0.1/255.255.255.255, 0.0.0.0/255.255.255.255, 192.168.2.0/255.255.255.0]
13/11/10 12:39:56 INFO James.Mailet: RemoteDelivery: maxRetries is larger than total number of attempts specified. Increasing last delayTime with 19 attempts
13/11/10 12:39:56 INFO James.Mailet: RemoteDelivery: Delay of 21600000 msecs is now attempted: 20 times
13/11/10 12:40:04 INFO James.Mailet: RemoteDelivery: Attempting delivery of Mail1289631302656-0-to-yahoo.co.in to host mx1.mail.in.yahoo.com. at 180.222.96.138 for addresses [abhilash#yahoo.co.in]
13/11/10 12:40:04 INFO James.Mailet: RemoteDelivery: Could not connect to SMTP host: 180.222.96.138, port: 25, response: 553
13/11/10 12:40:04 INFO James.Mailet: RemoteDelivery: Temporary exception delivering mail (Mail1289631302656-0-to-yahoo.co.in:
13/11/10 12:40:04 INFO James.Mailet: RemoteDelivery: Storing message Mail1289631302656-0-to-yahoo.co.in into outgoing after 0 retries
As per the FAQs most probably I have some problem configuring my DNS server. So what I should set my DNS server to - my system's internal IP, my router's IP, my public IP. I'm confused. Any suggestions kindly share.
In the startguide of JAMES it is said:
Determine the DNS server to use. On Windows, type ipconfig /all and look for the DNS servers. On Unix, look at /etc/resolv.conf. You will need this information in step #9.
https://wiki.apache.org/james/JamesQuickstart