GMAIL is possible on NeXT systems!

Started by kb7sqi, October 24, 2007, 12:31:49 PM

Previous topic - Next topic


Hi all,
  In my continuing effort to make my systems more usable, I have successfully setup email w/ GMAIL.  :D   My one laptop is currently fetching email via secure IMAP and sending email via msmtp to google's smtp servers w/ a working ssl connection.  I'm even using the default  Here's a header for proof.

Received: by with SMTP id m5mr1402175wxb.1193249689098;
       Wed, 24 Oct 2007 11:14:49 -0700 (PDT)
Return-Path: <[email protected]>
Received: from localhost ( [])
       by with ESMTPS id h8sm1533866wxd.2007.
       (version=TLSv1/SSLv3 cipher=OTHER);
       Wed, 24 Oct 2007 11:14:47 -0700 (PDT)
Content-Type: text/plain
MIME-Version: 1.0 (NeXT Mail 4.2mach_patches v148.2)
Received: by NeXT.Mailer (148.2);
Date: Wed, 24 Oct 2007 14:14:40 -0400
To: [email protected]
Subject: Test
Reply-To: [email protected]
From: "Steven D. Blackford" <[email protected]>
Message-ID: <[email protected]>
Content-Length: 176

I did a quick port of msmtp that compiles clean w/ the compiler for OPENSTEP, so I need to test it on NEXTSTEP next.  Either way, I'll be making a package for it.  BTW, if you're curious about how to setup gmail w/ your system.  It basically comes down to using my port of fetchmail linked again openssl, procmail & then using msmtp for the mda.  It works great.  8)


wow! awesome :D I'd really been wanting to do this!

You are my new favorite person :P
After an apparent 15ish year hiatus... I'm baaaaack! :D (12/12/2023)


That sounds FANTASTIC!

I can't wait to see how it's done.. !

Good job btw!
# include <wittycomment.h>


Thanks guys.
    It's actually just like any other *nix box once you get fetchmail and msmtp working properly.  MSMTP was actually a pretty easy port.  I only had  to make one source code change & add a bunch of stuff to the config.h file.  :wink:   Then, to make it work w/, you simply change the sendmail command in the preferences to /usr/local/bin/msmtp.  Fetchmail runs as a daemon in the background pullilng all the mail to your system.  You have to grab the gmail ssl certificate, one from thawte & one from equifax.  I can post some urls for config information.    I was hoping using fetchmail w/ IMAP would work great, but after watching the system pull mail, it kept pulling the same new email over & over again.  So, I guess I'll either stick w/ POP3 or I'm going to have to look @ updating fetchmail.  The last time I looked @ that  though, they had added a bunch of POSIX stuff to the code, thus breaking it on NEXTSTEP/OPENSTEP.  :(  I'll try to put it on my list of stuff to do this week.  BTW, if you feel froggy, there's a package of msmtp for gecko & openstep x86 in  the packages directory now.  You can quickly google setting up gmail fetchmail msmtp and find all the information for setting it up.  :D   Take care.


BTW, I forgot to mention one thing, GMAIL is just one example that this setup will work for.  You could also use this w/ pretty much any email service/isp that requires secure authentication.  Since most isp are moving in that direction, that's why I was interested in getting it to work.  Take care.


I've actually never set up fetchmail or nextsteps before :] Guess  I will read up on it. heh.
After an apparent 15ish year hiatus... I'm baaaaack! :D (12/12/2023)


msmtp is packaged quad fat in my packages directory.  fetchmail will be following shortly.   :D


fetchmail is compiled/posted as well.   :lol:


Here's the Basic instructions on setting up Gmail w/  I'm providing the info on how you setup fetchmail/msmtp.  You need to setup as in explained in several faq's.

1. Enable POP in your Gmail account

2. mkdir ~/.certs

3. get Gmail SSL cert.

# echo bye | openssl s_client -connect -showcerts |
sed -n '/BEGIN/,/END/p' > ~/.certs/gmail.pem

4. Get Equifax's cert.

#wget -O ~/certs/equifax.pem

5. Get the Mozilla cacert.pem file from the curl web site, this is updated weekly:
# cd ~/.certs; wget

6. Set ownership/permissions on ~/.certs

#chmod 0700 ~/.certs
#chmod 0600 ~/.certs/*.pem

7. Rehash ~/.certs so openssl can read them
#c_rehash ~/.certs/

8. Test Certificates
#openssl s_client -connect -CApath ~/.certs/
... ...
+OK Gpop h19pf3704794wxd ready.

9. Setup fetchmail

#vi .fetchmailrc

Insert following:

# set polling time (no less than 5 minutes as required by gmail)
set daemon 600

poll with proto POP3
user '[email protected]' with password 'password' options ssl
sslcertck sslcertpath ~/.certs/ keep

Insert your username/password in the above example. :-)

10. Set permissions on .fetchmail

# chmod 0600 .fetchmailrc

11. Setup .msmtprc file

# vi .msmtprc

Insert the following:

account default
from [email protected]
tls on
tls_starttls on
tls_certcheck on
tls_trust_file ~/.certs/cacert.pem
auth on
port 587
user [email protected]
password password

12. Secure .mstmprc

#chmod 0600 .msmtprc

13. Now test & make sure you've got msmtp setup correctly & working w/ google's smtp server:

# msmtp --serverinfo --tls=on --port=587 \

The output should look similar:
-bash-2.05b$ msmtp --serverinfo --tls=on --port=587 \
>        --tls-trust-file=~/.certs/cacert.pem
SMTP server at, port 587: ESMTP p15sm405901ybk.37
TLS certificate information:
       Common Name:
       Organization: Google Inc
       Locality: Mountain View
       State or Province: California
       Country: US
       Common Name: Google Internet Authority
       Organization: Google Inc
       Country: US
       Activation time: Thu Apr 22 16:02:45 2010
       Expiration time: Fri Apr 22 16:12:45 2011
       SHA1: 1A:6F:48:8F:BE:5B:FD:92:D8:12:30:F9:22:CE:84:49:B3:43:BD:2C
       MD5:  60:39:DE:FB:0A:D9:9E:43:26:E7:75:AC:60:48:A1:B0
   SIZE 35651584:
       Maximum message size is 35651584 bytes = 34.00 MiB
       Support for TLS encryption via the STARTTLS command
       Supported authentication methods:

14. Now setup up

In the expert preferences of change the mailer from /usr/lib/sendmail to

You should also add the email_address setting in NetInfo like explained in the Sendmail FAQ.  That way your From Address show's properly.

Now, if you don't have sendmail setup on your system at all, you'll need procmail and the mailapp-utilities packages also.

then in your ~/.fetchmailrc you'll need to add the following

mda="/usr/local/bin/procmail -d %T"


I wanted to let everyone know, I've tested using the standard w/ my port of Stunnel-4.21.  You can set this up instead of using Fetchmail to pop3 your mail from GMAIL or any other system that requires SSL authentication for POP3/IMAP/SMTP.  You still need to use MSMTP for sending email to Google's SMTP servers.  I'll post details later on this evening.  Take care.


Ok, here's a quick setup guide for using stunnel w/ gmail.  You need my stunnel package and the prngd package as well.  Here's how I have my /etc/rc.local setup.  You setup stunnel to startup on boot up.

if [ -f /usr/local/sbin/prngd ]; then
       echo -n ' prngd' >/dev/console
       /usr/local/sbin/prngd /etc/egd-pool

if [ -f /usr/local/sbin/stunnel ]; then
       echo -n ' stunnel' >/dev/console
       /usr/local/sbin/stunnel /usr/local/etc/stunnel/stunnel.conf

In your /usr/local/etc/stunnel/stunnel.conf you need the following

client = yes
debug = 7
output = /usr/adm/stunnel.log

accept =
connect =

before starting stunnel, you need to touch /usr/adm/stunnel.log as root.  That way your logging works correctly.  Then once you fire up stunnel either by rebooting or just running the command above as root, you can startup  Simply add a new POP3 system.  Put localhost as your server.  Put your gmail [email protected] as your username & put in your gmail password as the password.

You can test to see if it works correctly by running the following:
-bash-2.05b$ stunnel -version
stunnel 4.21 on hppa-next-nextstep3 with OpenSSL 0.9.8g 19 Oct 2007

Global options
debug           = 5
EGD             = /etc/egd-pool
pid             = /usr/local/etc/stunnel/
RNDbytes        = 64
RNDoverwrite    = yes

Service-level options
cert            = /usr/local/etc/stunnel/stunnel.pem
ciphers         = AES:ALL:!aNULL:!eNULL:+RC4:@STRENGTH
key             = /usr/local/etc/stunnel/stunnel.pem
session         = 300 seconds
sslVersion      = SSLv3 for client, all for server
TIMEOUTbusy     = 300 seconds
TIMEOUTclose    = 60 seconds
TIMEOUTconnect  = 10 seconds
TIMEOUTidle     = 43200 seconds
verify          = none

-bash-2.05b$ telnet localhost 110
Trying Connected to localhost.
Escape character is '^]'.
+OK Gpop ready for requests from g34pf1208558rob

Here's a partial /usr/adm/stunnel.log

2007.11.08 00:07:08 LOG5[23576:0]: stunnel 4.21 on hppa-next-nextstep3 with OpenSSL 0.9.8g 19 Oct 2007
2007.11.08 00:07:08 LOG5[23576:0]: Threading:FORK SSL:ENGINE Sockets:SELECT,IPv42007.11.08 00:07:08 LOG6[23576:0]: file ulimit = 256 (can be changed with 'ulimit -n')
2007.11.08 00:07:08 LOG6[23576:0]: FD_SETSIZE = 256 (some systems allow to increase this value)
2007.11.08 00:07:08 LOG5[23576:0]: 125 clients allowed
2007.11.08 00:07:08 LOG7[23576:0]: FD 4 in non-blocking mode
2007.11.08 00:07:08 LOG7[23576:0]: FD 5 in non-blocking mode
2007.11.08 00:07:08 LOG7[23576:0]: FD 6 in non-blocking mode
2007.11.08 00:07:08 LOG7[23576:0]: SO_REUSEADDR option set on accept socket
2007.11.08 00:07:08 LOG7[23576:0]: pop3s bound to
2007.11.08 00:07:08 LOG7[23577:0]: Created pid file /usr/local/etc/stunnel/

You can check out for more information.   Again you'll still need my msmtp package to send email directly to the gmail smtp server.  Setup for that is the same as above.  Take care.


Quote from: "kb7sqi"
You should also add the email_address setting in NetInfo like explained in the Sendmail FAQ.  That way your From Address show's properly.

Hi, I've been attempting this on NEXTSTEP 3.3 (Intel), and I can't find the Sendmail FAQ (I'd like the From address to work). If you could post a link to it, that'd be great.



There's two ways to go about this, one is update your stock sendmail w/ one of the sendmail packages off one of the archive.  I've put a copy of the latest sendmail packages I had in my archives on my site  Also, in the misc directory, is a copy of TjL's cable-modem faq and there's a dhcp directory w/ the last packages made as well. For years, I kept sendmail upto date so, I already had my systems setup according to the sendmail FAQ that comes w/ the sendmail packages & then I started using postfix instead.  It still compiles clean on NEXTSTEP/OPENSTEP w/ out using the -posix flag.  :wink:   I have compiled a quad package for NEXTSTEP, but I haven't had time to archive it & package it up.  I'll try to get to that this weekend.

The other way to set the "From" field in is to the following:

 Menu: Info->Preferences,  PopUp: Expert

You should see a box that says "Additional Outgoing Headers"
add a set a Key value pair:

       Key     Value
       From    Your Name <[email protected]>

And I would also set the Reply-To as well, just to make sure.

Under 'Compose', you will see a field with 'Reply-To:' next to it.  Type the e-mail address of your POP/IMAP account in that field:

If you're just going to be using & w/ stunnel/msmtp, I'd go that route instead of upgrading/setting up sendmail.

Let me know if you have any problems.  I've been using w/ stunnel & using msmtp for outgoing mail w/ my Gecko & it's working great.  8) Take care.


Just another follow up real quick if you plan on wanting to setup procmail scripts to filter spam/organize mail, you'll definately want to grab the mailapp-utilities package off one of the archives & follow the examples.    Before I started using my gmail account for most of my mailing list stuff, I was using fetchmail/procmail/postfix for all my mail.  I had several procmail scripts to sort mail & get rid of spam.  Someone could write a book on all that though.  :lol: Besides a few problems w/ like html email, is still a great email client.  Take care.


I cannot send outgoing mail. I get no error messages, but the tests I send to myself (I'm using Verizon FiOS Webmail) do not arrive.

Please help,

P.S. Verizon FiOS blocks port 25, this would cause this, right? If so, how do I change the msmtp port?