I was moderately successfull setting up sendmail, fetchmail and msmtp in FreeBSD but gave up on the project when several "DBATCH" builds failed to work.

I think I can duplicate the fetchmail setup to fetch mails from mail.earthlink to /var/mail/user and was happy with my muttrc configuration.

The challenge is to send smtp authenticated mail to smtpauth.earthlink.net on port 587. What I am unclear on is if I can avoid msmtp and configure sendmail with smarthost. I found an older openbsd howto. Earthlink does require a password but sasl is optional. Another option I found was to recompile sendmail with cyrus-sasl but this seems overly involved for my needs which is why I originally went with msmtp. I am also using current w/o a source tree although I think I could cvs one.

I also found recommendations for OpenSMTPD to replace sendmail but it looks like development has been in bursts.

Any recommendations as to how to tackle this with binary, current packages?

Edit: I was looking at openports and it looks like there is a development version of mutt with sasl support. My initial searches did not show much documentation or comments about the stability of the newer version so I am leaning toward msmtp.

I think I have most of it set up, there are some older howto's on the net that seem to use deprecated syntax.

Two questions remaining
1) In the muttrc you have to set the default mta which in the example muttrc was

Code:

set sendmail="/usr/lib/sendmail -oi -oem"

I'm guessing that I retain this line with the changes I made to the /etc/mail.conf wrapper script or would it be cleaner to go directly to /usr/sbin/smtpctl or would that mess up the rest of the /etc/mail.conf settings?
2) I pull mail to mobile computers and would like to not delete the emails on mail.earthlink.net (particularly while I'm fiddling with this). I read the smtpd.conf(5) and smtpd(8) man pages and did not see any settings to explicitly leave the messages on the server. In fetchmail there is an explicit setting.

shep, I'd like to introduce you to Gilles Chehade (gilles@), the lead developer for OpenSMTPD.

gilles, thanks for stopping in to say hello!

Quote:

Originally Posted by shep

2) I pull mail to mobile computers and would like to not delete the emails on mail.earthlink.net (particularly while I'm fiddling with this). I read the smtpd.conf(5) and smtpd(8) man pages and did not see any settings to explicitly leave the messages on the server. In fetchmail there is an explicit setting.

I can't help you with this one, as MTA-MTA communication is not mail retrieval (POP/IMAP), instead its SMTP or ESMTP.

Quote:

Originally Posted by shep

I'm still unclear if smtpd will delete the messages on mail.earthlink.net 110.

This is for internal retention within the MTA spool for outgoing messages that cannot be delivered.

Quote:

It looks like mutt can be configured with an to enable-pop3 but it looks like the OpenBSD default mutt port does not have this specified.

The example configuration I shared above is for a complete MTA: outgoing Email is sent via ESMTP to mailhop.org, incoming Email is sent to mbox files in /var/mail.

To operation a two-way fully functing mail server requires a public DNS entry with an MX record pointing to the mail server so that other MTAs can find and connect with the server. In my case, the MX record for jggimi.homeip.net points to mx1.mailhop.org, which is the MTA-of-record for my site. My personal site sits on a pool of dynamic IP addresses, which many MTAs would refuse to deliver to or receive from. I can understand why they would refuse to receive it -- to block spambots -- but to send to it? That's a misguided effort to prevent spam.

Keep in mind - mail clients, such as mail(1), use SMTP to send Email messages. Just like servers do.

I recommend you use OpenSMTPD for sending of Email, and use POP or IMAP to receive, unless you want to set up a mail server able to participate in two-way transfer of Email.

@gilles I started with the email section in AbsoluteBSD by Michael Lucus. He noted that sendmail is complex because the world is complex. He also said that he was proud that he could set it up but it was like boasting that you can crush a full can of beer on your forehead. OpenSMPTD looks to address a complex task with simplicity and elegance.

OpenSMTPD can also deliver to another local user's mbox
********************mbox-jsh ----OpenSMTPD --->|
********************mbox-root<---------------------
OpenSMTPD needs aDNS server to function to outside the LAN eg communicate with
other full fledge mail servers like earthlink gmail, comcast, hotmail etc.
It looks like I need to read more on setting up DynDNS

Yep. But when you mention port 110, you are referring to the destination port used by POP. POP and IMAP are the protocols used for MUA/MTA communication, solely for receipt of mail to the MUA.

[sending MTA] - {SMTP} - [Earthlink MTA] - {POP} - [Your MUA].

OpenSMTPD would not be involved in this at all.

For sending email, OpenSMTPD would be your local MTA for outbound traffic only. Outbound, MUAs use SMTP or ESMTP. For a Mutt client on the same platform, this might be no more than SMTP via localhost port 25.

I conceptualize the process in terms of 1) physical locations of the files (user home directory, /var and remote send and receive directories) and 2) unidirectional, address and port specific movements between the physical locations.

What was confusing was that in my prior implementation of fetchmail, the pop3 part put the messages into /var/mail/user as did sendmail. Incoming messages all passed through /var/mail/user and that is where they sat until I accessed them with mutt. My prior email MUA (Claws-Mail) bypassed /var/mail/user and used an inbox file at /home/user/Mail/inbox. The other confusing part was that I had the idea that sendmail+sasl would perform the same function as fetchmail in the same way. Fetchmail does not require a DynDNS account.

With mutt, messages do not exist in my home directory unless I either save them, save a copy of sent messages or park them there as unsent drafts. In Thunderbird/Claws Mail they are sitting in the equivalent of a saved file until they are deleted or "moved".

You put a lot of time into this - thanks. Hopefully this will help someone in the future.

Sending Email only takes an Email client, or even a manual SMTP session typed in by hand with telnet(1). That's because many MTAs do not require any authentication to send. Your "From" and optional "Reply to" addresses are not required to be real.

Receiving Email adds only the need for an Email account on an MTA somewhere, and some Email client software.

Quote:

I'm starting to get this.

Excellent. Here's some deep background:

Unix-based Email, which became Internet Email, was in use many years before there was an Internet; the connections were point-to-point, using UUCP.

You had to know your own routing and apply it in the Email address. The "bang path" listed the adjacent computers and the user account.

(example: machine1!machine2!machine3!username).

Email was store-and-forward. Once machine2 acknowledged receipt of a message from machine1, responsibility for the message shifted, and machine1 would delete the message from its storage.

In modern times, Email doesn't take a circuitous path, and you don't have to look at anyone's "bang path" Email address to find a machine mentioned along it that you've heard of and know how to route to.

This means to have an MTA to receive mail, you need to publish MX records so that the Internet can reach it, and to send, you'll likely need to send from a static IP address. I do this with dyn.com (used to be dyndns.org) for DNS and their mailhop.org MTA services; it's cheaper than hosting a dedicated MTA via a service provider -- even on a virtual machine in the cloud.

++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++
This first example is the same as the default configuration, but all
outgoing mail is forwarded to a remote SMTP server. A secrets file
is needed to specify a username and password:

table name [type:]config
Tables are used to provide additional configuration information
for smtpd(8) in the form of lists or key-value mappings.

The table is identified using table name name; the name itself is
arbitrarily chosen.

type specifies the table backend, and should be one of the
following:

db Information is stored in a file created using
makemap(8).
file Information is stored in a plain text file using the
same format as used to generate makemap(8) mappings.
This is the default.

I did generate an elink_auth.db file using makemap.

I will change to the inline userid:passwd to see if this is the issue. A co-worker recently had a home break in with his computer being a stolen item. I thought it would be a good ideal to make a db file and if successful delete the plain text file.

Progress: apparently one cannot use an underscore in a table name. I regenerated the secrets file without an underscore it went out without any error messages. It has yet to show up at earthlink but that is not unusual. It is also not sitting in my /var/log/user file.

What was confusing was that in my prior implementation of fetchmail, the pop3 part put the messages into /var/mail/user as did sendmail.

Yup, that's because, by default, fetchmail sends (by SMTP) the mail that it picks up to the local MTA such as sendmail, if you're using that. So in the end sendmail puts the mail in its mailbox for you. (You can change the default from local host to another machine with the -S option.)