The mail, Mail and mailx command line utilities

learn more… | top users | synonyms

0
votes
0answers
10 views

Invalid mail alert

When I log in to Unix, I get new mail alert: [YOU HAVE NEW MAIL] I checked my mail and I don't have any: $ mail Mail [5.2 UCB] [AIX 5.X] Type ? for help. "/var/spool/mail/userId": 0 messages No ...
0
votes
1answer
36 views

How to save mails in Unix? [closed]

I wanted to save mail in unix in some directory, as we do in outlook (files are saved with .msg extensions). Is there any workaround for doing this.
2
votes
3answers
62 views

Standard and portable way to send email from console?

What is the most portable or standard way to send an email from the console or a script on Linux, and possibly Unix?
1
vote
1answer
44 views

Email file attachment from command line

I want to email the file returned by the following command as an attachment (on RHEL/CentOS): ls -1 $(hostname -s)*.xml | tail -n 1 For example, the command above returns server-20140430080511.xml ...
5
votes
3answers
90 views

How to grab the oldest unread message from `mail` in a script?

In a script I am trying to finish writing now, I need to get the oldest unread message from the current user's mailbox (specifically, I need the subject line for this project). After extracting the ...
2
votes
1answer
56 views

Block local (unix) users from sending mail

Is there a way to block a local/unix user (or a list of local users) from sending mails via mail command (or maybe even in postfix, which is the MTA I have).
2
votes
1answer
117 views

How do postfix and mailx interact with mbox locking?

If postfix is setup as the MTA using its virtual transport to deliver mail to a local mbox file (and handling delivery of outgoing messages), and mailx is the MUA, being used on that same computer for ...
4
votes
3answers
370 views

RHEL - Uuencode + mailx = gibberish

I understand uuencode is for encoding files, and mailx sends mail. However, I'm not exactly understanding... Why uuencode file file | mailx -s "subject" email_adress keeps sending messages with the ...
2
votes
2answers
510 views

Mail command to send attachements

I tried the below command uuencode data.txt | mailx –s “Test Mail” “mrp@xyz.com” But I get the below error ksh: uuencode: not found. Null Message body; hope that' ok which clearly tell that ...
1
vote
1answer
182 views

Maildir and mailutils?

I want to use the mailutils app on a install of Ubuntu 12.04.3 LTS with a Maildir format, but every time I run the mail command, the system looks in /var/mail/user, instead of the Maildir directory in ...
2
votes
2answers
157 views

Where do uncaught local emails go?

Suppose I run - mail goldfish There is no such account on the system and no such aliases defined, where would the mail go? How do I see a list of such mails?
0
votes
0answers
398 views

How to set up smtp and send emails?

I'm new to raspberry pi. I installed the raspian OS on it. I want to send emails from it using my gmail account. I want to send from the command line interface and from php scripts. I followed this ...
0
votes
1answer
24 views

Weird logging behavior in Berkeley mail on a Mac

I use Berkeley mail (/usr/bin/mail) on an iMac. It has just started behaving in strange ways. If I type "~v", to open an editor, I get "[LogLevel VERBOSE]" or sometimes "[LogLevel DEBUG]" and the ...
1
vote
1answer
290 views

How do I track down the source of a ssh login message?

I installed mailutils on my linux machine with Linux Mint 15 (basically Ubuntu 13.04). When I log in, I get the following: Welcome to Linux Mint 15 Olivia (GNU/Linux 3.8.0-32-generic i686) Welcome ...
5
votes
1answer
442 views

How can I bcc with mailx?

I'm trying to send unix mail (heirloom-mailx) via bcc. $ mail -V 12.5 6/20/10 My MTA is exim, which sends via Gmail SMTP. I can execute the following: echo -e "body" | mail -s 'subject' -b ...
3
votes
2answers
498 views

Does the mail command require a mail server?

Does one need to set up a mail server before being able to use the linux mail command?
2
votes
1answer
469 views

mail doesn't work [duplicate]

I'm new to GNU/Linux and I want to send e-mail to other users on my computer (specifically from root to david). I've searched on google and I have tried the following: # mail david Subject: ...
3
votes
1answer
254 views

How can I set an e-mail's headers using /usr/bin/mail?

I have a bunch of scripts on an IBM AIX server's crontab that call the mail command to send myself an e-mail, kinda like this: $ mail -r myon@hakugyokuro.gk -s "Results for `hostname`" ...
3
votes
3answers
305 views

How can I connect mail(1) to my Gmail/Yahoo/Hotmail account?

I would like to use the mail command in a shell script to automatically connect to my Gmail/Yahoo/Hotmail account and send/receive messages. How can I do this?
1
vote
2answers
601 views

set up local mail delivery to user from cron script

A line in my cron.daily script not work as expected. I haven't any special smtp mail server in system, this line rsync -avun --inplace /oneuser/file.xls /otheruser/file.xls| mail -s "$0 $?" ...
1
vote
1answer
436 views

Sending Emails from bash script in Solaris VM

I am trying to send emails using the following bash script: /bin/mail -s "#subject" "$emailto" < "$message" It works fine on my local machine but does not work on my VM. I looked it up and read ...
4
votes
3answers
4k views

How to delete a range of mails in Solaris using the 'mail' command?

I have some 1k+ mails in an inbox (old cronjob stdout), how to delete them in bulk? I'm on Solaris 8 and I have only mail available, no pine or mutt or similar "UI"-based client. Inline help and ...
3
votes
1answer
2k views

Shell script hangs on mail command

I'm finding that a call to the mail command is causing a script to suspend without error. To close the script I have to ctrl-c or issue a kill command on the process id. The pertinent section of ...
3
votes
2answers
379 views

Can not use mail command

error like this: [user1@fedora ~]$ mail No mail for user1 but that is appear Maildir(mailbox) in /home/user1.
3
votes
3answers
5k views

Setting headers using the /bin/mail command

I have a bash script that I use with nagios that sends notifications by email. The key part of it looks like this: # $1 (FROM) | $2 (TO) | $3 (SUBJECT) | $4 (BODY) /usr/bin/printf "%b" "$4" | ...
25
votes
3answers
24k views

How can I use the “mail” command?

I am not great at using the mail command on Linux. How can I get better? I don't even know what program this is. Is it pine? I doubt it. It is in /usr/bin/mail and when I start it is tells me that it ...
3
votes
2answers
2k views

Mail vs. mail what is the difference

what is this business about mail and Mail? [On a centos box] Why mail does not work but wont return an error either while Mail works fine with the exact same syntax? Mail is basically a link to mail ...
1
vote
1answer
174 views

Why doesn't the list command work in mail?

Why doesn't the list command work in mail? When I try l or list, it doesn't work. It instead gives me a list of the valid commands, including list. Commands are: next, alias, print, type, Type, ...
27
votes
4answers
39k views

How do I send HTML email using linux 'mail' command?

mail -s "subject" xxxxx@gmail.com <test.html works, but only for plain text email. What is the correct way to send HTML email using the Linux command mail?