Visit Our UNIX and Linux User Community


Mail command not working for Long Email Address with Dashes

 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Mail command not working for Long Email Address with Dashes
# 1  
Old 11-13-2016
Linux Mail command not working for Long Email Address with Dashes

My company has an email user group email address name that has 35 characters in front of the @ symbol where two of them are dashes. For some reason the mail command fails to send email to this address when I invoke it from the Linux command line. I don't understand the reason for the failure. Below is an example of what does not work and what works.

This does not work
Code:
echo "Test Email from Linux Server" | mail -s "Linux Test Email"   AA-BBBB-YadayaAdministrativeSystems@company.com

This works.
Code:
 
 echo "Test Email from Linux Server" | mail -s "Linux Test Email"  joe.sixpack@company.com

Moderator's Comments:
Mod Comment Please use CODE tags (not ICODE tags) for full line and multi-line sample input, sample output, and code segments.

Last edited by Don Cragun; 11-13-2016 at 06:25 PM.. Reason: Change ICODE tags to CODE tags.
# 2  
Old 11-13-2016
RFC 5322 and RFC 5321 indicate that you can have 64 characters to left of "@".
So that is not your problem.

Unless you turned of logging, you should be able to see several sendmail entries for each email you sent - assuming your box is the one actively sending mail - in the /var/log/syslog file

I would check to be sure the address is not munged some by locale settings for example.
# 3  
Old 11-13-2016
Any error messages? Entry in the system- / mail log file?
# 4  
Old 11-13-2016
I'm not authorized to see the maillog file so I don't know if there are any errors in it. However, I have put in an incident with our in-house Linux admin and I have asked him to look at it. I also ran the mail command in Verbose mode (-v switch) but the Mail Delivery Report looked good to me. Is it possible that the operating system percieves the dashes in the email address as an attempt to use a metacharacter instead of a character that is part of the actual email address?
# 5  
Old 11-13-2016
Probably not. Most email failures from well-formed addresses are the result of forwarding errors and such like. For example the receiving sendmail could have an IP block or some other issue. For completely wrong addresses, no such address kinds of things, should result in an error message emailed to the sender at some later point in time.
# 6  
Old 11-14-2016
Difficult to say without seeing the logs, but I doubt it's the address (unless its legitimately wrong). Lots of things beyond your control happen when you send an email, as well - routing, spam filtering, mailbox sorting, and more. The problem might not even be on your machine but another hop further away.

Previous Thread | Next Thread
Test Your Knowledge in Computers #289
Difficulty: Easy
Sun Microsystems was acquired by Oracle Corporation in 2012.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to change the sender's name or E-mail address in mutt command

Can any one help me in this ??? How to change sender's name or email address in Mutt command??? (4 Replies)
Discussion started by: sarathi
4 Replies

2. BSD

mail command is not working

Hi, Mail command is not working. mail -s "hello" abc@google.com < samplefile I am new to BSD.what do i need to do? Please help. Thnaks, Gita. Please use code tags next time for your code and data. (2 Replies)
Discussion started by: gita
2 Replies

3. Shell Programming and Scripting

Script to Send an email using mail command

Hello all I'm trying to write a script to send an email, so I can be nnotified when something is going wrong with my system. I've tried many options with no luck: mail -s "You've got mail" somebody@example.com echo "Mail Body" | mail -s "Subject" somebody@example.com I tried also to... (1 Reply)
Discussion started by: samer.odeh
1 Replies

4. Red Hat

How to change sender email address in mail -s command

Just having trouble trying to figure out what the option is. When I do mail -s "Subject" someuser@example.com I can't seem to specify "from" or "sender" option as I need it for my task. I tried using --f or -f though it didn't work. Can someone please tell me what other option... (0 Replies)
Discussion started by: rockf1bull
0 Replies

5. Shell Programming and Scripting

UNIX Script to query Active Directory: give cn (NT login name) and receive mail (Email address)

Hi folks I need to write UNIX script (with ldapsearch) to query Active Directory. Input is NT login name and output is Email address. Attached a screenshot of Sysinternals "AD Explorer". I need to do the same in CLI. http://i.imgur.com/4s6FB.png I am absolute LDAP/ldapsearch noob. (0 Replies)
Discussion started by: slashdotweenie
0 Replies

6. UNIX for Dummies Questions & Answers

[SOLVED] Command line mail taking too long to send; unable to qualify my own domain name

Hello, I'm having a problem with my mail. When I send mail, it takes a long time for the send to complete. In the below, datestamp is just a simple script to put in a no-white-space date/time stamp. $ datestamp ; mail woodnt; datestamp 02-05-10@193844 Subject: test timer Cc: ... (0 Replies)
Discussion started by: Narnie
0 Replies

7. UNIX for Dummies Questions & Answers

mail command not working

Hi I am trying to runmail command to send some text to my email id. But its getting hanged up. Not sure what is the problem. Please help. mail -s "testing" abc@somearess.com Thanks (1 Reply)
Discussion started by: infyanurag
1 Replies

8. UNIX for Dummies Questions & Answers

How to verify email address using mailx command ?

Is there any way i can verify the email address (before sending the mail) using the mailx command ? I know that sendmail -bv email@address.com can do it but there is a compatibility issues with the version of Unix we have. So mailx is the only command we can used at this point. Any... (1 Reply)
Discussion started by: rak007
1 Replies

9. Shell Programming and Scripting

how to know if the mailx command really sends the mail to the email address?

Hi guys, I have a question about the returning message of the mailx command. if I run a mailx command, how can I know if the email has been sent to the email address? If the email address doesn't exist, is there any error message returned? If yes, how can I get the error message? Thanks... (3 Replies)
Discussion started by: sheenshine
3 Replies

10. Shell Programming and Scripting

mail command not working

hi all I am not able to send mail from unix box to my mail id. do i need to do any settings for that? when i issue this command:- mail -s "letter" <abc.txt the $ pompt goes away and the unix is on wait state. what should I do? (3 Replies)
Discussion started by: infyanurag
3 Replies

Featured Tech Videos