Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 116637 - elog can-t send email thru common smtp...
Summary: elog can-t send email thru common smtp...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
: 125223 (view as bug list)
Depends on:
Blocks: 136244 137445
  Show dependency tree
 
Reported: 2005-12-24 11:54 UTC by Alessandro Sappia
Modified: 2006-06-20 18:07 UTC (History)
8 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
oneline patch (patch_mod_mail_add_MAILFROM_address.patch,455 bytes, patch)
2005-12-24 11:55 UTC, Alessandro Sappia
Details | Diff
Added setting PORTAGE_ELOG_MAILFROM to both return-path and from field (mod_mail2.patch,1.08 KB, patch)
2006-02-07 18:53 UTC, Bo Ørsted Andresen (RETIRED)
Details | Diff
another patch (portage_elog_mail_sender.patch,1.40 KB, patch)
2006-03-13 11:58 UTC, catfish
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alessandro Sappia 2005-12-24 11:54:29 UTC
I've faced with a problem with elog..
it can't sent email because of an invalid mail from address...

error is:
"!!! An error occured while trying to send logmail:\n(553, '<portage> Invalid mail address, must have a domain part', 'portage')"

I patched mod_mail.py to manage a real address (or a fake one but still in a valid form)...

check attachment for the patch
it's one line patch)
this adds PORTAGE_ELOG_MAILFROM as user variables - to let people write a good email address for them.
Comment 1 Alessandro Sappia 2005-12-24 11:55:16 UTC
Created attachment 75462 [details, diff]
oneline patch
Comment 2 Simon Stelling (RETIRED) gentoo-dev 2006-01-02 05:20:36 UTC
this bug hit me too, however i was not able to fix it with your patch. i think this is because of line 48 in mod_mail.py:

myconn.sendmail("portage", myrecipient, mymessage.as_string())

as you see, portage is still hardcoded there. I replaced it with "portage@blubb.ch" and got my mails :)

note that the mail does include 'Return-path: <portage@blubb.ch>' but it'd be nice if portage could also set 'From: <portage@blubb.ch>', otherwise chances are high that the mails are marked as junk
Comment 3 Bo Ørsted Andresen (RETIRED) gentoo-dev 2006-02-07 18:53:52 UTC
Created attachment 79186 [details, diff]
Added setting PORTAGE_ELOG_MAILFROM to both return-path and from field

You need to define which mail address to portage should send from
by adding:
PORTAGE_ELOG_MAILFROM="portage@domain.name"
to /etc/make.conf
portage@domain.name may be any mail address that the smtp
mail server accepts as valid.
Comment 4 Alexander Skwar 2006-03-04 01:38:49 UTC
Any rough estimates, about when this patch might get applied?
Comment 5 Simon Stelling (RETIRED) gentoo-dev 2006-03-06 08:26:50 UTC
*** Bug 125223 has been marked as a duplicate of this bug. ***
Comment 6 catfish 2006-03-13 11:58:00 UTC
Created attachment 82030 [details, diff]
another patch

Here is another patch.

It sets the correct sender depending on the mymailhost var with the least amount of configuration needed.
Comment 7 Tobias Klausmann (RETIRED) gentoo-dev 2006-03-31 01:51:50 UTC
I wonder why I get about one portage update in ~x86 per day, yet have to see anything on this front. Is the whole elog-system being reworked?
Comment 8 Tobias Klausmann (RETIRED) gentoo-dev 2006-04-24 02:06:44 UTC
Okay, so version 2.1_pre9-r4 fixes a lot of the issues.

But there's still no From: set (header field, not envelope from). Adding this is trivial. Just add 

mymessage["From"] = myfrom

below 

mymessage["To"] = myrecipient

in /usr/lib/portage/pym/elog_modules/mod_mail.py

Otherwise, some mail server setups refuse to accept the mail. Yes, this is according to RFCs. That most mail servers don't care doesn't mean it's best common practice.
Comment 9 Bo Ørsted Andresen (RETIRED) gentoo-dev 2006-04-25 04:39:53 UTC
(In reply to comment #8)
> Okay, so version 2.1_pre9-r4 fixes a lot of the issues.
> 
> But there's still no From: set (header field, not envelope from). Adding this
> is trivial.

As long as PORTAGE_ELOG_MAILFROM is set the From header field is set for me. 2.1_pre9-r4 fixes all issues for me so as far as I'm concerned this bug is resolved.
Comment 10 Alexander Skwar 2006-05-26 01:12:13 UTC
Will one of those patches find its way into portage 2.1?
Comment 11 Marius Mauch (RETIRED) gentoo-dev 2006-05-26 03:31:09 UTC
fixed some time ago.
Comment 12 Tobias Klausmann (RETIRED) gentoo-dev 2006-05-26 06:12:54 UTC
No it's not fixed. From: in header is *still* unset as per comment #7 .

At least in 2.1_rc2-r3.
Comment 13 Tobias Klausmann (RETIRED) gentoo-dev 2006-05-26 06:13:26 UTC
Sorry. #8.
Comment 14 catfish 2006-05-26 08:51:47 UTC
I suppose I should have responded sooner but I was waiting to see what would develop.  I have to agree with Tobias.

If mail is going off-server, it must append at least the domain name.  The PORTAGE_ELOG_MAILFROM is a hack that must be configured on a server on any kind of modern network.  If I change the the server name, then I must remember to change this setting or things will break.  If I assign the server name via DHCP, I must remember to connect to the server and fix this setting or things will break.  Features should work properly in the default state.

The alternative is to run a proper mail server on the host and forward portage mail from it.  I don't know why I should be forced into running a full mail server just to make use of this feature.  If portage at least called /bin/mail, it would work properly whether one was using postfix or SSMTP or any other RFC compliant mail daemon.  I would be happy if the setting took variable substitution like "PORTAGE_ELOG_MAILFROM=portage@`/usr/bin/hostname -f`" but it doesn't.

Thanks for reading.
Comment 15 Tobias Klausmann (RETIRED) gentoo-dev 2006-06-09 12:09:35 UTC
This is still not fixed, yet I've just read the announcement of 2.1 final. 

Please tell me if I'm an idiot, because I sure feel treated like one.
Comment 16 Zac Medico gentoo-dev 2006-06-09 17:14:08 UTC
This bug was supposedly fixed in svn r3014.  Doesn't PORTAGE_ELOG_MAILFROM work as per comment #9?  Comment #14 seems like an enhancement request that is worthy of a new bug.
Comment 17 Tobias Klausmann (RETIRED) gentoo-dev 2006-06-10 02:10:55 UTC
Re #16:

It *seems* to me that the poster of #9 has some setup in which the header field is added by the (local?) MTA according to the Envelope-From. That isn't the case for me and the Mailserver I use (and am forced to use) does not set that field (and late-rejects mails that don't a valid From:). My fix (as per #8) fixes it for me, but it's not that great having to edit the mod_mail.py script every time I update portage.
Comment 18 Bo Ørsted Andresen (RETIRED) gentoo-dev 2006-06-10 02:26:53 UTC
(In reply to comment #17):
What did you set PORTAGE_ELOG_MAILFROM to in /etc/make.conf? The mail server of my ISP still rejects the mails with the "Sender address rejected: need fully-qualified address" if I don't set PORTAGE_ELOG_MAILFROM in /etc/make.conf. I am not really sure what kind of setup you think I have (didn't understand it) but I think you are wrong. :)
Comment 19 Tobias Klausmann (RETIRED) gentoo-dev 2006-06-10 02:45:15 UTC
I set it to fully qualified address that the MTA I'm using knows about (or rather: its validity). When I send mail, the complaint I get from the Server is as follows:

"!!! An error occured while trying to send logmail:\n(550, 'no valid sender in Sender:, Reply-To:, or From:')"

Looking at the traffic with ethereal shows that indeed there's no From: header in the mail. Many MTAs don't care about it, but it's still in violation of RFC 2822 (Part 3.6.2., "Originator fields").
Comment 20 Tobias Klausmann (RETIRED) gentoo-dev 2006-06-10 02:55:24 UTC
As an illustration (true mx name edited out due to other concerns):

220 mx.someisp.invalid ESMTP Exim 4.61-RC1 Sat, 10 Jun 2006 11:49:16 +0200
MAIL FROM:klausman@schwarzvogel.de
250 OK
RCPT TO:klausman@schwarzvogel.de
250 Accepted
DATA
354 Enter message, ending with "." on a line by itself
Subject: Foo
To: klausman@schwarzvogel.de

haha!
.
550 no valid sender in Sender:, Reply-To:, or From:
MAIL FROM:klausman@schwarzvogel.de
250 OK
RCPT TO:klausman@schwarzvogel.de
250 Accepted
DATA
354 Enter message, ending with "." on a line by itself
Subject: Foo
To: klausman@schwarzvogel.de
From: klausman@schwarzvogel.de

haha!
.
250 OK id=1Fp06O-0002In-D3
Comment 21 Marius Mauch (RETIRED) gentoo-dev 2006-06-10 14:43:35 UTC
Added in svn r3483
Comment 22 Zac Medico gentoo-dev 2006-06-10 17:00:42 UTC
Reopenning until svn r3483 has been released...
Comment 23 Tobias Klausmann (RETIRED) gentoo-dev 2006-06-11 02:18:44 UTC
Had a peek at the repo. Looks great. Thanks.
Comment 24 Zac Medico gentoo-dev 2006-06-16 10:00:48 UTC
This has been released in 2.1.1_pre1.