I have a user w/o a shell that runs an app as a daemon that needs to use mutt to email an attachment from a script. During testing when the app was ran as root everything worked:) Now that we obviously are running as a user w/o a shell this little bit broke. I used mutt as I needed to send the attachment as mime, and the ability to specify a muttrc from the cli when executed was useful so we could tweak the mail headers etc... Since there is no local mb's at all on this server, are there any mutt gurus that know off hand how I can manipulate the behavior of mutt to simply send w/o looking for a mailbox? Thanks, jlc
On Sat, Jan 02, 2010 at 04:21:02AM +0000, Joseph L. Casale wrote:> I have a user w/o a shell that runs an app as a daemon that needs to use > mutt to email an attachment from a script. > > During testing when the app was ran as root everything worked:) Now that > we obviously are running as a user w/o a shell this little bit broke. I > used mutt as I needed to send the attachment as mime, and the ability > to specify a muttrc from the cli when executed was useful so we could tweak > the mail headers etc... > > Since there is no local mb's at all on this server, are there any mutt gurus > that know off hand how I can manipulate the behavior of mutt to simply send > w/o looking for a mailbox?How do you call mutt? Couldn't you precreate a muttrc file and then just include its path in however you make your call to mutt? Regardless, seems like you'd be better off using a Python or PHP script to send your email.... Ray
On Sat, 2010-01-02 at 04:21 +0000, Joseph L. Casale wrote:> I have a user w/o a shell that runs an app as a daemon that needs to > use > mutt to email an attachment from a script.This may or may not be useful to you, but I use this to handle email from scripts and programs: http://www.cleancode.org/projects/email -- MELVILLE THEATRE ~ Melville Sask ~ http://www.melvilletheatre.com
On Fri, Jan 1, 2010 at 6:21 PM, Joseph L. Casale <jcasale at activenetwerx.com> wrote:> I have a user w/o a shell that runs an app as a daemon that needs to use > mutt to email an attachment from a script. > > During testing when the app was ran as root everything worked:) Now that > we obviously are running as a user w/o a shell this little bit broke. I > used mutt as I needed to send the attachment as mime, and the ability > to specify a muttrc from the cli when executed was useful so we could tweak > the mail headers etc...Hmmm.. I call mutt from scripts called by cron all the time, can't see why this is much different. Well, okay, cron uses the same user, so it has a shell. You could specify the muttrc file using the -F switch, maybe that will solve yer problem? Or are you saying that is what you're doing but it bombs? How about telling us the command/script and the error output? luck, Dave
El 02/01/10 5:21, Joseph L. Casale escribi?:> I have a user w/o a shell that runs an app as a daemon that needs to use > mutt to email an attachment from a script. > > During testing when the app was ran as root everything worked:) Now that > we obviously are running as a user w/o a shell this little bit broke. I > used mutt as I needed to send the attachment as mime, and the ability > to specify a muttrc from the cli when executed was useful so we could tweak > the mail headers etc... > > Since there is no local mb's at all on this server, are there any mutt gurus > that know off hand how I can manipulate the behavior of mutt to simply send > w/o looking for a mailbox? > > Thanks, > jlc > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos >Hello I'm doing this way, i run an script from cron. Sending several attachments to several addresses with a text in the email's body. In the script called by cron put: EDITOR=touch mutt -s "Here the subject" -F /home/user/.muttrc -i /usr/local/bin/body_text.txt -a /tmp/attachment1 -a /tmp/attachement2 -b address1 at someplace.com address2 at someserver.com addressN at anyserver.com</dev/null And .muttrc: set from=sender_email at somesite.com set envelope_from=yes set realname="Sender's Name" Hope this helps you Best =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Scanned with Copfilter Version 0.84beta3a (ProxSMTP 1.6) AntiVirus: ClamAV 0.95.2/10248 - Fri Jan 1 23:09:50 2010 by Markus Madlener @ http://www.copfilter.org
On Sat, Jan 2, 2010 at 4:21 AM, Joseph L. Casale <jcasale at activenetwerx.com> wrote:> I have a user w/o a shell that runs an app as a daemon that needs to use > mutt to email an attachment from a script. > > During testing when the app was ran as root everything worked:) Now that > we obviously are running as a user w/o a shell this little bit broke. I > used mutt as I needed to send the attachment as mime, and the ability > to specify a muttrc from the cli when executed was useful so we could tweak > the mail headers etc... > > Since there is no local mb's at all on this server, are there any mutt gurus > that know off hand how I can manipulate the behavior of mutt to simply send > w/o looking for a mailbox? > > Thanks, > jlc > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos >I'm not a mutt guru, but sending attachments from cli is terribly simple using uuencode. If possible, you could try something like: uuencode /path/to/attachment | mail -s <subject here> <destination address> I don't think the command would fail given the user doesn't have a shell or/and a local mailbox.