How to send an e-mail from Proxmox (one single command including address an the message, no manual dot

mes mariusz

New Member
Aug 30, 2020
8
0
1
42
Hi. Maybe this is a very simple question, but...

How to send an e-mail from Proxmox (one single command including address an the message, no manual dot) ?

Normally it-s possible to send from proxmox:

sendmail someone@somewhere.com [enter]
message [enter]
. [enter]


But how to do it in one single command?

I would like to adapt this script, to send messages from UPS (NUT) to myself:

https://wiki.ipfire.org/addons/nut/detailed

But it usus other mail sender (sendemail).

And how to avoid (Proxmox sendmail) this mail came inte spam @ gmail mailbox ?
 
usually you either use a dedicated mail user agent (mua) - e.g. mutt on the commandline.
In script quite often the 'mail' command (as provided by e.g. the bsd-mailx package is used)

check online - there are quite a ton of instructions of sending mail via command-line

And how to avoid (Proxmox sendmail) this mail came inte spam @ gmail mailbox ?
depending on your setup - it could help to send the mails via some official account, where you let PVE's postfix installation authenticate itself against
(there are a few threads in this forum where this is discussed)

I hope this helps!