So I am using MUTT on my Ubuntu server where I want to email a particular file to the user once he enters his email address in a webpage (hosted on the server).
I am storing his response as a .json file in the server but now I want to send email to the email address provided by him.
As far as i know, MUTT has a command to send the email to a recipient
mutt -s "Mail Subject" username#domain.com -a attachment.zip < mail_body.txt
What I want is, to get the username#domain from a file rather than hardcoding it.
Any leads on how to do this will be appreciated.
Thanks
Turns out that I had to create an executable script for this job.
I stored the email to a variable by using EMAIL=cat email.txt and then used this EMAIL variable as the recipient.
Related
I would like my MacOS "server" (basic mac mini with OS12.1 installed)
to be able to send emails using my current (paid) email provider.
Some theory first.
I am aware about this fine article (http://hints.macworld.com/article.php?story=20081217161612647)
What puzzles me is how on earth will "fresh out of box" mac be able to send even ONE email without being (mail-server) configured first. In other words to what email server will it send my email?
Discovered the very useful command mailq that will show the current status of all current emails being processed.
I understood that the command mail will send an email:
echo "this is the body" | mail -s "this is the subject" "myself#myserver.lu"
I understand, mail is using postfix in the background.
This will show the version of postfix (mine is mail_version = 3.2.2)
postconf mail_version
Is it possible to update postfix on macos?
Did anyone managed to enable the log on mail_version 3.2.2?
I get this warning:
postconf: warning: /etc/postfix/main.cf: unused parameter: maillog_file=/var/log/postfix.log
without the log it is a bit difficult to see what went wrong during email send...
thanks in advance for some MAC related input.
I'm using mutt with PGP and would like to store sent messsages in a corresponding IMAP folder. Problem: When I send an encrypted email to somebody, mutt copies the encrypted email to the sent folder, instead of an unencrypted version. Of course, since it is encrypted with the receivers key, I cannot unencrypt this message anymore, making it useless.
Is there a setting in mutt to fix this?
The setting you ask for is set fcc_clear=yes. This will save it in cleartext to the Sent folder (see man muttrc for full explanation).
There was a question to the opposite on superuser, so I'll extend my answer to that for a full picture.
Depending on where your "Sent" folder resides, either in a remote IMAP server you want to have fulltext search for (probably need cleartext), or on a local disk that is encrypted at-rest, you have further options:
mutt currently has pgp_self_encrypt in tandem with pgp_default_key (added to mutt on 2017-05-29 / 2018-01-15, so check your version) to control the behaviour
gnupg has an encrypt-to <keyid> option, but I would prefer the mutt config
neomutt has encrypt-to-self
All Mail is not sending from Magento 2.0.2. Mail function is enabled. I tested in index.php file. while testing the PHP mail function like mail($to,$subject,$message, $headers) mail is not sending. I am using Ubuntu server. Let me know anything we need to configure in my php.ini file or any thing else.
You will have to set cron job first, because Magento does not send email without setting cron.
You can send email which is not Magento default email.But when you want to send all Magento default email like order email, shipment email, customer etc then you have set cron first.
I have a unique issue, i am in a unix environment and have a ksh script that ssh's to multiple sites, executes some code and then returns a response and then emails that response to an email address.
The script works perfectly when i run it, but since it must run for several hours i wish to nohup the script.
Here is where the problem is. When i nohup the script the email is not sent. I have scoured the boards looking for a reason or solution to no avail. if someone could point me in the right direction i would greatly appreciate it.
Here is my mail portion of the script:
mail -s "subject" email#address.com < /usr/etc/bin/mydir/infofile.out &&
rm -f infofile.out
exit;
EDIT: my environment is AIX 6.1.7.1
Finally figured out the answer, and even thou i was being dumb, i feel i have a responsibility to answer anyway, just in case someone else runs across this issue.
Turns out when i nohup my script it DOES send the email correctly. Its just that by nohuping and logging out it forces the email to be sent from the unix mail utility's default email address, and in my environment that address sends out hundreds of useless alerts, most of which i have filtered in outlook to go to a trash folder, well the email i was sending ended up in that trash folder.
Thanks to those who responded, especially shellter, your recommendation to use shell debugging is what let me know that it was sending from that default mail account.
I am having issues sending mail from my server, when I type in phpinfo() I get this:
Mail: /var/spool/mail/frank
...
_ENV["MAIL"]: /var/spool/mail/frank
The php file that I'm using the Mail function in is owned by Apache and has 775 permissions. Inside /var/spool/mail there is no apache file, but there is a file for every other user on the box. Do I need to change the php.ini? Or can I add in an apache file (perhaps duplicate the frank file and then rename)?
Any advice can help!
/var/spool/mail is where incoming unread mail is stored. There would be an 'apache' file only if the apache account has received mail.
Have you looked inside the MTA's log (usually /var/log/maillog) to see what's going on? If PHP's properly sending mail, there should be an entry in there for the mail being en-queued and what happened when the MTA (postfix/sendmail/exim/etc...) tries to forward it onwards.