The mail, Mail and mailx command line utilities

learn more… | top users | synonyms

1
vote
1answer
57 views

How does the mail command work?

I am curious as to how the mail command works. My computer has postfix server installed by default with red hat and is connected to a network that includes a mail server. I had assumed that when I ...
1
vote
0answers
21 views

BSD Mail - Single Sending Address

I've been working on sending HTML emails using BSD mail and so far I've been successful. I've even been able to modify, not change though, the sender. Current Command: cat $htmlFile | mail -s ...
0
votes
1answer
38 views

When does Linux send a root mail and how to force it for testing purposes?

Let's say I want to test root mail functionality after I set up nullmailer, how do I force my Debian Linux system to send a root mail? And furthermore on which events does Linux send root mails at ...
1
vote
2answers
54 views

Need to delete mails for a range of dates in Linux

I have 1 million mails generated in a Linux sever due to a cron job. I want to delete the mails, but not all as this cron mails useful to troubleshoot and find out the issue with cron job's execution. ...
1
vote
1answer
32 views

sending emails with heirloom, even when Postfix is not running locally

Normally, I can send email from commandline, such as echo hello | mail -s "subject" user@example.com I have noticed that even when Postfix is not running on my machine, I can still "send" emails. ...
0
votes
0answers
23 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
48 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
96 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
64 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
109 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
162 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
277 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
1k 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
1k 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
400 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
213 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
663 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
27 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
487 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
733 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
906 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
636 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: ...
4
votes
1answer
356 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
385 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?
2
votes
3answers
982 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
519 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 ...
5
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
3k 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
455 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.
4
votes
3answers
6k 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" | ...
32
votes
3answers
29k 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
186 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, ...
34
votes
6answers
45k 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?