Questions tagged [mail-command]
The mail, Mail and mailx command line utilities
112
questions
2
votes
1
answer
67
views
How can I make GNU mailutils to use an external SMTP server?
Does anybody on this planet know what the equivalent GNU mailutils command to the following looks like?
Is this even possible without a local MTA with mailutils?
Using s-nail it works as intended.
s-...
0
votes
0
answers
96
views
Cannot get shell script to send error message as mail body
I have a shell script I want to email me when a particular command fails and send along the error message. Either it doesn't send an email at all, or it sends an email with an attachment named ...
1
vote
1
answer
40
views
mail command sends body as attachment, unlike normal email client? How to stop this?
I am using the mail command from mailutils on Ubuntu Linux 20.04. I am using it to send documents automatically to a service on the web which processes them. They provide an email address to which you ...
0
votes
1
answer
65
views
'If' statement breaking his own rule or I'm doing so
Explanation:
I'm playing a little bit with a script this one helps notifying to user about SSL certificate expiration. If certificate has less than 30 days to expires, this will notify to user, if isn'...
0
votes
1
answer
19
views
Increasing the width of messages listing in mail prompt
How to increase the width of listings in mail command prompt? Especially the message listing with the command h.
The current listing is truncated at 80 characters as showing below:
$ mail
Mail [5.2 ...
0
votes
2
answers
1k
views
Configuring mail command to use msmtp
msmtp is successfully installed and works fine to send emails via an external SMTP server.
However the mail command fails to send emails using GNU Mailutils on a Debian 10.
for example
echo "Test&...
1
vote
0
answers
79
views
SMTP Server Mail Alerts using TLS and authentication
i am a bit new in using SMTP server Alert configurations on AIX 7.1 OS . i am currently using below syntax which is running fine :
mail -s "Subject" "abc@test.com" < /path/to/my/...
3
votes
2
answers
12k
views
How do I find current users mailbox through shell (command line)
I am using ssh to login to a remote linux box on a capture the flag site, to trying to learn linux fundamentals, and one of the questions asks "What is the path to the htb-student's mail?". ...
1
vote
1
answer
114
views
How do i set up local email delivery to send an email to my email address?
0 0 * * 6 /usr/sbin/chkrootkit 2>&1 | mail -s "chkrootkit Reports of my server" myemail@example.com
I already navigated to the /usr/sbin directory and ran chkrootkit using sudo. That ...
0
votes
1
answer
244
views
Configuring postfix in local machine in order to send mails
I am trying to automate a procedure and when a certain condition is met I would like to notify the user with an automated mail using the mail command.
The thing is, that the messages are not being ...
1
vote
1
answer
98
views
send mail manually by mail command
After installing mailutils on ubuntu 18.04
$sudo apt-get install mailutils
I try to send email manually on CLI
$mail -s test
To: myname@gmail.com
Cc:
then.... what should I do????
1
vote
0
answers
279
views
msmtp with iCloud account doesn't work
I'm very new to Linux (Raspbian at Raspberry Pi 4 Model B) and I just try to send an e-mail via command line. Right now, this is working with msmtp and a gmx.de account following this guide.
apt-get ...
0
votes
1
answer
4k
views
Mail command in linux
Want to send mail to my email id, but I'm not able to send. I have done
sudo apt install mailutils. Here is my code:
ssmtp name@gmail.com
Hello world
Showing error
ssmtp :cannot open mail 25
0
votes
1
answer
893
views
Can I prevent postfix from sending to specific email addresses using the check_recipient_access postfix option?
I tried to block some email addresses from spammers, but this setup doesn't seem to have any effect:
smtpd_recipient_restrictions =
check_recipient_access hash:/etc/postfix/bad_recipients,
...
0
votes
0
answers
112
views
How to move/rename user mbox file with mailutils?
Is there a way to change the ~/mbox file where mailutils's mail program saves read mail and where mail -f reads from to something else, like ~/.mbox for example? I read that setting the MBOX ...
0
votes
1
answer
80
views
How do I make .xls Or .pdf appear in body of email?
I know how to attach PDF or XLS file to email as an attachment using Unix commands. I would like to know how to send these reports to email body, so that users can access it quickly, instead of extra ...
1
vote
1
answer
343
views
Mail recipient name with accents
Context
$ echo $LANG
fr_FR.UTF-8
Problem
While it is possible to have accents in the sender name, mail seems to not accept them in recipient name:
mail -s "Test" -r "Denis Bitouzé <denis....
0
votes
1
answer
516
views
Why does mail create a dead.letter, but the mail still arrives
When I do this
% mail -s "test" me@icloud.com < mail-text
it takes a few seconds, then it comes back with this error message:
/home/zach/dead.letter... Saved message in /home/zach/dead.letter
...
1
vote
1
answer
79
views
Mailing an html file
Is it possible to mail an html file that looks exactly like the second image? I know mutt -e 'set content_type="text/html"' -s "Subject" user@email.com < test.html works but it ...
1
vote
1
answer
315
views
Override hostname for mail(1) in a shell script
I'm trying to quickly send some stuff to myself from my MacBook, but I'm having issues with my server rejecting the SMTP connection due to the unqualified domain name in the from field.
I've tried ...
1
vote
1
answer
553
views
How to use emojis on the subject line of mail?
I am writing a shell script to setup a few servers and once it is done, it will send an email to our help desk letting us know that the server is ready to be used.
I would like to use the following ...
2
votes
0
answers
161
views
mail command sends empty body if file attached
Whenever I attach a file to mail like:
$ mail -A attachment.pdf -s"Subject" id@domain.com
Cc:
This body never gets sent.
And hit Ctrl+d to send the mail. The attachment and the subject get sent, but ...
2
votes
0
answers
611
views
18.04.1-Ubuntu: Mail command unable to set mail body with attachment
I am trying to use mail command to send 2 attachments. The issue which i am facing is unable to send attachment and mail body content. tried following command
echo "Hello World" | mail -s 'Test Email'...
1
vote
0
answers
2k
views
How to monitor system with `snort` and send emails about `alerts`
PROBLEM:
I have been configuring snort on my systems and would like to get emails from the systems if there are any alerts.
What I have tried is swatch but I can't find much documentation on it, can ...
0
votes
1
answer
100
views
How do I pass a script argument to a pipelined argument?
I have the following code and I wanted the argument to -s to include the first argument of my bash script. Currently it prints "$1" verbatim for subject though the message body has $1 evaluated ...
2
votes
2
answers
1k
views
Create a script to check the date, time and string and trigger a mail
Need to create a script where
I want to take the last few lines of the log file and check that the last line with Start Date contains the date of today and the time 17:00:xx and is followed by xxxxx ...
0
votes
1
answer
551
views
Sending two text files with mail command - No -a support [duplicate]
I searched but did not find this answer. I am running an old RedHat 5.3 system on one server (working on upgrade to 7 in progress) but I want to send 2 text files using the mail command. I do this all ...
1
vote
1
answer
2k
views
-c and -b options not working in mailx in ubuntu
I was trying to send a mail from the shell script using the command
mailx -s "TEST MAIL" -c "user_name ..." user<message.txt
but it generates an error as unrecognized option -c ,the same happens ...
0
votes
0
answers
2k
views
usr/lib/sendmail doesn't work
On one of our company server, suddenly /usr/lib/sendmail stopped working.
We have a call to it in few scripts (owned and ran by oracle user) and none of them is able to send an email out, even ...
0
votes
1
answer
59
views
how to send lines/messages to maillog file [closed]
under /var/log , we can see the following maillog files
-rw------- 1 root root 11733421 Aug 5 03:47 maillog-20180805
-rw------- 1 root root 15566137 Aug 13 03:16 maillog-...
1
vote
0
answers
3k
views
how to read postfix mail from command line
I have setup postfix server and set home_mailbox = Mail/. How to make mail read mail from ~/Mail/. I tried ln -s ~/Mail /var/mail/$USER but mail complains Cannot open mailbox /var/mail/$USER: Is a ...
1
vote
1
answer
700
views
Does /usr/bin/mail have a queue?
RHEL 5
I'm using a perl service monitoring script (written by a colleague that is no longer with the company) running on an old RHEL 5 box. If a service is down, it sends an email alert to the root ...
2
votes
2
answers
9k
views
How to send mails using SMTP server in Linux without error
I'm trying to send mail via SMTP server. And set /etc/mail.rc file with:
set bsdcompat
set smtp=smtps://smtp.gmail.com:465
set smtp-auth=login
set smtp-auth-user=user@gmail.com
set smtp-auth-password=...
1
vote
2
answers
1k
views
Ways to add recipients in mailx
What options do I have for adding recipients to email when using mailx (or variations thereof)? The ones I know about are:
Manually type email address character by character from memory
Enter an ...
1
vote
1
answer
39
views
How to retain retain et. al. in mail(x)
When entering personal preferences like retain me@example.com inside command line mail, how can I have these saved so they are reloaded the next time I start mail?
1
vote
2
answers
3k
views
How to receive new email?
mail -f /home/debian9/Maildir
When new email coming,how to receive it in mailutils interface?
There are 1 email in my /home/debian9/Maildir.
Sent an email from admin to debian9 with command:
echo "...
0
votes
1
answer
2k
views
mutt is changing the content in body
I have a text file with multiple lines in content . But when I am sending it in mail all the lines are coming in one line in email as part of body of mail.
But when I insert empty line in content ...
2
votes
2
answers
3k
views
sendmail with html and file content
I need to send contents of a file in an email and add some html note at the beginning and ending of the file. I have used "sendmail" for the purpose, however when I receive the email I do not see the ...
1
vote
0
answers
58
views
Cause Code Not Implemented for Heirloom-Mailx
I am attempting to send an message with an attachment from my RP3 to my phone, which uses Sprint. I have Exim4 setup as a MTA and the Heirloom-MailX configured so I can send an attachment. I am using ...
3
votes
2
answers
1k
views
How to get response from mail command
I am trying to send the send email using the mail command as
mail -s "subject" email_address < email_text
but how will I confirm whether email is actually sent or not ( i.e. email_address is ...
0
votes
1
answer
1k
views
how can I tell the mail command the path to sendmail?
I would the mail command to use a program other than /usr/sbin/sendmail.
e.g.
$ mail --path=/usr/local/bin/mysendmail someone@somewhere.com
How can I do this?
1
vote
0
answers
5k
views
How to check whether I can send mail from my Linux server?
When I tried using mail or mailx with -r -s -a and other options, I am not able to send mail. Is there anything I need to check before sending mail from Linux server?
When I tried to see help for ...
7
votes
3
answers
10k
views
HTML email from heirloom mailx on linux
I've been trying to work through sending a html email from mailx on a linux server.
Few Notes:
I have to specify a smtp server so therefore I cannot use sendmail
(This is not something I can change ...
0
votes
1
answer
1k
views
Send raw message with mailx command
How can I pass a full raw/MIME message (raw file) to the Linux mailx command for delivery? I don't want to extract the recipient, subject, body etc from the message - I want to feed a complete ...
1
vote
1
answer
118
views
Local mail delivery affected by method of root login
I just sent a local mail using the following syntax:
echo "Testing" | mail -s "This is just a test" root@localhost
Then I log into root using:
sudo -i
And check my mail. The message is there.
If I ...
0
votes
1
answer
979
views
Perl script to format .xls file in Linux [closed]
All I have is a linux command (I don't know what's behind the command, the script or what formats the command output), so what I can do is to pull the data [which is in table form with invisible ...
1
vote
1
answer
422
views
Trouble sending email from the mail utility in Bash
I used the following command to send an email
echo "Body of the mail" | mail -s "subject" "something@gmail.com"
The first time I ran it, it returned an error saying the program mail is not installed....
2
votes
0
answers
596
views
mail/mailx: How to specify recipents with full names?
Rich email clients allow users to be identified likewise:
John Smith <jsmith@example.com>
How can I use such format for recipients (or other email fields for that matter) with mail and/or ...
1
vote
1
answer
928
views
Can't send mail via sendmail
I'm trying send mail via sendmail, but mail is not received. Here is the command:
/bin/cat /scripts/zabbix/test.txt | mail -v -s "Blocked IPs" example@example.com
Here is the output
example@example....
7
votes
3
answers
4k
views
Delete Mail Based on Subject Pattern [mail-command]
Is it possible to delete all mail in which the subject matches a regex pattern?
For example, to delete message 1, you do:
d 1
But to delete all mail with subject starting with, say, [SPAM], I can't ...