Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 22658 - [UPDATE] ssmtp-2.60.3-r1.ebuild
Summary: [UPDATE] ssmtp-2.60.3-r1.ebuild
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Nick Hadaway
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-12 00:16 UTC by Fernando J. Pereda (RETIRED)
Modified: 2003-10-17 22:45 UTC (History)
1 user (show)

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


Attachments
(update - tls) ssmtp-2.60.3-r1.ebuild (ssmtp-2.60.3-r1.ebuild,2.18 KB, text/plain)
2003-06-16 11:17 UTC, Fernando J. Pereda (RETIRED)
Details
(update - ssl) ssmtp-2.60.3-r1.ebuild (ssmtp-2.60.3-r1.ebuild,2.18 KB, text/plain)
2003-06-16 11:20 UTC, Fernando J. Pereda (RETIRED)
Details
(update - neither ssl nor tls) ssmtp-2.60.3-r1.ebuild (ssmtp-2.60.3-r1.ebuild,2.21 KB, text/plain)
2003-06-16 11:23 UTC, Fernando J. Pereda (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fernando J. Pereda (RETIRED) gentoo-dev 2003-06-12 00:16:24 UTC
I have added some code to pkg_config and put it as pkg_postinst so the config
file is being configured by portage.
Comment 1 Fernando J. Pereda (RETIRED) gentoo-dev 2003-06-12 00:29:51 UTC
I paste here the pkg_postinst section because I don't know why, but I can't attach a file:

pkg_postinst() {

        local conffile="/etc/ssmtp/ssmtp.conf"
        local hostname=`hostname -f`
        local domainname=`hostname -d`
        mv ${conffile} ${conffile}.orig
        sed -e "s:rewriteDomain=:rewriteDomain=${domainname}:g" \
                -e "s:_HOSTNAME_:${hostname}:" \
                -e "s:^mailhub=mail:mailhub=mail.${domainname}:g" \
                ${conffile}.orig > ${conffile}.pre

        if [ `use ssl` ];
        then
                sed -e "s:^#UseTLS=YES:UseTLS=YES:g" \
                        ${conffile}.pre > ${conffile}
                mv ${conffile}.pre ${conffile}.orig
        else
                mv ${conffile}.pre ${conffile}
        fi
}

Regards.
Ferdy
Comment 2 Nick Hadaway 2003-06-14 10:39:10 UTC
Nice improvement :)  I have added this code to the ebuild.
Comment 3 Aron Griffis (RETIRED) gentoo-dev 2003-06-16 10:47:30 UTC
This is not a good improvement.  It screws up existing ssmtp.conf because it's done in pkg_postinst() instead of src_install().  It needs to be done in the latter so that CONFIG_PROTECT is respected.

For example my (previously working) ssmtp.conf now says:

    rewriteDomain=zk3.dec.comzk3.dec.com

along with other bad things.
Comment 4 Fernando J. Pereda (RETIRED) gentoo-dev 2003-06-16 10:51:48 UTC
That's right !!!!! aaaaaaaagh ;)

Ok, I'll try using src_install.

If I get good results I'll post the new ebuild.

sorry :(

Regards,
Ferdy
Comment 5 Aron Griffis (RETIRED) gentoo-dev 2003-06-16 10:52:14 UTC
Also I don't think that USE=ssl is a good basis for UseTLS=YES.  Many users want ssl for browsers, etc. but have mailservers that don't support TLS.  I'd suggest either (1) using a new USE=tls flag or (2) leaving the setting commented by default in the ssmtp configuration, to be uncommented only by admins who know what they're doing.

Either way, please don't make it dependent on USE=ssl
Comment 6 Aron Griffis (RETIRED) gentoo-dev 2003-06-16 10:53:19 UTC
Thanks Ferdy :-)
Comment 7 Fernando J. Pereda (RETIRED) gentoo-dev 2003-06-16 10:55:29 UTC
Well...... people should use emerge -vp ssmtp so the can see which USEs are going to be considered... I think it should depend on SSL instead on TLS, but it's ok if you think it should depend on TLS, I'll make it depending on TLS.

Regards,
Ferdy
Comment 8 Aron Griffis (RETIRED) gentoo-dev 2003-06-16 11:01:55 UTC
(Note I don't think there's a tls USE-flag yet...)
Comment 9 Fernando J. Pereda (RETIRED) gentoo-dev 2003-06-16 11:04:58 UTC
I know, but maybe is time to add it :) I don't know who manage USE variables, but I've noticed that there are many packages that uses lots of non-defined USE variables.

I have here an ebuild working..... I make it depending on SSL or TLS.

You are the devs :) so it is up to you ;)

Regards,
Ferdy
Comment 10 Aron Griffis (RETIRED) gentoo-dev 2003-06-16 11:08:46 UTC
Personally, I'd prefer if it weren't dependent on either.  I'll let raker choose what he wants to do... it's his bug. ;-)
Comment 11 Fernando J. Pereda (RETIRED) gentoo-dev 2003-06-16 11:11:43 UTC
Hehe, ok, I'll post three ebuilds so raker can choose what 'policy' he agrees :)

1) Depending on SSL
2) Depending on TLS
3) Depending on ANYTHING ;)

Regards,
Ferdy
Comment 12 Fernando J. Pereda (RETIRED) gentoo-dev 2003-06-16 11:17:44 UTC
Created attachment 13373 [details]
(update - tls) ssmtp-2.60.3-r1.ebuild

It depends on USE=ssl.

(in all ebuilds the problem Aron reported is fixed)
Comment 13 Fernando J. Pereda (RETIRED) gentoo-dev 2003-06-16 11:18:53 UTC
Comment on attachment 13373 [details]
(update - tls) ssmtp-2.60.3-r1.ebuild

It uses USE=tls
Comment 14 Fernando J. Pereda (RETIRED) gentoo-dev 2003-06-16 11:20:54 UTC
Created attachment 13374 [details]
(update - ssl) ssmtp-2.60.3-r1.ebuild

It uses USE=ssl
Comment 15 Fernando J. Pereda (RETIRED) gentoo-dev 2003-06-16 11:23:25 UTC
Created attachment 13375 [details]
(update - neither ssl nor tls) ssmtp-2.60.3-r1.ebuild

This doesn't set up the config file. (It has all new stuff commented out)
Comment 16 Nick Hadaway 2003-06-16 11:42:58 UTC
I personally thought it was nice to have the appropriate configuration setup "out of the box"... 

i.e. - When net-mail/courier is installed and you run ebuild /var/db/pkg/foo/bar-1.2.3.ebuild config; imaps,pop3s, and smtps services are setup and turned on when starting the mailserver.

Somebody who doesn't want the TLS functionality could easily do a USE="-ssl" while building ssmtp... I think adding a tls flag would just confuse things for users.
Comment 17 Nick Hadaway 2003-07-09 13:23:14 UTC
I have removed the auto ssl config generation code.
Comment 18 Aron Griffis (RETIRED) gentoo-dev 2003-07-09 20:11:06 UTC
Nick, I really don't mind if you would rather have this dependent on USE=ssl.  I didn't mean to throw a wrench in the works.  The main problem was that it needs to occur in src_install instead of pkg_postinst.  So long as that's solved, I'm happy.
Comment 19 Nick Hadaway 2003-07-10 03:17:43 UTC
The code is commented and back in src_install... i mulled over this issue for a couple weeks... and came to the point where I realized... only people who are more experienced and professional users will need the ssl config... so they will look deeper into the ebuild to uncomment associated code.
Comment 20 Nick Hadaway 2003-10-17 22:45:36 UTC
ssmtp-2.60.4 is currently in portage and seems to be working quite well.