2022 Developer Survey is open! Take survey.

Questions tagged [mailx]

mailx is a command-line utility for reading and sending email

Filter by
Sorted by
Tagged with
0 votes
0 answers
32 views

How to use s-nail with unattended-upgrades?

My ISP blocks port 25 and I want to send email after unattended-upgrades completes. I set things up so that I can successfully send mail with s-nail, but unattended-upgrades still isn't sending me ...
user avatar
  • 123
1 vote
1 answer
122 views

Install mailx on CentOS 9

I can't install mailx on CentOS 9. yum install mailx -y Last metadata expiration check: 0:04:13 ago on Sat 09 Apr 2022 07:55:59 PM UTC. No match for argument: mailx Error: Unable to find a match: ...
user avatar
  • 113
5 votes
1 answer
237 views

How to avoid the "pager" in mailx?

Having many short mail messages in my inbox, it's quite annoying that even short messages are sent though a pager (less), requiring to press 'q' before I can view the next message (for example). I ...
user avatar
  • 801
2 votes
1 answer
33 views

How to run a few commands and have the output emailed once a day?

new person here. I would like to run uptime and bdf and have the output emailed to me. I have the mailx part down- /usr/bin/mailx -s "daily_update" someguy@thisplace.com </home/...
user avatar
0 votes
0 answers
41 views

rename attachments using mailx command without uuencode

earlier I was using system("(echo \"demo attachment\"; uuencode demo.txt rename.txt )| mailx -r ${mail_from} -s \"${subject}\" ${emailids}"); this to send attachments ...
user avatar
0 votes
1 answer
39 views

Mail sender address is not getting updated

I'm trying to send email, but I constantly get wrong sender email address. OS details: NAME="Ubuntu" VERSION="18.04.5 LTS (Bionic Beaver)" ID=ubuntu ID_LIKE=debian PRETTY_NAME=&...
user avatar
0 votes
1 answer
58 views

Function call with stdin or /dev/null if empty

I'm trying to make a Bash function like this: function send_email { local DEFAULT_EMAIL='Something@Somplace.com' local email_subject="${1:-No subject line set, please check $0 on $(hostname -...
user avatar
0 votes
0 answers
25 views

How to send a mail with mail x to many users and the don't see the other users in copy

How to send an email to several users without these people seeing the other users in copy. I used the command: mail -a 'Content-Type: text / html' -s "Subject" -r "expeditor@domain.com&...
user avatar
  • 1
1 vote
1 answer
91 views

mail: How do I mark an email as unread?

I am using mail from GNU Mailutils to read the contents of a Maildir. For emails that have already been marked as read, is there a way to mark them as unread in mail?
user avatar
  • 1,842
0 votes
1 answer
50 views

Aix: why program mail ignore the mbox setting?

On AIX, I want the mail program to use /root/.mbox instead of default /root/mbox. I edit mailrc vim .mailrc set MBOX=/root/.mbox the result is not good mail Mail [5.2 UCB] [AIX 5.X] Type ? for help. &...
user avatar
  • 11k
0 votes
0 answers
165 views

connection to blacklisted host DNSBL

I’m trying to build a mail server, but when I tried to check the if TCP Port 25 (outbound) is blocked or not I got the following root@mail:~# telnet gmail-smtp-in.l.google .com 25 Trying 74.125.71.27… ...
user avatar
-1 votes
1 answer
75 views

Issue detecting running processes from shell script

Script: #!/bin/bash kafka=`ps -ef | grep 'kafka' | grep -v grep | wc -l` echo $kafka if [ $kafka<3 ] then echo "Hi Support Team, Kafka is down on QA/Dev server $hostname .Please take ...
user avatar
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 ...
user avatar
  • 1,099
1 vote
2 answers
267 views

Unable to send out emails from my Linux Host

Unable to send out emails from my Linux Host. Below is the command I try: echo "This is the message body and contains the message" | sudo mailx -v mypunnq@gmail.com -s "This is the ...
user avatar
  • 297
0 votes
0 answers
54 views

How to properly use mailx to attach a file (not replace content)?

I am using $ mailx -V mailx (GNU Mailutils) 3.5 Copyright (C) 2007-2017 Free Software Foundation, inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free ...
user avatar
  • 136
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/...
user avatar
0 votes
1 answer
75 views

Discriminating between log entries' timestamps from bash script

My Bash script executes as a cron job. It seeks a string within a log file and is supposed to forward the corresponding log entry by mail if found. My script works but floods me with already reported ...
user avatar
  • 1
0 votes
1 answer
194 views

Sendmail Service Issue: "rejecting new messages: min free: 100"

For a test email with the following command (echo "Hi") | mailx -v -r from@something.com -s "Subject Test" -c cc@something.com to@something.com I get the following output in a ...
user avatar
  • 145
0 votes
1 answer
98 views

What is the difference between sending carbon copies of mail message to other users and sending mail to multiple users at the same time

In Unix, the -c option in mailx command sends copy of message to other people and has the following syntax: mailx -s "Subject" -c "jpm,sumit" charlie < message.txt where jpm ...
user avatar
  • 183
0 votes
0 answers
956 views

How to send email on linux with HTML content AND attachment?

I have Oracle Linux server 7.8, on which I am trying to explore programs which be used for emailing HTML content and also send an attachment. Let say I am in my home directory and i have the following ...
user avatar
  • 103
0 votes
1 answer
692 views

Mailx or mail command is not including the body when triggered via crontab

I created a script that checks the process of apache server and sends an email if the process is down. apache_down=`service httpd status | grep "inactive (dead)"` echo “$apache_down" | mailx -s “...
user avatar
1 vote
0 answers
819 views

MBSync Maildir++ to IMAP with subfolder in INBOX

I am trying to use MBSync to sync a local Maildir++ folder (dovecot mail data) into a remote IMAP mailbox. While it works in general, subdirs of INBOX are ignored. Config looks like this: ...
user avatar
  • 111
0 votes
1 answer
383 views

I want to send one of the zip folder which consisit of 8 to 10 files, attaching via e-mail using Linux command

I tried with this command but no luck. echo 'These are contents of my mail' | mailx -s 'This is my email subject' -a /home/user/Desktop/data.zip mail_id@example.com Any suggestion?
user avatar
  • 11
0 votes
1 answer
81 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 ...
user avatar
0 votes
0 answers
104 views

Problem with sending Unix mail from home (because of Spamhaus block list?) [duplicate]

I have a script that sends a simple email at the end. When running it while my laptop is inside my university'e network, everything works just fine. However, when I send an email from home using a ...
user avatar
  • 101
0 votes
1 answer
917 views

Attaching multiple files using bash and emailing it out using SWAKS or another program

I'm trying to: Attach multiple files into one email. Have the email sent out using a Gmail account with the current date and time in the subject header. I'm having trouble with the for a loop ...
user avatar
  • 317
0 votes
1 answer
224 views

How to read mail using terminal?

I've set up my my smtp server using ssmtp which I set up as default. So now I can send emails using mail and I'm receiving them(checked on my phone), but I can't read them using mail, or by cat /var/...
user avatar
  • 113
1 vote
0 answers
294 views

Unknown keyword `smtp-auth' when using --set=smtp-auth=login

I use a bash script to make some process, then send me a mail report. This works fine when I use a local postfix configuration, but this not works with smtp auth and I got the error «smtp-auth unknown»...
user avatar
  • 301
1 vote
0 answers
107 views

Mailx command attachment style is different between platforms

On a virtual ubuntu box the mailx command has -a refers to the content headers and -f adds attachments. Whereas on my school's virtual machines (I think they run centOS) -a adds attachments. I tried ...
user avatar
0 votes
0 answers
473 views

how can we send an image in the body of the mail using any of the mail utilities in Linux

How can we send an image in the body of a mail with rich text / HTML. I tried to get from few of the links , but i am not able to get complete solution. I tried below code but no luck mpack -s "...
user avatar
  • 282
-1 votes
1 answer
8k views

Unix command to send mail having subject from a variable

We have created a UNIX program which is used to send mails. In that program we are fetching the mail subject and body based on user inputs (through Oracle Concurrent Program) For example: The ...
user avatar
  • 25
4 votes
1 answer
1k views

How can I read one message at a time from /var/mail

Lets say I have 5 messages in /var/mail/ and I want to read one message at a time and then do some string search in that mail before moving on to the next message. Is there a command that I can use to ...
user avatar
  • 43
0 votes
2 answers
2k views

Install Postfix using Mailutils on Ubuntu 19.04 server for sending out mail only

I followed this tutorial: https://computingforgeeks.com/how-to-install-and-configure-postfix-as-a-send-only-smtp-server-on-ubuntu-18-04-lts/ I'm trying to setup a send only mail from my Ubuntu 19 ...
user avatar
1 vote
1 answer
147 views

Cron is not logging stderr in /var/mail/user

I have this user who have a lot of cron jobs and I expected it to log stderr in its /var/mail/user. Sample below cron entry is working as expected in a different server. * 30 * * * * /usr/local/bin/...
user avatar
  • 53
0 votes
0 answers
274 views

Mails not going through with "Host not found" error

Mails are not going through from my postfix mail server and it is failing with below error Jun 21 07:53:23 node-002 postfix/error[23121]: 06899101C478: to=<blas@example.com>, relay=none, ...
user avatar
  • 2,736
2 votes
2 answers
3k views

Debian mailx won't attach files to emails

(Note: I have seen this question, but it does not work for me) I am attempting to send an email with an attachment using Bash on Debian Stretch, using the mailx package (not mutt). My implementation ...
user avatar
1 vote
1 answer
996 views

mailx execution as non-root failing

I am running Oracle Linux 7 for the purpose of hosting an Oracle database. As part of this process I run a script that mails a log file at the end on a daily basis. Crux of my issue is that my ...
user avatar
  • 11
0 votes
0 answers
66 views

How to fix "Account starting with zero"

Because this company uses Centrify, I made a local Oracle account starting with zero on another server so as not to conflict with the original. No problem except when my scripts email me I get: ...
user avatar
  • 288
0 votes
1 answer
160 views

Compose a path from a file name. Send file through email

I want to send to my e mail account a mail with log from program execution. This file changes everyday and it's named like this log-20190703.gz My attempt: #!/bin/bash log_file=logs-$(date +"%Y%m%d"...
user avatar
0 votes
1 answer
5k views

Linux Mailx is creating a dead.letter and not sending email [closed]

I am having issues with sending emails from my Redhat6 linux server. Each type of mailing command sendmail/mailx creates a dead.letter in the users home directory. Examples of how I am sending ...
user avatar
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 ...
user avatar
  • 409
1 vote
1 answer
340 views

Why does mailx see 0 messages in my mbox file?

I have an MBOX file created by dragging a folder from Outlook (For Mac v.16) into Finder (because the Export wizard in Outlook For Mac only generates OLM files). I can look at the MBOX contents as ...
user avatar
  • 113
1 vote
4 answers
17k views

Trouble Sending file content in the mail body with mailx

I need to send an email using the mailx command. I am clear that the command would be the following by example: echo "Body message" | mailx -s "Sending mail with Mailx" -r "abc@mail.com" "abc@mail....
user avatar
5 votes
2 answers
11k views

Ubuntu 18.04: Error with mailx smtp - mailx: unrecognized option "-S'"?

I was trying to send an email to multiple persons using mailx (mailx (GNU Mailutils) 3.4). I did that successfully on a previous version of Ubuntu, v16.04, and the script was working fine. Now I have ...
user avatar
1 vote
0 answers
2k views

how to debug what's wrong with mailx

I'm trying to see what happening why my mailx is failing. I tried to run the mailx command locally with a debug flag but it just returns a empty carriage return. Once it showed me this error. SSL/...
user avatar
  • 133
0 votes
1 answer
807 views

changes to /etc/mail.rc does not seem to take effect

there were some changes with our smtps server, specifically the port that we can use. as I have done before, I changed the details in /etc/mail.rc file. but when I run my script, there is a log in /...
user avatar
  • 133
0 votes
1 answer
1k views

How can I save the result of mailx command in unix to read mails to a text file?

I want to save the unread mails to a text file in UNIX using a shell script. This shell script is executed frequently using crontab. I have tried with the below code: #!/bin/ksh mailx > mytest....
user avatar
-1 votes
1 answer
552 views

Mail command using for loop not reliable?

I have a test email account environment that I'm trying to fill with emails before running migrating tests. I've been trying to achieve this with the following bash script: for i in {1..1000}; do ...
user avatar
0 votes
1 answer
166 views

send email from terminal bad behaviour

I have the following script that i put togheter from the web, to send emails from terminal trough gmail. #!/bin/bash #sendGmail "FROM" "TO" "SUBJECT" "BODY" "ATTACHMENTS (optional)" FROM=$1 TO=$2 ...
user avatar
2 votes
1 answer
4k views

How to install heirloom-mailx on Ubuntu 14.04

I want to install heirloom-mailx on Ubuntu 14.04 My current /etc/apt/sources.list reads like this: deb http://archive.ubuntu.com/ubuntu/ trusty main restricted deb-src http://archive.ubuntu.com/...
user avatar
  • 123