Questions tagged [mailx]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
17 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/...
0
votes
0answers
7 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, ...
2
votes
2answers
37 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 ...
1
vote
1answer
23 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 ...
0
votes
0answers
13 views

Handle dead.letter queue on mailx

I have mailx installed on a Linux server. It used to work perfectly. From some reason, I had connectivy issue. So, all mail that tried to be sent went to the dead.letter file. After resolving my ...
0
votes
0answers
29 views

Sending Table using Mailx

Following is the content of my file results.txt VM Size -- ---- ABC - DEV - WinS16 - PASSANGER-LH.XXX.local 0....
0
votes
0answers
60 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: ...
0
votes
1answer
24 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"...
1
vote
1answer
549 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 ...
0
votes
1answer
311 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 ...
1
vote
1answer
87 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 ...
0
votes
2answers
924 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....
2
votes
2answers
3k 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 ...
1
vote
0answers
433 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/...
0
votes
1answer
46 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 /...
0
votes
1answer
469 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....
-1
votes
1answer
83 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 ...
0
votes
1answer
65 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 ...
2
votes
1answer
1k 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/...
-1
votes
1answer
428 views

Generating .XLS file as an output file of sqlplus query and sending that .XLS file as an attachment in email

I am generating output file (.xls format) from the below DB query- sqlplus -S -L user/pass@DB <<EOF | sed '/^$/d' >> home/test/query_output.xls set line 22000 set head off set feedback ...
1
vote
1answer
1k views

Send an image in the body of the mail using any of the mail utilities in Linux

I am trying to send an email from Linux server, I want to send an image, not as an attachment, that should be displayed in the message body. I tried. mailx -s "TEST mail" <MASKED>@mask.com <...
1
vote
2answers
369 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
1answer
30 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?
0
votes
2answers
4k views

how to send a mail with attachment using sendmail command in unix

This is how I try to send, email with sendmail command. echo "Dear user, please find the attached file. Thanks, Support team " | mailx -s "x12 extract for 837 transaction" -a $LogFilePath/file.csv $...
0
votes
1answer
70 views

Why claws mail can receive email instead of mail command?

mail -f /var/mail/debian9 /var/mail/debian9: 0 messages When mail -f /var/mail/debian9 executing ,the claws mail application is in off status. Now open the /var/mail/debian9 with claws mail. ...
1
vote
1answer
291 views

How to search my email containing some string in email'content?

The mail command can list email messages stored on my pc. How to search my email containing some string in email'content?
3
votes
1answer
385 views

Unattended upgrades won’t use mailx when run by Systemd

I have setup unattended-upgrades on servers running Raspbian (Raspbian GNU/Linux 9.4 (stretch)). Version of Unattended-upgrades: 0.93.1+nmu1 Updates work, but I am having problems with the email ...
0
votes
1answer
272 views

Getting error while using -c option in mailx command

I'm running a script to send a mail with few lines. Requirement is I need to add few people in cc. So I have created below scripts. For people who needs to be in TO and CC , I have created 2 ...
0
votes
0answers
660 views

Multiple html files in message body-mailx

I'm using pandas to get csv to html #!/usr/bin/python import pandas as pd import sys import json sys.stdout = open('output.html','wt') df = pd.read_csv('users.csv') print(df.to_html()) For another ...
1
vote
0answers
35 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 ...
2
votes
2answers
438 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 ...
1
vote
0answers
2k 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 ...
2
votes
1answer
10k views

How to send email attachment using mailx -a with a different attachment name?

We could do this using uuencode: uuencode actual_file display_file_name | mailx testemail@org.com Could you please advice how this can be done using mailx -a? The only option seems to be to copy ...
1
vote
2answers
783 views

Forward email but change the FROM address

I have a postfix server running on an EC2 instance. I want to forward all email, via SES, to my personal inbox. The problem: AWS only allows a FROM address that is verified in the AWS console and the ...
1
vote
0answers
299 views

mailx output in color format

I've a code which 'grep' certain strings from two files which I've defined as variables and if those strings are found then it'll send me the last 10 lines of the files using tail. I want the strings ...
-2
votes
2answers
877 views

How to check the record count from text file for different source and mail it is record is not equal to 0

I have a select query which runs and generate the count. It exports the Answer in a text file which has below records eg.: Unprocessed record for A Sources ----------------------Unprocessed ...
5
votes
1answer
3k 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 ...
1
vote
3answers
463 views

Avoid bash script waiting for user enter the Enter key

I have the following entry in a bash script: echo "Please see attached file" | mailx -S smtp=$smtpServer -s "Subject of the mail" -a $logfile -r "sender@domain.com" receiver1@domain.com receiver2@...
1
vote
0answers
534 views

Mailx replace from: address with name

How to replace sender address with his name using mailx command? I was using following command but it was still giving mail address and not name : echo test | mailx -r "Singh,Vivek <vivek.x....
2
votes
1answer
398 views

Using Mailx with Gmail

I've installed mailx, and when I try to send an email, like: echo "Test" | mailx -r "foo@gmail.com" -s "Test" "bar@gmail.com" It executes. But I don't receive the email. How do I set mailx up to ...
0
votes
1answer
696 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
3answers
772 views

How do I create a file name for my email attachment?

I'm using Amazon Linux and am creating a bash script. I'm tryhing to email an attachment and am having success with (cat $TFILE1; uuencode $output_file $output_file) | mailx -s "$subject" "$to_email"...
0
votes
1answer
7k views

Unix--Send attachment, subject and body of the mail using mailx

Can you please tell me how to send the attachment, subject and body of the mail using mailx command. I am using uuencode travel$datestamp.XLS Travel$datestamp.XLS | mail -s "International Savers ...
0
votes
1answer
1k views

Cannot send email via postfix / dovecot error status=deferred (mail transport unavailable)

I am trying to setup a mail server with postfix/dovecot/maria DB on centos 7 and have seem to hit a roadblock. I am not able to send emails to internal users and the logs suggest "mail transport ...
1
vote
1answer
325 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....
1
vote
0answers
297 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 ...
0
votes
1answer
3k views

Unable to send mails using mailx command

I tried sending an email using mailx as below: echo "something" | mailx -v -s "subject" recipient@somewhere.com For this I got the below response "Connection refused by [127.0.0.1]". I tried ...
0
votes
0answers
268 views

Replacing ^M with sed in a bash script [duplicate]

I'm running a script that SSHs into a server and then runs several commands. I then want to send these using the mail command. I run: result=$(ssh user@host 'kinit -k -t /path/to/dir/`whoami`.`...
0
votes
1answer
1k views

Auth error when sending mail through Postfix with SSMTP

I'm trying to send mail from server A running SSMTP via a server B running Postfix. The Postfix server is running just fine and has been in production for a while without any problems. It runs Postfix ...
0
votes
2answers
765 views

How to make 'mail' command work properly via SSH?

When logged into my server via SSH the $ mail command doesn't work properly. Instead of returning the list of mail it returns No mail for <user>. $ mail works correctly when on a terminal at ...