Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2222
  • Last Modified:

Cannot send email using Sendmail in Linux Mint

Hi Experts,

I am having trouble sending mail using sendmail on my Linux Mint VM.
The configuration needs to be extremely simple as I only need to send email from this one machine.

My sendmail.mc has been configured to use my ISP's smtp server 'mail.bigpond.com'.

I have connected to the server via telnet and confirmed that I can compose and send an email.

I have connected to my localhost via telnet and confirmed that I can also send an email from there.

My problem is that I can't send mail via the command line to test my sendmail settings, using
cat mail.txt | sendmail myemailaddress@domain.com

Open in new window

(you will see the proper email address in the logs).  I have also tried various other commands to try and send mail.

Here is the entry from the logs from my last attempt to send:

Mar 19 10:36:50 csg5116 sendmail[5411]: My unqualified host name (csg5116) unknown; sleeping for retry
Mar 19 10:37:50 csg5116 sendmail[5411]: unable to qualify my own domain name (csg5116) -- using short name
Mar 19 10:37:51 csg5116 sendmail[5411]: s2J2bp0F005411: from=cmoncada, size=114, class=0, nrcpts=1, msgid=<201403190237.s2J2bp0F005411@csg5116>, relay=cmoncada@localhost
Mar 19 10:37:51 csg5116 sm-mta[5413]: s2J2bpBc005413: from=<cmoncada@csg5116>, size=357, class=0, nrcpts=1, msgid=<201403190237.s2J2bp0F005411@csg5116>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Mar 19 10:37:51 csg5116 sendmail[5411]: s2J2bp0F005411: to=carlos.moncada@iinet.net.au, ctladdr=cmoncada (1000/1000), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30114, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (s2J2bpBc005413 Message accepted for delivery)
Mar 19 10:37:51 csg5116 sm-mta[5415]: s2J2bpBc005413: to=<carlos.moncada@iinet.net.au>, ctladdr=<cmoncada@csg5116> (1000/1000), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=120357, relay=mail.bigpond.com. [61.9.168.249], dsn=5.0.0, stat=Service unavailable
Mar 19 10:37:51 csg5116 sm-mta[5415]: s2J2bpBc005413: s2J2bpBc005415: DSN: Service unavailable
Mar 19 10:37:51 csg5116 sm-mta[5415]: s2J2bpBc005415: to=<cmoncada@csg5116>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30000, dsn=2.0.0, stat=Sent

Open in new window


I have also copied my sendmail.mc file.
Thanks in advance!

divert(-1)dnl
#-----------------------------------------------------------------------------
# $Sendmail: debproto.mc,v 8.14.4 2013-09-11 02:54:29 cowboy Exp $
#
# Copyright (c) 1998-2010 Richard Nelson.  All Rights Reserved.
#
# cf/debian/sendmail.mc.  Generated from sendmail.mc.in by configure.
#
# sendmail.mc prototype config file for building Sendmail 8.14.4
#
# Note: the .in file supports 8.7.6 - 9.0.0, but the generated
#	file is customized to the version noted above.
#
# This file is used to configure Sendmail for use with Debian systems.
#
# If you modify this file, you will have to regenerate /etc/mail/sendmail.cf
# by running this file through the m4 preprocessor via one of the following:
#	* make   (or make -C /etc/mail)
#	* sendmailconfig 
#	* m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
# The first two options are preferred as they will also update other files
# that depend upon the contents of this file.
#
# The best documentation for this .mc file is:
# /usr/share/doc/sendmail-doc/cf.README.gz
#
#-----------------------------------------------------------------------------
divert(0)dnl
#
#   Copyright (c) 1998-2005 Richard Nelson.  All Rights Reserved.
#
#  This file is used to configure Sendmail for use with Debian systems.
#
define(`_USE_ETC_MAIL_')dnl
include(`/usr/share/sendmail/cf/m4/cf.m4')dnl
VERSIONID(`$Id: sendmail.mc, v 8.14.4-2.1ubuntu4 2013-09-11 02:54:29 cowboy Exp $')
OSTYPE(`debian')dnl
DOMAIN(`debian-mta')dnl
dnl # Items controlled by /etc/mail/sendmail.conf - DO NOT TOUCH HERE
undefine(`confHOST_STATUS_DIRECTORY')dnl        #DAEMON_HOSTSTATS=
dnl # Items controlled by /etc/mail/sendmail.conf - DO NOT TOUCH HERE
dnl #
dnl # General defines
dnl #
dnl # SAFE_FILE_ENV: [undefined] If set, sendmail will do a chroot()
dnl #	into this directory before writing files.
dnl #	If *all* your user accounts are under /home then use that
dnl #	instead - it will prevent any writes outside of /home !
dnl #   define(`confSAFE_FILE_ENV',             `')dnl
dnl #
dnl # Daemon options - restrict to servicing LOCALHOST ONLY !!!
dnl # Remove `, Addr=' clauses to receive from any interface
dnl # If you want to support IPv6, switch the commented/uncommentd lines
dnl #
FEATURE(`no_default_msa')dnl
dnl DAEMON_OPTIONS(`Family=inet6, Name=MTA-v6, Port=smtp, Addr=::1')dnl
DAEMON_OPTIONS(`Family=inet,  Name=MTA-v4, Port=smtp, Addr=0.0.0.0')dnl
dnl DAEMON_OPTIONS(`Family=inet6, Name=MSP-v6, Port=submission, M=Ea, Addr=::1')dnl
DAEMON_OPTIONS(`Family=inet,  Name=MSP-v4, Port=submission, M=Ea, Addr=0.0.0.0')dnl
dnl #
dnl # Be somewhat anal in what we allow
define(`confPRIVACY_FLAGS',dnl
`needmailhelo,needexpnhelo,needvrfyhelo,restrictqrun,restrictexpand,nobodyreturn,authwarnings')dnl
dnl #
dnl # Define connection throttling and window length
define(`confCONNECTION_RATE_THROTTLE', `15')dnl
define(`confCONNECTION_RATE_WINDOW_SIZE',`10m')dnl
dnl #
dnl # Features
dnl #
dnl # use /etc/mail/local-host-names
FEATURE(`use_cw_file')dnl
dnl #
dnl # The access db is the basis for most of sendmail's checking
FEATURE(`access_db', , `skip')dnl
dnl #
dnl # The greet_pause feature stops some automail bots - but check the
dnl # provided access db for details on excluding localhosts...
FEATURE(`greet_pause', `1000')dnl 1 seconds
dnl #
dnl # Delay_checks allows sender<->recipient checking
FEATURE(`delay_checks', `friend', `n')dnl
dnl #
dnl # If we get too many bad recipients, slow things down...
define(`confBAD_RCPT_THROTTLE',`3')dnl
dnl #
dnl # Stop connections that overflow our concurrent and time connection rates
FEATURE(`conncontrol', `nodelay', `terminate')dnl
FEATURE(`ratecontrol', `nodelay', `terminate')dnl
dnl #
dnl # If you're on a dialup link, you should enable this - so sendmail
dnl # will not bring up the link (it will queue mail for later)
dnl define(`confCON_EXPENSIVE',`True')dnl
dnl #
dnl # Dialup/LAN connection overrides
dnl #
include(`/etc/mail/m4/dialup.m4')dnl
include(`/etc/mail/m4/provider.m4')dnl
dnl #
dnl # Default Mailer setup
MAILER_DEFINITIONS
define(`SMART_HOST', `mail.bigpond.com')dnl
MAILER(`local')dnl
MAILER(`smtp')dnl

Open in new window

0
madstylex
Asked:
madstylex
  • 8
  • 4
  • 4
  • +2
1 Solution
 
omarfaridCommented:
Do you see any mail queue on your system? run

mailq

OR

sendmail -bp

you could also use

cat mail.txt | mailx -d myemailaddress@domain.com

to get some debug info
0
 
omarfaridCommented:
Also, check if you get errors messages in your local mail box. Use mail or mailx to check mail box
0
 
madstylexAuthor Commented:
Hi Omar,

When I type mailq and sendmail -bp, I get a blank line.

When I try to debug, it gives me a blank line for a couple of minutes then goes back to the prompt.  There are no debug messages.

When I checked my local mailbox, there were 28 messages that had been returned.

I tried sending another and received the following output:

Return-Path: <MAILER-DAEMON>
Received: from csg5116 (localhost [127.0.0.1])
	by csg5116 (8.14.4/8.14.4/Debian-2.1ubuntu4) with ESMTP id s2FHIfJU005244
	for <cmoncada@csg5116>; Sun, 16 Mar 2014 01:18:41 +0800
Received: from localhost (localhost)
	by csg5116 (8.14.4/8.14.4/Submit) id s2FHIfJR005234;
	Sun, 16 Mar 2014 01:18:41 +0800
Date: Sun, 16 Mar 2014 01:18:41 +0800
From: Mail Delivery Subsystem <MAILER-DAEMON@csg5116>
Message-Id: <201403151718.s2FHIfJR005234@csg5116>
To: cmoncada@csg5116
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
	boundary="s2FHIfJR005234.1394903921/csg5116"
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)

This is a MIME-encapsulated message

--s2FHIfJR005234.1394903921/csg5116

The original message was received at Sun, 16 Mar 2014 01:18:41 +0800
from cmoncada@localhost

   ----- The following addresses had permanent fatal errors -----
Subject:

   ----- Transcript of session follows -----
553 5.1.3 carlos.moncada@iinet.net.auFrom:... List:; syntax illegal for recipient addresses
553 5.1.3 Subject:... List:; syntax illegal for recipient addresses

--s2FHIfJR005234.1394903921/csg5116
Content-Type: message/delivery-status

Reporting-MTA: dns; csg5116
Arrival-Date: Sun, 16 Mar 2014 01:18:41 +0800

Final-Recipient: RFC822; "553 List:; syntax illegal for recipient addresses"@csg5116
X-Actual-Recipient: rfc822; "553 List:; syntax illegal for recipient addresses"@csg5116
Action: failed
Status: 5.1.3
Last-Attempt-Date: Sun, 16 Mar 2014 01:18:41 +0800

--s2FHIfJR005234.1394903921/csg5116
Content-Type: message/rfc822

Return-Path: <cmoncada>
Received: (from cmoncada@localhost)
	by csg5116 (8.14.4/8.14.4/Submit) id s2FHIfJQ005234;
	Sun, 16 Mar 2014 01:18:41 +0800
Date: Sun, 16 Mar 2014 01:18:41 +0800
From: Carlos Moncada <cmoncada>
Message-Id: <201403151718.s2FHIfJQ005234@csg5116>
To: "carlos.moncada@iinet.net.auFrom":, carlos.moncada@iinet.net.au, Subject:,
        the, daily, reporttest


--s2FHIfJR005234.1394903921/csg5116--

Open in new window

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
madstylexAuthor Commented:
Very strange,

looks like the dates are off, even though my system time is correct
0
 
Puspharaj SelvarajSr.System engineerCommented:
Did you configured the SSL, or similar auth to be specified in sendmail, otherwise gmail like system will reject the emails from originating servers.

Final-Recipient: RFC822; "553 List:; syntax illegal for recipient addresses"@csg5116
X-Actual-Recipient: rfc822; "553 List:; syntax illegal for recipient addresses"@csg5116
Action: failed
Status: 5.1.3
Last-Attempt-Date: Sun, 16 Mar 2014 01:18:41 +0800
0
 
madstylexAuthor Commented:
I am using my ISP's smtp server from my ISP's connection and was able to send successfully using telnet with no authentication.
0
 
Dan CraciunIT ConsultantCommented:
You might want to look at the actual error: 553 List:; syntax illegal for recipient addresses"@csg5116

Looks like you tried to send an email to "carlos.moncada@iinet.net.auFrom", which does not appear to be a valid email address.

HTH,
Dan
0
 
madstylexAuthor Commented:
Hi Dan,

I did see that.  That is my account on the host machine.

I am not sure why that is popping up though as I am trying to send to and from a valid email address.

Will look into it further...
0
 
Dan CraciunIT ConsultantCommented:
Look at this:
To: "carlos.moncada@iinet.net.auFrom":, carlos.moncada@iinet.net.au, Subject:,
        the, daily, reporttest

It does look like a malformed To field to me. It should be:

To: "carlos.moncada@iinet.net.au" carlos.moncada@iinet.net.au
Subject: the, daily, reporttest
0
 
IMGIDCCommented:
Hi madstylex,

do you have smart host configuration in you sendmail.cf file !!!
if not add following line in /etc/mail/sendmail.cf file

(under line 115 )
DSmailserver.isp.com

restart the sendmail service and check.
0
 
omarfaridCommented:
I think you need to have a proper username@domain for your message to be accepted by other end.

Try to look at your host machine how it is configured (look at the domain name part). You may look into:

/etc/hostname

or

/etc/hosts

or

/etc/resolv.conf
0
 
madstylexAuthor Commented:
Dan,

My apologies I posted the wrong headers.  I made a brand new attempt using the command cat mail.txt | sendmail carlos.moncada@iinet.net.au and got the following:

Return-Path: <MAILER-DAEMON>
Received: from localhost (localhost)
by csg5116 (8.14.4/8.14.4/Debian-2.1ubuntu4) id s2J6TfGn007197;
Wed, 19 Mar 2014 14:29:41 +0800
Date: Wed, 19 Mar 2014 14:29:41 +0800
From: Mail Delivery Subsystem <MAILER-DAEMON>
Message-Id: <201403190629.s2J6TfGn007197@csg5116>
To: <cmoncada@csg5116>
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
boundary="s2J6TfGn007197.1395210581/csg5116"
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)
Status: O
X-UID: 29

This is a MIME-encapsulated message

--s2J6TfGn007197.1395210581/csg5116

The original message was received at Wed, 19 Mar 2014 14:29:41 +0800
from localhost [127.0.0.1]

----- The following addresses had permanent fatal errors -----
<carlos.moncada@iinet.net.au>
(reason: 550 5.1.0 <cmoncada@csg5116> sender rejected OB505a)

----- Transcript of session follows -----
... while talking to mail.bigpond.com.:
>>> MAIL From:<cmoncada@csg5116> SIZE=583 AUTH=<>
<<< 550 5.1.0 <cmoncada@csg5116> sender rejected OB505a
554 5.0.0 Service unavailable

--s2J6TfGn007197.1395210581/csg5116
Content-Type: message/delivery-status

Reporting-MTA: dns; csg5116
Received-From-MTA: DNS; localhost
Arrival-Date: Wed, 19 Mar 2014 14:29:41 +0800

Final-Recipient: RFC822; carlos.moncada@iinet.net.au
Action: failed
Status: 5.1.0
Diagnostic-Code: SMTP; 550 5.1.0 <cmoncada@csg5116> sender rejected OB505a
Last-Attempt-Date: Wed, 19 Mar 2014 14:29:41 +0800

--s2J6TfGn007197.1395210581/csg5116
Content-Type: text/rfc822-headers

Return-Path: <cmoncada@csg5116>
Received: from csg5116 (localhost [127.0.0.1])
by csg5116 (8.14.4/8.14.4/Debian-2.1ubuntu4) with ESMTP id s2J6TfGn007195
for <carlos.moncada@iinet.net.au>; Wed, 19 Mar 2014 14:29:41 +0800
Received: (from cmoncada@localhost)
by csg5116 (8.14.4/8.14.4/Submit) id s2J6TeH0007193
for carlos.moncada@iinet.net.au; Wed, 19 Mar 2014 14:29:40 +0800
Date: Wed, 19 Mar 2014 14:29:40 +0800
Message-Id: <201403190629.s2J6TeH0007193@csg5116>
To: carlos.moncada@iinet.net
From: carlos.moncada@iinet.net.au
Subject: sending from the mail file

Open in new window


It looks like it is trying to use my hostname to send...
0
 
Dan CraciunIT ConsultantCommented:
Yup. It's sending as cmoncada@csg5116 and your external SMTP server is rejecting it.
0
 
omarfaridCommented:
Can you try sending to a different user say on hotmail, etc. and see if you get same issue?

Did you try to check the domain config on your system?

You may try other mail clients like pine if you have on your system:

http://www.math.sc.edu/system/man/pine.html
0
 
madstylexAuthor Commented:
Dan,

Any idea how to change that?
0
 
Dan CraciunIT ConsultantCommented:
You'll need to talk to BigPond, or give your station a qualified name, something like csg5116.local (so the request comes from cmoncada@csg5116.local) and see if the external SMTP accepts that.
0
 
madstylexAuthor Commented:
I have given up trying to use sendmail and used msmtp.

After configuration it worked without any issues.
0
 
madstylexAuthor Commented:
I had to use a different program to complete my task
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 8
  • 4
  • 4
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now