mail sending fails in shell - email

I get an error attempting to send mail with the following command.
mutt -s "testing message" -a 123.jpeg file.txt abc123#gmail.com < file.txt
error message is coming on the screen.
553 delivery from 122.161.253.17 is rejected.
But i know that my ip is 10.127.0.1 which is type of internal ip. Can you please help to solve this problem.

Related

Unix mail command queues but does not send

I have created a service that is supposed to send an automated email in HTML format by using UNIX mail command. It was working correctly until yesterday when suddenly stopped sending mails.
This is the command Im running programmatically
cat ./email.txt | mail -v -s "$(echo -e "Report for Last Week
Content-Type: text/html
Reply-to: abraham#corp.com
From: abraham#corp.com")" abraham#corp.com manolo#corp.com
The output looks like:
abraham#corp.com... queued
manolo#corp.com... queued
I am not getting any email, neither my partner...
I am not even able to run
echo "test"|mail -s "This is a test" abraham#corp.com
Im running on RedHat Linux.
Just in case someone needs help. The issue was related to the sendmail service of the OS.
I had to go service sendmail restart
It was as simple as that, however, I did compare the configuration files against a clean machine to make sure they were similar.

Send message using mutt from non-default account

You can send a message via mutt with a command like so:
mutt -s "Test Email" user#example.com < message.txt
This will send a message from the default account.
I have two e-mail accounts set up with mutt and I want to send a message from the account that is not the default. I tried changing the From field via -e 'my_hdr From:other#domain.com but the attempt failed with a SendAsDeniedException (my default e-mail is with Microsoft outlook.com).
So how can I send a message from the other account via the command line? (I want to automate my messages.)
I assume that you have configured your accounts in separate files. Simply load the corresponding configuration beforehand.
mutt -e "source ~/.mutt/accounts/account1" -s "Test Email" user#example.com < message.txt

Use mail command in terminal to send emails and specify From address

I have tried to send thousands of emails through running a csh script to execute the "mail" command. But all my emails were blocked by the recipient. I was told that the blocking reason is because of the workstation domain (kichisatoru#Sky.local), which is not a real domain (e.g. xx#gmail.com). How can I fix this issue, so the recipient can receive my emails in the standard way?
My csh:
#!/bin/csh
foreach eml (`ls *.eml`)
mail recipient#edu < $eml
echo $eml sent...
end
My problem is fixed! I have found a very detailed manual online http://www.developerfiles.com/how-to-send-emails-from-localhost-mac-os-x-el-capitan/

How to send mail from zimbra command line

I am vikas. i am looking a command that can send mail from zimbra mail-store server to external world. but as i checked in zimbra not getting Any program that have role of sending mails. that is why i am relay email through Zimbra MTA server. now i am going to use below command but still getting variable error.
awk 'BEGIN{print "Subject:test mail!\nFrom:Mailadmin <admin#knowledgelinux.com>"}{printf("%s\015\n", $0)}' $message file-name=/test.txt | sendmail -t "mail#knowledgelinux.com"
awk: command not found
The instructions here worked for me:
vim /etc/logwatch/conf/logwatch.conf
Relevant lines to be replaced:
Output = mail
MailTo = root_all#your.domain
MailFrom = Logwatch#your.domain
mailer = "/opt/zimbra/common/sbin/sendmail -t"
Zimbra uses a modified version of sendmail.
The Zimbra MTA uses a modified postfix daemon. You should be able to just use the command mail:
cat *messagefilename* |mail -r *fromaddress* -s *Subject* *recipient-list*
As long as the Zimbra MTA is running on the machine in question this should work.

Not able to send e-mail using MUTT

I have set the from: email-id in .muttrc. I am using the following command to send an e-mail from command-line:
echo "<html><body><b>BOLD</b></body></html>" | mutt -e "set content_type=text/html" -s "HTML" -- xyz#gmail.com
I am able to send e-mail from only my home internet. If I try to send from any other network, it doesn't go. How should I fix this to be able to send e-mail from any network? What all changes are supposed to be made?