can not receive email using mailx command

Issues related to applications and software problems
Post Reply
goudeuk
Posts: 32
Joined: 2013/09/02 11:46:50
Location: London

can not receive email using mailx command

Post by goudeuk » 2017/08/24 14:41:09

Hello

I have been trying to send an email using mailx from a centos7 machine with no luck.

The command I'm using is:

Code: Select all

echo "what's up" | mailx -S  smtps=outlook.office365.com:587 -s from="username1@.co.uk" -v username2@.co.uk
It outputs:

Code: Select all

username2@.co.uk... Connecting to [127.0.0.1] via relay...
220 clinux1.co.uk ESMTP Sendmail 8.14.7/8.14.7; Thu, 24 Aug 2017 15:33:54 +0100
>>> EHLO clinux1.co.uk
250-clinux1.co.uk Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH DIGEST-MD5 CRAM-MD5
250-DELIVERBY
250 HELP
>>> MAIL From:<root@clinux1.co.uk> SIZE=235 AUTH=root@clinux1.co.uk
250 2.1.0 <root@clinux1.co.uk>... Sender ok
>>> RCPT To:<username2@.co.uk>
>>> DATA
250 2.1.5 <username2@.co.uk>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 v7OEXsWA002179 Message accepted for delivery
username2@.co.uk... Sent (v7OEXsWA002179 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 clinux1.co.uk closing connection
Can someone help me please? Is this the right way of doing this?

Thank you

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: can not receive email using mailx command

Post by TrevorH » 2017/08/24 15:02:00

Your mail was accepted by your local mailserver on 127.0.0.1. Now you need to read the logs for it and discover what it did with it afterwards.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

goudeuk
Posts: 32
Joined: 2013/09/02 11:46:50
Location: London

Re: can not receive email using mailx command

Post by goudeuk » 2017/08/24 15:38:30

Hello Trevor

Thanks for your reply.

I can see in the logs:

Code: Select all

Aug 24 16:35:20 clinux1 sendmail[3234]: v7OFZJNG003232: to=<username2@co.uk>, ctladdr=<root@clinux1.co.uk> (0/0), delay=00:00:01, xdelay=00:00:00, mailer=esmtp, pri=120518, relay=co.uk.mail.protection.outlook.com. [213.199.154.170], dsn=4.0.0, stat=Deferred: Connection refused by co.mail.protection.outlook.com.
Would that be a firewall issue?

Thank you

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: can not receive email using mailx command

Post by TrevorH » 2017/08/24 16:56:22

Since this is outlook I'd guess you're hitting their anti-SPAM protections which, among many other things, refuse mail from residential ip addresses. There's nothing you can do about that except use your ISP's mail relay which will accept your mail is unlikely (hopefully) to be blacklisted.

That's only a guess since I don't see your ip address in the thread to check but if you google "rbl checker" and use one of those to look up your own ip, it should tell you if you're blacklisted (and almost all residential ip's are).
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

goudeuk
Posts: 32
Joined: 2013/09/02 11:46:50
Location: London

Re: can not receive email using mailx command

Post by goudeuk » 2017/08/25 08:07:11

Hello

The IP I'm trying to send the email from is 128.40.46.141.
I checked it against this rbl checkers you suggested and the result is "Not listed".

:?:

I will dig in a bit more in the logs, hopefully I will spot something else.

Thank you

Post Reply