*Participation Requested*
MicroOS Desktop Use to Help with ALP Feedback
-
sending email to web mail or local admin
I need to be able send web-mail and send to local admin with an attachment. I'v done some research and found various commands.
mail
mailx
sendmail
...
Which one(s) are common to distros and allow both local and webmail? Preferred, no additional installs and no system cfg setup? Please show recommended formatting based on following code.
Current line (not tested):
Code:
cat /var/log/VirusVault/VirusFoundZipSendEmailBody.cfg | mail -r "$Zip_Send_Email" -s "$VirusFoundZipSendEmailSubject" "$VirusFoundZipSendEmailSubject"
Thanks...
-
Re: sending email to web mail or local admin
 Originally Posted by lord_valarian
I need to be able send web-mail and send to local admin with an attachment. I'v done some research and found various commands.
mail
mailx
sendmail
...
Which one(s) are common to distros and allow both local and webmail? Preferred, no additional installs and no system cfg setup? Please show recommended formatting based on following code.
Current line (not tested):
Code:
cat /var/log/VirusVault/VirusFoundZipSendEmailBody.cfg | mail -r "$Zip_Send_Email" -s "$VirusFoundZipSendEmailSubject" "$VirusFoundZipSendEmailSubject"
Thanks...
Some years ago I configured postfix / fetchmail: https://karlmistelberger.wordpress.c...nsuse-desktop/ See also: https://www.binarytides.com/linux-mailx-command/
i7-6700K (2016), i5-8250U (2018), AMD Ryzen 5 3400G (2020), 5600X (2022) openSUSE Tumbleweed, KDE Plasma
-
Re: sending email to web mail or local admin
On a normal system mail is setup as the default mailer:
Code:
> ls -l /usr/bin/mail
lrwxrwxrwx 1 root root 22 Jan 7 20:46 /usr/bin/mail -> /etc/alternatives/mail
So if I want something that works common to distros I would opt for mail.
-
Re: sending email to web mail or local admin
 Originally Posted by marel
On a normal system mail is setup as the default mailer:
Code:
> ls -l /usr/bin/mail
lrwxrwxrwx 1 root root 22 Jan 7 20:46 /usr/bin/mail -> /etc/alternatives/mail
So if I want something that works common to distros I would opt for mail.
Oops, buggy line. Here the section of code. Note, 'f' option sends to folder.
Code:
elif [[ "$Parm_Options" == *'m'* ]]; then
if [[ "$Parm_Folder_Email" == '@' ]]; then
Zip_Send_Email="$VirusFoundZipSendEmailTo"
else
Zip_Send_Email="$Parm_Folder_Email"
fi
printf "To -> %s\n" "$Zip_Send_Email"
printf "From -> %s\n" "$VirusFoundZipSendEmailFrom"
printf "Subject -> %s\n" "$VirusFoundZipSendEmailSubject"
printf "Body -> \n"
cat /var/log/VirusVault/VirusFoundZipSendEmailBody.cfg
printf "Sending Email...\n"
cat /var/log/VirusVault/VirusFoundZipSendEmailBody.cfg | mail -r "$Zip_Send_Email" -s "$VirusFoundZipSendEmailSubject" "$Zip_Send_Email"
fi
Mail is the local users tool only? Do I need to start a mail server? Then shut it down to get it to send to a webmail adress?
Code:
# ls -l /usr/bin/mail
lrwxrwxrwx 1 root root 5 Dec 1 08:24 /usr/bin/mail -> mailx
#ls -l /etc/alternatives/mail
ls: cannot access '/etc/alternatives/mail': No such file or directory
-
Re: sending email to web mail or local admin
 Originally Posted by lord_valarian
Oops, buggy line. Here the section of code. Note, 'f' option sends to folder.
Code:
elif [[ "$Parm_Options" == *'m'* ]]; then
if [[ "$Parm_Folder_Email" == '@' ]]; then
Zip_Send_Email="$VirusFoundZipSendEmailTo"
else
Zip_Send_Email="$Parm_Folder_Email"
fi
printf "To -> %s\n" "$Zip_Send_Email"
printf "From -> %s\n" "$VirusFoundZipSendEmailFrom"
printf "Subject -> %s\n" "$VirusFoundZipSendEmailSubject"
printf "Body -> \n"
cat /var/log/VirusVault/VirusFoundZipSendEmailBody.cfg
printf "Sending Email...\n"
cat /var/log/VirusVault/VirusFoundZipSendEmailBody.cfg | mail -r "$Zip_Send_Email" -s "$VirusFoundZipSendEmailSubject" "$Zip_Send_Email"
fi
Mail is the local users tool only? Do I need to start a mail server? Then shut it down to get it to send to a webmail adress?
Code:
# ls -l /usr/bin/mail
lrwxrwxrwx 1 root root 5 Dec 1 08:24 /usr/bin/mail -> mailx
#ls -l /etc/alternatives/mail
ls: cannot access '/etc/alternatives/mail': No such file or directory
What most distributions use:
Code:
erlangen:~ # readlink -f /usr/bin/mail
/usr/bin/mailx
erlangen:~ # rpm -qf /usr/bin/mailx
mailx-12.5-32.2.x86_64
erlangen:~ # zypper if mailx
Loading repository data...
Reading installed packages...
Information for package mailx:
------------------------------
Repository : Haupt-Repository (OSS)
Name : mailx
Version : 12.5-32.2
Arch : x86_64
Vendor : openSUSE
Installed Size : 576.5 KiB
Installed : Yes
Status : up-to-date
Source package : mailx-12.5-32.2.src
Summary : A MIME-Capable Implementation of the mailx Command
Description :
Nail is a mail user agent derived from Berkeley Mail 8.1. It is
intended to provide the functionality of the POSIX.2 mailx command with
additional support for MIME messages, POP3, and SMTP. In recent system
environments, nail is Unicode/UTF-8 capable. Further, it contains some
minor enhancements like the ability to set a "From:" address.
erlangen:~ #
Code:
erlangen:~ # zypper if postfix
Loading repository data...
Reading installed packages...
Information for package postfix:
--------------------------------
Repository : Haupt-Repository (OSS)
Name : postfix
Version : 3.6.2-7.3
Arch : x86_64
Vendor : openSUSE
Installed Size : 3.4 MiB
Installed : Yes
Status : up-to-date
Source package : postfix-3.6.2-7.3.src
Summary : A fast, secure, and flexible mailer
Description :
Postfix aims to be an alternative to the widely-used sendmail program.
erlangen:~ #
Configuring postfix using "yast2 mail" takes a few minutes at most. But that is not an option for users who want to tinker.
i7-6700K (2016), i5-8250U (2018), AMD Ryzen 5 3400G (2020), 5600X (2022) openSUSE Tumbleweed, KDE Plasma
-
Re: sending email to web mail or local admin
 Originally Posted by karlmistelberger
What most distributions use:
Code:
erlangen:~ # readlink -f /usr/bin/mail
/usr/bin/mailx
erlangen:~ # rpm -qf /usr/bin/mailx
mailx-12.5-32.2.x86_64
erlangen:~ # zypper if mailx
Loading repository data...
Reading installed packages...
Information for package mailx:
------------------------------
Repository : Haupt-Repository (OSS)
Name : mailx
Version : 12.5-32.2
Arch : x86_64
Vendor : openSUSE
Installed Size : 576.5 KiB
Installed : Yes
Status : up-to-date
Source package : mailx-12.5-32.2.src
Summary : A MIME-Capable Implementation of the mailx Command
Description :
Nail is a mail user agent derived from Berkeley Mail 8.1. It is
intended to provide the functionality of the POSIX.2 mailx command with
additional support for MIME messages, POP3, and SMTP. In recent system
environments, nail is Unicode/UTF-8 capable. Further, it contains some
minor enhancements like the ability to set a "From:" address.
erlangen:~ #
Code:
erlangen:~ # zypper if postfix
Loading repository data...
Reading installed packages...
Information for package postfix:
--------------------------------
Repository : Haupt-Repository (OSS)
Name : postfix
Version : 3.6.2-7.3
Arch : x86_64
Vendor : openSUSE
Installed Size : 3.4 MiB
Installed : Yes
Status : up-to-date
Source package : postfix-3.6.2-7.3.src
Summary : A fast, secure, and flexible mailer
Description :
Postfix aims to be an alternative to the widely-used sendmail program.
erlangen:~ #
Configuring postfix using "yast2 mail" takes a few minutes at most. But that is not an option for users who want to tinker.
Code:
# zypper if postfix
Loading repository data...
Reading installed packages...
Information for package postfix:
--------------------------------
Repository : Update repository with updates from SUSE Linux Enterprise 15
Name : postfix
Version : 3.5.9-5.9.2
Arch : x86_64
Vendor : SUSE LLC <https://www.suse.com/>
Installed Size : 3.2 MiB
Installed : Yes (automatically)
Status : up-to-date
Source package : postfix-3.5.9-5.9.2.src
Summary : A fast, secure, and flexible mailer
Description :
Postfix aims to be an alternative to the widely-used sendmail program.
The script has to setup everything in the code. I have many different auto-setup sections for many items. If postfix is needed to use mailx, I need to make a cross linux distros auto-setup.
-
Re: sending email to web mail or local admin
 Originally Posted by karlmistelberger
One page is in german, I think that's the language. I can read some of it.
-
Re: sending email to web mail or local admin
Note: mail or mailx produces no output to debug. I tried it with local_username and I think it worked.
-
Re: sending email to web mail or local admin
 Originally Posted by lord_valarian
Note: mail or mailx produces no output to debug. I tried it with local_username and I think it worked.
You may try "mailx -d".
i7-6700K (2016), i5-8250U (2018), AMD Ryzen 5 3400G (2020), 5600X (2022) openSUSE Tumbleweed, KDE Plasma
-
Re: sending email to web mail or local admin
mailx -v sends a comprehensive message:
Code:
Mail Delivery Status Report

Von: Mail Delivery System <MAILER-DAEMON@localhost>
An: Ich
Datum: 24.01.22 07:24
This is the mail system at host localhost.
Enclosed is the mail delivery report that you requested.
The mail system
<karl.mistelberger@....>: delivery via
mail.mnet-online.de[62.245.150.229]:25: 250 2.0.0 from
MTA(smtp:[frontend01.mail.intern.m-online.net]:10025): 250 2.0.0 Ok: queued
as 4Jj0MW4kDcz1qqkB
Unbenannt
Delivery report
Return-Path: <karl.....>
Received: by localhost (Postfix, from userid 1000)
id B8D16542DC; Mon, 24 Jan 2022 07:24:54 +0100 (CET)
Date: Mon, 24 Jan 2022 07:24:54 +0100
From: karl.....
To: karl....
Subject: test
Message-ID: <61ee4636.SbdEG3d6UXRw6TUg%karl.....>
User-Agent: Heirloom mailx 12.5 7/5/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
i7-6700K (2016), i5-8250U (2018), AMD Ryzen 5 3400G (2020), 5600X (2022) openSUSE Tumbleweed, KDE Plasma
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|