Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Not able to send mail on my company's account but gmail in Linux 6.8 Post 302993250 by drysdalk on Wednesday 8th of March 2017 03:03:02 AM
Old 03-08-2017
Hi,

I was more meaning which server was generating the error telling you the address did not exist ? You would indeed see the error in /var/log/maillog, but that file will contain everything your local MTA (Sendmail, Postfix, etc) wants to log. What's important for debugging SMTP issues firstly is knowing where the problem is.

In any case, I think it's probably safe to assume that the error you're getting means what it says it does - that root@ is not a valid e-mail address. So, returning to my other question. What is the exact command you are using, in full, to send the mail ? If we can see a full and complete excerpt of the code you are using, we can then advise what might be going wrong.

But in general, you are going to want to set the From: address for any mail you ever send to be valid, if the mail is ever going to be leaving the server on which it is created at any rate.

Now, the behaviour of the mail command is highly version and OS-specific, but on my local machine (running Ubuntu 16.04 LTS x86_64) the following syntax works for me to set a valid From: address. Note that I have removed or changed some of the e-mail headers from the output for privacy reasons, so you will see more headers than just these ones (or you should).

Code:
$ mail -s "This is a test" -a "From: example@test.com" unixforum@localhost
Cc:
This is a test.  We should see the From: address is set to a valid SMTP address, and not my local UNIX username.
$ mail
"/var/mail/unixforum": 1 message 1 new
>N   1 example@test.com   Wed Mar  8 07:59  16/820   This is a test
? 1
Return-Path: <example@test.com>
Date: Wed, 8 Mar 2017 07:58:59 GMT
Subject: This is a test
From: example@test.com
To: <unixforum@localhost>
X-Mailer: mail (GNU Mailutils 2.99.99)

This is a test.  We should see the From: address is set to a valid SMTP address, and not my local UNIX username.
? d 1
? q
Held 0 messages in /var/mail/unixforum
$

Normally you'd want a From: header to look more like From: An Example <test@example.com>, but this is just a quick example to demonstrate the principle.

Hope this helps.
 

6 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

can not send mail from unix server to company/yahoo mail

hi, Gurus, I need some help with sending mail out from my UNIX server: It is running Solaris 2.6 and the sendmail version is 8.8. Output of :/usr/lib/sendmail -d0.1 -bt < /dev/null Version 8.8.8+Sun Compiled with: LOG MATCHGECOS MIME7TO8 MIME8TO7 NAMED_BIND NDBM NETINET ... (5 Replies)
Discussion started by: b5fnpct
5 Replies

2. UNIX for Dummies Questions & Answers

using mailx to send a log file to my outlook e-mail account

I like to use mailx -s to send an entire xxxxx.log to my outlook e-mail account. Any help will be appreciated. Thanks. (6 Replies)
Discussion started by: simt
6 Replies

3. Shell Programming and Scripting

Send mail from linux

Hi, Could any one get me suggested how to send a mail from a linux server to any external user? I tried the following : $ mail abc@xyz.com Subject: test Hi, This is a test mail. . Cc: def@xyz.com But I haven't recived any mail at abc@xyz.com and def@xyz.com Kindly help on... (2 Replies)
Discussion started by: yogi_4984
2 Replies

4. Red Hat

mail not working with company id

Hi, I have a fresh new installation of red hat linux. I am trying to send an email from the "mail" utility from inside my Linux box to my company id "xxx@company.com". We are using microsoft exchange server online version to host our company's email. I am able to send emails to gmail and... (2 Replies)
Discussion started by: priya33184
2 Replies

5. Red Hat

unable to send mail from redhat linux server

While sending mail from linux server we observed below logs, stat=Deferred: Name server: xxxxxxxxxx.: host name lookup failure Kindly suggest what we need to change? Thanks in Advance (2 Replies)
Discussion started by: hydoss1
2 Replies

6. Programming

How to send a file in e-mail from on Linux C++?

Hi ! I-m copile from source a C++ program from tutorials from internet. I don't understendig any programing languages.. but compiled aplication running ok. I-ts possible to add in my used program, lines to send one file from config directory in e-mail, to my e-mail adress ? I want to run... (2 Replies)
Discussion started by: kraftwerk
2 Replies
XMAIL(8)						      System Manager's Manual							  XMAIL(8)

NAME
XMail - Internet Mail Server SYNOPSIS
XMail [options] DESCRIPTION
XMail is an Internet and intranet mail server featuring an SMTP server, POP3 server, finger server, multiple domains, no need for users to have a real system account, SMTP relay checking, RBL/RSS/ORBS/DUL and custom ( IP based and address based ) spam protection, SMTP authenti- cation ( PLAIN LOGIN CRAM-MD5 POP3-before-SMTP and custom ), a POP3 account syncronizer with external POP3 accounts, account aliases, domain aliases, custom mail processing, direct mail files delivery, custom mail filters, mailing lists, remote administration, custom mail exchangers, logging, and multi-platform code. XMail sources compile under GNU/Linux, FreeBSD, Solaris and NT/2K. OPTIONS
Most of XMail configuration settings are command line tunables. Switches recognized by server: XMail core -Ms pathname Mail root path. -Md Activate debug (verbose) mode. -Mr hours Activate log rotation. -Mx split-level Set the queue split level. The value You set here is rounded to the lower prime number higher or equal than the value You've set. -MR bytes Set socket receive buffer size. -MS bytes Set socket send buffer size. POP3 Server -Pp port Set POP3 server port. -Pt timeout Set POP3 session timeout (seconds) after which the server will close the connection if not receive any commands. -Pl Enable POP3 logging. -Pw timeout Set the delay timeout in response to a bad POP3 login. Such time will be doubled at the next bad login. -Ph Hang the connection in bad login response. -PI ip[:port] Bind server to the specified ip address and optional port ( can be multiple ). -PX nthreads Set the maximum number of threads for POP3 server. SMTP Server -Sp port Set SMTP server port. -St timeout Set SMTP session timeout in seconds after which the server will close the connection if not receive any commands. -Sl timeout Enable SMTP logging. -SI ip[:port] Bind server to the specified ip address and optional port ( can be multiple ). -SX nthreads Set the maximum number of threads for SMTP server. -Sr maxrcpts Set the maximu number of recipients for a single SMTP message ( default 100 ). -Se nsecs Set the expire timeout for a POP3 authentication IP ( default 900 ). SMTP Queue Processing -Qn nthreads Set the number of mailer threads. -Qt timeout Set the timeout to be waited for a next try after send failure. Default 480. -Qi ratio Set the increment ratio of the reschedule time in sending a messages. At every failure in delivery a message, reschedule time T is incremented by ( T / ratio ), therefore T(i) = T(i-1) + T(i-1)/ratio. If You set this ratio to zero, T remain unchanged over delivery tentatives. Default 16. -Qr nretries Set the maximum number of times to try to send the message. Default 32. -Ql Enable SMAIL logging. POP3 Account synchronization -Yi interval Set external POP3 accounts sync interval. Default 120. -Yt nthreads Set the number of POP3 sync threads. Finger server -Fp port Set FINGER server port. -Fl Enable FINGER logging. -FI ip[:port] Bind server to the specified ip address and optional port ( can be multiple ). Remote administration server -Cp port Set CTRL server port. -Ct timeout Set CTRL session timeout after which the server will close the connection if not receive any commands. -Cl Enable CTRL logging. -CI ip[:port] Bind server to the specified ip address and optional port ( can be multiple ). -CX nthreads Set the maximum number of threads for CTRL server. Local mail processing -Ln nthreads Set the number of local mailer threads. -Lt timeout Set the sleep timeout for LMAIL threads. Default 2 sec. -Ll Enable local mail logging. ENVIRONMENT
MAIL_ROOT XMail root directory. MAIL_CMD_LINE Command line arguments. NOTES
If XMail catches signal SIGINT, it performs a clean shutdown. Shutdown operation may take some time. SEE ALSO
sendmail(1). AUTHOR
XMail program was written by Davide Libenzi <davidel@xmailserver.org>. This manual page was written by Radim Kolar <hsn@cybermail.net>, for the Debian GNU/Linux system (but may be used by others). March 12, 2002 XMAIL(8)
All times are GMT -4. The time now is 03:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy