LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-03-2021, 05:43 PM   #1
keirvt
Member
 
Registered: Sep 2006
Location: Sydney Australia
Distribution: fedora/Ubuntu
Posts: 156

Rep: Reputation: 18
mpack From: Field


On a Unix server I am using the command mpack to send PDF attachments. It works, is concise and simple to use taking away all the complexity of having to compose mail header details.

The trouble is that the operational account (ops) in sending mail produces a "From:" field with an enigmatic user called "ops". I would like to change the From: field to another account name. There doesn't appear to be an mpack flag that does this. I tried adding From: to the description file, then the email address appears in the body of the mail as might be expected. Is there a way to convince mpack to change the From: field to something else.

Does anyone know how this might be done?
 
Old 07-04-2021, 08:36 AM   #2
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
Honestly, never heard of mpack before. If I were to send an email with attachments from a script, I'd probably do it with Perl.

Last edited by shruggy; 07-04-2021 at 08:46 AM.
 
Old 07-04-2021, 11:49 PM   #3
keirvt
Member
 
Registered: Sep 2006
Location: Sydney Australia
Distribution: fedora/Ubuntu
Posts: 156

Original Poster
Rep: Reputation: 18
mpack

Perl may work. All the code I have inherited is bash script and mail is done using ssmpt. This means handling a heady set of mail headers. ( hey a pun!)
Anyway My brief is to not stray into the use of other programming languages. Beside Perl would be another diversion for me. Options I have tried but found lacking are mail mailx, mutt and others. The command mpack is a single line of code that does the header creation job seamlessly except for being able to override the From field. I may have to live with that.
 
Old 07-05-2021, 01:12 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,349

Rep: Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750
Does this help https://www.raspberrypi.org/forums/v...c.php?t=170717 ?
Basically, edit the ssmtp.conf file file to allow override ( FromLineOverride=yes ) & edit other fields as noted ..
 
Old 07-05-2021, 01:54 AM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,784

Rep: Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304
yes, you can use perl. You do not need to implement anything, just use that perl script (and overwrite the from field).
Or you can do something similar in python or several other languages.
Or you can follow the link posted by chrism01 and modify your ssmtp.conf.

Additionally you may try to use mpack to convert a file and use mailx or another mailer to send it.
 
  


Reply

Tags
mpack mail


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Count occurrence of character in field and print in a new field Trd300 Linux - Newbie 5 03-21-2012 07:57 PM
[SOLVED] awk: how to print a field when field position is unknown? elfoozo Programming 12 08-18-2010 03:52 AM
awk printing from Nth field to last field sebelk Programming 2 01-08-2010 09:39 AM
php question, how do I get a return from a field within a field? cherrington Programming 11 04-29-2009 01:27 AM
Mpack threat, is Linux vulnerable? andy.l Linux - Security 6 06-24-2007 03:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration