henryhanselscott
Posts: 107
Joined: Sun Jan 18, 2015 1:31 pm

mpack email "from" field

Sun Jan 08, 2017 11:59 am

I am using mpack to send a report from my pi application via a gmail account. This is working perfectly. However email sent from the pi are always from "root" instead of "Henry". So, the receiver of the email sees it as sent from "root". How/where do I edit this property so that email send from my pi can by from "whatever I want it to say".

When I log into the same gmail account that the pi is using and send an email from it the "from" field is always my name and not from "root". So, this does not look like a gmail configuration issue, but rather something in the pi is writing the from field as "root"?

Thanks,
Henry

pcmanbob
Posts: 6256
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: mpack email "from" field

Sun Jan 08, 2017 12:53 pm

Hi.
If you are using mpac I guess you are also using ssmtp.

what have you got in your ssmtp.conf file ?

This is how mine is laid out and all the mails I get from my Pi show the correct sender.

Code: Select all

#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
root=<put pi email address here>

# The place where the mail goes. The actual machine name is required no 
# MX records are consulted. Commonly mailhosts are named mail.domain.com
#mailhub=mail
mailhub=smtp.gmail.com:587

AuthUser=<put pi email address here>
AuthPass=< put account password here>
UseTLS=YES
UseSTARTTLS=YES

# Where will the mail seem to come from?
rewriteDomain=gmail.com

# The full hostname
hostname=< I just put the name of my pi on the network in here > example "TestPi2"

# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
FromLineOverride=yes
hope this helps
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

tig124
Posts: 13
Joined: Mon Jun 19, 2017 8:52 pm

Re: mpack email "from" field

Wed Oct 25, 2017 11:25 pm

HI, How do I send a file from within another directory, i.e. not from the root? So for example from root I have a folder called freezermon, within this I have a file called Freezer.log that I was to send by email.

I have tested sending a file from the root using Mpack, and this works fine, but not from another directory!!

tig124
Posts: 13
Joined: Mon Jun 19, 2017 8:52 pm

Re: mpack email "from" field

Wed Oct 25, 2017 11:30 pm

Got it working! - Now when running this within a C file, it comes up with errors saying its not declared!

broe23
Posts: 903
Joined: Thu Jan 28, 2016 9:35 pm
Location: Central IL
Contact: Website

Re: mpack email "from" field

Thu Oct 26, 2017 3:10 am

It is really dependant on how it is logging from the CRON job level. Since Root is always reported to the local mailbox for logs. You could change the alias by having a If equals, that if "root" is seen, have it changed to say "kirk" or whatever you would like before it sends the log from the cronjob. See if this will work, since it is a simple fix. http://blog.bobbyallen.me/2013/02/03/ho ... -on-linux/

I will let you in that Webmin is the most powerful tool out there for managing a server. When I have setup and ran servers on the two Pi's I have, and with even Beige box servers in the past, Webmin works wonders when needing to do things that you did not want to deal with having to go through running WinSCP and VNC. You can change the mailbox and root alias and do other things also that you want to be able to just click and change.
Ren: Now listen, Cadet. I've got a job for you. See this button? Ren: Don't touch it! It's the History Eraser button, you fool! Stimpy: So what'll happen? Ren: That's just it. We don't know. Maybe something bad, maybe something good.

Return to “General discussion”