|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
Preparing for Sendmail rite of Passage
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. Last edited by shep; 13th March 2013 at 02:18 AM. Reason: Mutt-sasl |
|
||||
OK; there was a brief window where I was close enough to grab the configuration. I've redacted my userid and password.
Note this is -current, there were syntax changes to the configuration file in late January. Code:
$OpenBSD: smtpd.conf,v 1.6 2013/01/26 09:38:25 gilles Exp $ listen on lo0 listen on rl0 table aliases db:/etc/mail/aliases.db table myauth { userid => userid:password } accept from any for local alias <aliases> deliver to mbox accept from any for domain "jggimi.homeip.net" alias <aliases> deliver to mbox accept for any relay via \ tls+auth://userid@outbound.mailhop.org auth <myauth> |
|
|||
This made my day :-)
|
|
|||
@jggimi
Thanks for the links. Overall OpenSMTPD looks to parallel the OpenBSD philosophy. 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" 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. Last edited by shep; 13th March 2013 at 08:24 PM. |
|
||||
all you need is http://www.openbsd.org/cgi-bin/man.c...penBSD+Current
|
|
|||
I'm still unclear if smtpd will delete the messages on mail.earthlink.net 110.
I did find an smtpd.conf option 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. Would you recommend using fetchmail or can I specify message retrieval in OpenSMTPD to download a message copy and leave the original on the server? Thanks Last edited by shep; 13th March 2013 at 11:41 PM. |
|
||||
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:
Quote:
Quote:
Quote:
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. Last edited by jggimi; 14th March 2013 at 12:40 PM. Reason: clarity - dynamic address spam blocking |
|
|||
@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.
@jggimi I'm going to restate this to make sure I understand: user********/var/mail/user***************Earthlink mutt <--------------->mbox *******************mbox--OpenSMTPD ---> smtpauth port 587 *******************mbox<-fetchmail--------mail port 110 Optionally mutt + pop3 <---------------------------------- mail port 110 mutt + pop3 <-------->mbox 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 Last edited by shep; 14th March 2013 at 02:54 PM. Reason: edit Added additional OpenSMTPD illustrations + DynDNS |
|
||||
MTA = Mail Transfer Agent. AKA "Email Server". MTAs: Sendmail, Postfix, MS Exchange, OpenSMTPD....
MUA = Mail User Agent. AKA "Email application". MUAs: Thunderbird, Mutt, MS Outlook, Eudora.... Quote:
[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. [Your MUA] - {ESMTP/SMTP} - [OpenSMTPD] - {ESMTP/SMTP} - [Earthlink MTA] - {SMTP} - [Destination MTA] In my case, Email comes to me through OpenSMTPD in this way: [Sending MTA] - {ESMTP/SMTP} - [mailhop MTA] - {ESMTP} - [OpenSMTPD] -> local mboxes in /var/mail Local MUAs use the mbox files for received mail, and communicate with OpenSMTPD directly only for outbound traffic. Last edited by jggimi; 14th March 2013 at 02:45 PM. Reason: clarity |
|
|||
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. Last edited by shep; 14th March 2013 at 07:49 PM. |
|
||||
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:
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.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. |
|
|||
Almost there. I can send local mail via OpenSMTPD. I am shifting through some syntax issues, made tougher by the recent updates.
I found this recent thread: Quote:
Code:
label myusername<at>earthlink.net:mypasswd My etc/mail/smtpd.conf Code:
# $OpenBSD: smtpd.conf,v 1.6 2013/01/26 09:38:25 gilles Exp $ # This is the smtpd server system-wide configuration file. # See smtpd.conf(5) for more information. # To accept external mail, replace with: listen on all # listen on lo0 listen on ral0 table aliases db:/etc/mail/aliases.db table elink_auth db:/etc/mail/elink_auth.db # Uncomment the following to accept external mail for domain "example.org" # accept from any for domain "earthlink.net" alias <aliases> deliver to mbox accept for local alias <aliases> deliver to mbox accept for any relay via \ tls+auth://label@smtpauth.earthlink.net:587 \ auth <elink_auth> Code:
Peng$ send-mail: command failed: 550 Invalid recipient Last edited by shep; 15th March 2013 at 12:13 AM. |
|
|||
I found in a recent gmane post
Quote:
Quote:
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. My new smtpd.conf Quote:
Last edited by shep; 15th March 2013 at 03:28 AM. Reason: turn off smilies |
|
||||
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.)
|
|
|||
*****SUCCESS*****
The picky syntax in table names and an incorrect entry in the aliases file /etc/mail/aliases was Code:
myname<at>earthlink.net: jsh Code:
myname: jsh |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sendmail TLS | gpatrick | OpenBSD General | 5 | 26th February 2011 01:42 AM |
Sendmail | Timmy66 | OpenBSD General | 11 | 19th October 2008 03:01 PM |
sendmail dont boot | dejabu18 | FreeBSD Ports and Packages | 0 | 8th October 2008 02:07 PM |
Using sendmail in a cron job | erehwon | OpenBSD General | 6 | 15th May 2008 09:03 PM |
Sendmail, issues... | pcfxer | FreeBSD General | 2 | 8th May 2008 10:07 AM |