public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Making PORTAGE_ELOG use /usr/sbin/sendmail
@ 2006-05-26 10:48 Alexander Skwar
       [not found] ` <20060526143255.7c432b46@hactar.digimed.co.uk>
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Skwar @ 2006-05-26 10:48 UTC (permalink / raw
  To: gentoo-user

Hallo.

I'd like portage to use /usr/sbin/sendmail (and thus ssmtp, nbsmtp
or what not) to send out mails, instead of having it try to connect
to some SMTP server.

How can this be done?

Alexander Skwar
-- 
The only "intuitive" interface is the nipple.  After that, it's all learned.
	-- Bruce Ediger, bediger@teal.csn.org, on X interfaces
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-user] Making PORTAGE_ELOG use /usr/sbin/sendmail
       [not found] ` <20060526143255.7c432b46@hactar.digimed.co.uk>
@ 2006-05-26 15:38   ` Alexander Skwar
  2006-05-26 17:36     ` Alexander Skwar
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Skwar @ 2006-05-26 15:38 UTC (permalink / raw
  To: gentoo-user

Neil Bothwick wrote:
> On Fri, 26 May 2006 12:48:47 +0200, Alexander Skwar wrote:
> 
>> I'd like portage to use /usr/sbin/sendmail (and thus ssmtp, nbsmtp
>> or what not) to send out mails, instead of having it try to connect
>> to some SMTP server.
> 
> You can use PORTAGE_ELOG_COMMAND to call any command with the log
> information.

# PORTAGE_ELOG_COMMAND: only used with the "custom" logging module. Specifies a command
#                      to process log messages. Two variables are expanded:
#                          ${PACKAGE} - expands to the cpv entry of the processed
#                                       package (see $PVR in ebuild(5))
#                          ${LOGFILE} - absolute path to the logfile #                                               Both variables have to be quoted with single quotes #PORTAGE_ELOG_COMMAND="/path/to/logprocessor -p '${PACKAGE}' -f '${LOGFILE}'"
#PORTAGE_ELOG_COMMAND="/path/to/logprocessor -p '${PACKAGE}' -f '${LOGFILE}'"

Okay.

I've now got:

PORTAGE_ELOG_COMMAND="/usr/local/bin/portage-elog-command.sh to@example.net from@example.com '\${PACKAGE}' '\${LOGFILE}'"

- "to@example.net" is to be replaced with the recipient address
	-> Matches recipient address from PORTAGE_ELOG_MAILURI
- "from@example.com" is to be replaced with the sender address
	-> Matches PORTAGE_ELOG_MAILFROM

/usr/local/bin/portage-elog-command.sh:
#! /bin/sh

# Recipient address
to="$1"
# Sender address
from="$2"
# ${PACKAGE} - expands to the cpv entry of the processed
# package (see $PVR in ebuild(5))
pvr="$3"
# ${LOGFILE} - absolute path to the logfile - This will
# make up the e-mail body
log_file="$4"

# Name of the host from which this mail is sent
hostname=`hostname -f`
# Sender "full name"
from_fullname="Portage Log Message"

( printf "From: %s (%s)\nTo: %s\nSubject: [portage] ebuild log for %s on %s\n\n" \
         "$from" "$from_fullname" "$to" "$pvr" "$hostname"
   cat "$log_file"
) | sendmail -bm "$to"

Alexander Skwar
-- 
	"I keep seeing spots in front of my eyes."
	"Did you ever see a doctor?"
	"No, just spots."
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-user] Making PORTAGE_ELOG use /usr/sbin/sendmail
  2006-05-26 15:38   ` Alexander Skwar
@ 2006-05-26 17:36     ` Alexander Skwar
  0 siblings, 0 replies; 3+ messages in thread
From: Alexander Skwar @ 2006-05-26 17:36 UTC (permalink / raw
  To: gentoo-user

Alexander Skwar wrote:
> Neil Bothwick wrote:
>> On Fri, 26 May 2006 12:48:47 +0200, Alexander Skwar wrote:
>> 
>>> I'd like portage to use /usr/sbin/sendmail (and thus ssmtp, nbsmtp
>>> or what not) to send out mails, instead of having it try to connect
>>> to some SMTP server.
>> 
>> You can use PORTAGE_ELOG_COMMAND to call any command with the log
>> information.
[...]
> Okay.
> 
> I've now got:
[...]

Added this to the wiki at
<http://gentoo-wiki.com/TIP_Making_portage_use_/usr/sbin/sendmail_to_send_out_ELOG_mails>.

Alexander Skwar
-- 
Q:	What happens when four WASPs find themselves in the same room?
A:	A dinner party.
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-05-26 17:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-26 10:48 [gentoo-user] Making PORTAGE_ELOG use /usr/sbin/sendmail Alexander Skwar
     [not found] ` <20060526143255.7c432b46@hactar.digimed.co.uk>
2006-05-26 15:38   ` Alexander Skwar
2006-05-26 17:36     ` Alexander Skwar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox