FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 01-02-2010, 04:01 AM
"Joseph L. Casale"
 
Default mutt execution by daemon

>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

Now that you mention this, I recall you suggesting it on this or the fedora
list before and I recall the squabbling over its name and hence exclusion
from the package repos

I don't want to worry about adding a package as I want to update all my
scripts no production boxes to use something in base or at worst, rpmforge.

I don't know python...

Thanks guys!
jlc
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 01-02-2010, 05:24 AM
Dave
 
Default mutt execution by daemon

On Fri, Jan 1, 2010 at 6:21 PM, Joseph L. Casale
<jcasale@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
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 01-02-2010, 06:03 AM
"Joseph L. Casale"
 
Default mutt execution by daemon

>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

Hi,
I am calling mutt like so:
mutt -F /path/muttrc -a /path/file -s "text here" dest@example.com < /dev/null

But as the user does not have a mailbox, it fails. I can't actually see what's
going on obviously but as I tail the maillog and nothing even wakes it I am just
making a WASG that I am pretty sure is right As there is and never was local mail
delivery, root doesn't even have a mailbox so if I run it, I see it prompts for the
mb...

jlc
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 01-02-2010, 06:59 AM
Jose Maria Terry Jimenez
 
Default mutt execution by daemon

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@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@someplace.com address2@someserver.com
addressN@anyserver.com</dev/null

And .muttrc:

set from=sender_email@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
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 01-02-2010, 07:08 AM
"Joseph L. Casale"
 
Default mutt execution by daemon

>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@someplace.com address2@someserver.com
>addressN@anyserver.com</dev/null
>
>And .muttrc:
>
>set from=sender_email@somesite.com
>set envelope_from=yes
>set realname="Sender's Name"
>
>Hope this helps you
>Best

Hi,
That's similar to what I am doing, but "user" has a local mailbox, correct?
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 01-02-2010, 07:42 AM
Jose Maria Terry Jimenez
 
Default mutt execution by daemon

El 02/01/10 9:08, Joseph L. Casale escribió:
>> 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@someplace.com address2@someserver.com
>> addressN@anyserver.com</dev/null
>>
>> And .muttrc:
>>
>> set from=sender_email@somesite.com
>> set envelope_from=yes
>> set realname="Sender's Name"
>>
>> Hope this helps you
>> Best
>>
> Hi,
> That's similar to what I am doing, but "user" has a local mailbox, correct?
> _______________________________________________
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
>
Hello

Well, the user can receive mail locally if another mails using his name
in the host. ie if user_one does "mail user_two" then the user can write
mail to "user_two" but i don't know how to prevent this. The users
hasn't other kind of mailbox.

Do you mean this?

Remember i run from user's cron and i specify the shell, mailto, path...
to be used there... I think it would work even if i set the shell to
/bin/false to that user. Is this what you mean?

Best,
Jose Maria

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
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
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 01-02-2010, 01:03 PM
"Lucian @ lastdot.org"
 
Default mutt execution by daemon

On Sat, Jan 2, 2010 at 4:21 AM, Joseph L. Casale
<jcasale@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@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.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 01-02-2010, 03:00 PM
"Joseph L. Casale"
 
Default mutt execution by daemon

>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.

Yup, and I can specify all the particulars on the email as well, prob
is the receiver doesn't recognize uu

Mpack doesn't have the configurability that mutt does, looks like I have
to keep digging in to it...
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 01-02-2010, 03:39 PM
Les Mikesell
 
Default mutt execution by daemon

Joseph L. Casale wrote:
>> 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
>
> Hi,
> I am calling mutt like so:
> mutt -F /path/muttrc -a /path/file -s "text here" dest@example.com < /dev/null
>
> But as the user does not have a mailbox, it fails. I can't actually see what's
> going on obviously but as I tail the maillog and nothing even wakes it I am just
> making a WASG that I am pretty sure is right As there is and never was local mail
> delivery, root doesn't even have a mailbox so if I run it, I see it prompts for the
> mb...
>

You could probably strace the mutt run and wade through the output to see what
it is looking for. A quick-fix might be to touch /var/spool/mail/user if it
wants a mailbox there, or export HOME=/some/readable/path if it is looking for
$HOME/.muttrc or a maildir mailbox.

--
Les Mikesell
lesmikesell@gmail.com
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 01-03-2010, 08:48 PM
Dave
 
Default mutt execution by daemon

On Fri, Jan 1, 2010 at 9:03 PM, Joseph L. Casale
<jcasale@activenetwerx.com> wrote:
> I am calling mutt like so:
> mutt -F /path/muttrc -a /path/file -s "text here" dest@example.com < /dev/null
>
> But as the user does not have a mailbox, it fails

Silently?

I am confused by the '< /dev/null'. This means send no email body just
headers and attachment/MIME?


On Sat, Jan 2, 2010 at 6:39 AM, Les Mikesell <lesmikesell@gmail.com> wrote:
> A quick-fix might be to touch /var/spool/mail/user if it
> wants a mailbox there, or export HOME=/some/readable/path if it is looking for
> $HOME/.muttrc or a maildir mailbox.

That sounds like a good idea.

Dave
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 05:09 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org