Re: Help setting up email with opensmtp.

2018-02-24 Thread mazocomp
On Fri, Feb 23, 2018 at 08:06:23PM +, Stuart Henderson wrote:
> On 2018-02-23, ed...@pettijohn-web.com  wrote:
> >
> > On Feb 22, 2018 9:44 PM, mazocomp  wrote:
> >>
> >> On Thu, Feb 22, 2018 at 08:36:49PM -0600, Edgar Pettijohn wrote:
> >> > However, with this setup you should be able to just use sendbug(1).
> >> > 
> >> > sendbug will envoke sendmail aka smtpctl and then submit it your local 
> >> > smtpd
> >> > who will then relay it via gmail.
> >>
> >> Hi!
> >>
> >> Excuse me for ignorant question below. I don't have external server, so
> >> I use remote e-mail provider: I configured mutt to fetch mail via IMAP
> >> and send mail via SMTP.
> >>
> >> My question is if I'll use only base utilities (for example, mail(1)),
> >> with that configuration I will only be able to send mail, but not
> >> receive it, won't I? (I hope there is a way to use mail(1) without
> >> having external server)
> >>
> >
> > To my knowledge there is nothing in base to fetch from an imap/pop server.
> > However, there are some utilities in ports that do. But if you're
> > going to go that route you may as well just use mutt in my humble
> > opinion.
> 
> I would recommend fdm (in packages) if you need to fetch from an
> IMAP/POP server to a local mail file or maildir.
> 
> For sending via a remote provider you can configure smtpd to handle
> SMTP authentication for sending, there's an example in the manual.
> 
> 

Thank you!

Now it's time to learn fdm and goodbye mutt :)



Re: Help setting up email with opensmtp.

2018-02-23 Thread leroy jordan
Awesome, thanks!  very informative thank you very much.
 thanks Leroy Jordan

On Feb 23, 2018 3:50 PM, "Stuart Henderson"  wrote:

On 2018/02/23 15:32, leroy jordan wrote:
>  can you be more pacific on the fdm what does it stand for. so when I go
to pkg_add I can then
> read the Man page please.

$ pkg_info fdm
Information for inst:fdm-1.9p0

Comment:
fetch, filter and deliver mail

Description:
fdm is a simple, lightweight replacement for mail fetch, filter and
delivery programs such as fetchmail and procmail. It can fetch using
POP3 or IMAP (with SSL) or from stdin, and deliver to a pipe, file,
maildir, mbox or SMTP server, based on regexps.

Maintainer: Nicholas Marriott 


$ pkg_info -f fdm | grep -e man/ -e bin/
@bin bin/fdm
@man man/man1/fdm.1
@man man/man5/fdm.conf.5



The fdm(1) manpage is reasonably simple, but fdm.conf(5) is a bit more
complicated, if you'd like a nicer-formatted one for printing you can do:

$ man -T pdf fdm.conf > /tmp/fdm.conf.pdf

Or view it directly if you have mupdf installed:

$ MANPAGER=mupdf man -T pdf fdm.conf

If you like this way of viewing a manpage and think you might use it
often, you might like a shell alias which you could add to your .profile:

$ alias pdfman="MANPAGER=mupdf man -T pdf"
$ pdfman fdm.conf


Re: Help setting up email with opensmtp.

2018-02-23 Thread Stuart Henderson
On 2018/02/23 15:32, leroy jordan wrote:
>  can you be more pacific on the fdm what does it stand for. so when I go to 
> pkg_add I can then
> read the Man page please.

$ pkg_info fdm
Information for inst:fdm-1.9p0

Comment:
fetch, filter and deliver mail

Description:
fdm is a simple, lightweight replacement for mail fetch, filter and
delivery programs such as fetchmail and procmail. It can fetch using
POP3 or IMAP (with SSL) or from stdin, and deliver to a pipe, file,
maildir, mbox or SMTP server, based on regexps.

Maintainer: Nicholas Marriott 


$ pkg_info -f fdm | grep -e man/ -e bin/
@bin bin/fdm
@man man/man1/fdm.1
@man man/man5/fdm.conf.5



The fdm(1) manpage is reasonably simple, but fdm.conf(5) is a bit more
complicated, if you'd like a nicer-formatted one for printing you can do:

$ man -T pdf fdm.conf > /tmp/fdm.conf.pdf

Or view it directly if you have mupdf installed:

$ MANPAGER=mupdf man -T pdf fdm.conf

If you like this way of viewing a manpage and think you might use it
often, you might like a shell alias which you could add to your .profile:

$ alias pdfman="MANPAGER=mupdf man -T pdf"
$ pdfman fdm.conf



Re: Help setting up email with opensmtp.

2018-02-23 Thread Stuart Henderson
On 2018-02-23, ed...@pettijohn-web.com  wrote:
>
> On Feb 22, 2018 9:44 PM, mazocomp  wrote:
>>
>> On Thu, Feb 22, 2018 at 08:36:49PM -0600, Edgar Pettijohn wrote:
>> > However, with this setup you should be able to just use sendbug(1).
>> > 
>> > sendbug will envoke sendmail aka smtpctl and then submit it your local 
>> > smtpd
>> > who will then relay it via gmail.
>>
>> Hi!
>>
>> Excuse me for ignorant question below. I don't have external server, so
>> I use remote e-mail provider: I configured mutt to fetch mail via IMAP
>> and send mail via SMTP.
>>
>> My question is if I'll use only base utilities (for example, mail(1)),
>> with that configuration I will only be able to send mail, but not
>> receive it, won't I? (I hope there is a way to use mail(1) without
>> having external server)
>>
>
> To my knowledge there is nothing in base to fetch from an imap/pop server.
> However, there are some utilities in ports that do. But if you're
> going to go that route you may as well just use mutt in my humble
> opinion.

I would recommend fdm (in packages) if you need to fetch from an
IMAP/POP server to a local mail file or maildir.

For sending via a remote provider you can configure smtpd to handle
SMTP authentication for sending, there's an example in the manual.




Re: Help setting up email with opensmtp.

2018-02-23 Thread edgar

On Feb 22, 2018 9:44 PM, mazocomp  wrote:
>
> On Thu, Feb 22, 2018 at 08:36:49PM -0600, Edgar Pettijohn wrote:
> > However, with this setup you should be able to just use sendbug(1).
> > 
> > sendbug will envoke sendmail aka smtpctl and then submit it your local smtpd
> > who will then relay it via gmail.
>
> Hi!
>
> Excuse me for ignorant question below. I don't have external server, so
> I use remote e-mail provider: I configured mutt to fetch mail via IMAP
> and send mail via SMTP.
>
> My question is if I'll use only base utilities (for example, mail(1)),
> with that configuration I will only be able to send mail, but not
> receive it, won't I? (I hope there is a way to use mail(1) without
> having external server)
>

To my knowledge there is nothing in base to fetch from an imap/pop server. 
However, there are some utilities in ports that do. But if you're going to go 
that route you may as well just use mutt in my humble opinion. 



Re: Help setting up email with opensmtp.

2018-02-22 Thread mazocomp
On Thu, Feb 22, 2018 at 08:36:49PM -0600, Edgar Pettijohn wrote:
> However, with this setup you should be able to just use sendbug(1).
> 
> sendbug will envoke sendmail aka smtpctl and then submit it your local smtpd
> who will then relay it via gmail.

Hi!

Excuse me for ignorant question below. I don't have external server, so
I use remote e-mail provider: I configured mutt to fetch mail via IMAP
and send mail via SMTP.

My question is if I'll use only base utilities (for example, mail(1)),
with that configuration I will only be able to send mail, but not
receive it, won't I? (I hope there is a way to use mail(1) without
having external server)



Re: Help setting up email with opensmtp.

2018-02-22 Thread Carson Chittom
leroy jordan  writes:

> Thanks!  I will let you know the results thanks.  One more question, is
> there a man page for the secrets.

The secrets are documented in smtpd.conf(5), if I'm understanding your
question correctly.  Take a look at the EXAMPLES section.



Re: Help setting up email with opensmtp.

2018-02-22 Thread leroy jordan
Thanks!  I will let you know the results thanks.  One more question, is
there a man page for the secrets.
Leroy Jordan

On Feb 22, 2018 9:37 PM, "Edgar Pettijohn"  wrote:

>
>
> On 02/22/18 19:44, leroy jordan wrote:
>
> Sure, here it is.
>
> listen on lo0
> listen on egress port 25 tls pki mail.example.com
> listen on egress port 587 tls-require pki mail.example.com auth 
>
> accept for local alias  deliver to mbox
> accept from local for any relay
>
> pki mail.example.com.crt certificate "/etc/ssl/mail.example.com.crt"
> pki mail.example.com.key key "/etc/ssl/private/mail.example.com.key"
>
>
> Do the above files exist?
>
>
> table aliases file:/etc/mail/aliases
>
> table domains file:/etc/mail/domains
>
> table passwd file:/etc/mail/passwd
>
> table viruals file:/etc/mail/viruals
>
> accept from local for local alias  deliver to lmtp
> "/var/dovecot/lmtp" rcpt-to
>
> accept from any for domain  virtual  deliver to lmtp
> "/var/dovecot/lmtp" rcpt-to
>
> accept from local for any relay
>
> Thanks for the help Leroy Jordan
>
> On Feb 22, 2018 8:21 PM,  wrote:
>
>> Please provide your smtpd.conf.
>> On Feb 22, 2018 6:51 PM, leroy jordan  wrote:
>> >
>> > hello all,
>> >
>> > I'm trying to set up my email.conf. So I can send my Dmessage + log
>> files.
>> > I don't know the way to attach the log files so I can send via my Gmail
>> > account. I've used this as  https://www.opensmtpd.org/faq/example1.html
>> a
>> > point of reference.  However,  when I try to start smtpd I get an error
>> > message saying that pki name not found: mail.example.com.
>> > So asking a two-part question?  I'm kind of confused as it says when I
>> > update my alias run newaliases.  Output message pki name not found:
>> > mail.example.com.
>> >
>> > Thinks Leroy Jordan
>>
>
> You probably just need something similar to:
>
> # cat /etc/mail/smtpd.conf
>
> table aliases file:/etc/mail/aliases
> table secrets file:/etc/mail/secrets
>
> listen on lo0
> accept from local for any relay via tls+auth://"label"@"gmail.com:587"
> auth 
>
> replace "label" with a label of your choosing and "gmail.com:587" with
> gmail's actual submission address:port combo. The  file should
> look something like:
>
> label u...@gmail.com:password
>
> I don't recall the specific permissions requirements for the secrets file,
> but you don't want it to be world readable for sure. As your password will
> be plaintext. As far as attaching goes it depends on your MUA. However,
> with this setup you should be able to just use sendbug(1).
>
> sendbug will envoke sendmail aka smtpctl and then submit it your local
> smtpd who will then relay it via gmail.
>


Re: Help setting up email with opensmtp.

2018-02-22 Thread Edgar Pettijohn



On 02/22/18 19:44, leroy jordan wrote:

Sure, here it is.

listen on lo0
listen on egress port 25 tls pki mail.example.com 

listen on egress port 587 tls-require pki mail.example.com 
 auth 


accept for local alias  deliver to mbox
accept from local for any relay

pki mail.example.com.crt certificate "/etc/ssl/mail.example.com.crt"
pki mail.example.com.key key "/etc/ssl/private/mail.example.com.key"


Do the above files exist?



table aliases file:/etc/mail/aliases

table domains file:/etc/mail/domains

table passwd file:/etc/mail/passwd

table viruals file:/etc/mail/viruals

accept from local for local alias  deliver to lmtp 
"/var/dovecot/lmtp" rcpt-to


accept from any for domain  virtual  deliver to 
lmtp "/var/dovecot/lmtp" rcpt-to


accept from local for any relay
Thanks for the help Leroy Jordan

On Feb 22, 2018 8:21 PM, > wrote:


Please provide your smtpd.conf.
On Feb 22, 2018 6:51 PM, leroy jordan mailto:leroy.j.jor...@gmail.com>> wrote:
>
> hello all,
>
> I'm trying to set up my email.conf. So I can send my Dmessage +
log files.
> I don't know the way to attach the log files so I can send via
my Gmail
> account. I've used this as
https://www.opensmtpd.org/faq/example1.html
 a
> point of reference.  However,  when I try to start smtpd I get
an error
> message saying that pki name not found: mail.example.com
.
> So asking a two-part question?  I'm kind of confused as it says
when I
> update my alias run newaliases.  Output message pki name not found:
> mail.example.com .
>
> Thinks Leroy Jordan



You probably just need something similar to:

# cat /etc/mail/smtpd.conf

table aliases file:/etc/mail/aliases
table secrets file:/etc/mail/secrets

listen on lo0
accept from local for any relay via tls+auth://"label"@"gmail.com:587" 
auth 


replace "label" with a label of your choosing and "gmail.com:587" with 
gmail's actual submission address:port combo. The  file should 
look something like:


label u...@gmail.com:password

I don't recall the specific permissions requirements for the secrets 
file, but you don't want it to be world readable for sure. As your 
password will be plaintext. As far as attaching goes it depends on your 
MUA. However, with this setup you should be able to just use sendbug(1).


sendbug will envoke sendmail aka smtpctl and then submit it your local 
smtpd who will then relay it via gmail.


Re: Help setting up email with opensmtp.

2018-02-22 Thread leroy jordan
Sure, here it is.

listen on lo0
listen on egress port 25 tls pki mail.example.com
listen on egress port 587 tls-require pki mail.example.com auth 

accept for local alias  deliver to mbox
accept from local for any relay

pki mail.example.com.crt certificate "/etc/ssl/mail.example.com.crt"
pki mail.example.com.key key "/etc/ssl/private/mail.example.com.key"

table aliases file:/etc/mail/aliases

table domains file:/etc/mail/domains

table passwd file:/etc/mail/passwd

table viruals file:/etc/mail/viruals

accept from local for local alias  deliver to lmtp
"/var/dovecot/lmtp" rcpt-to

accept from any for domain  virtual  deliver to lmtp
"/var/dovecot/lmtp" rcpt-to

accept from local for any relay

Thanks for the help Leroy Jordan

On Feb 22, 2018 8:21 PM,  wrote:

> Please provide your smtpd.conf.
> On Feb 22, 2018 6:51 PM, leroy jordan  wrote:
> >
> > hello all,
> >
> > I'm trying to set up my email.conf. So I can send my Dmessage + log
> files.
> > I don't know the way to attach the log files so I can send via my Gmail
> > account. I've used this as  https://www.opensmtpd.org/faq/example1.html
> a
> > point of reference.  However,  when I try to start smtpd I get an error
> > message saying that pki name not found: mail.example.com.
> > So asking a two-part question?  I'm kind of confused as it says when I
> > update my alias run newaliases.  Output message pki name not found:
> > mail.example.com.
> >
> > Thinks Leroy Jordan
>


Re: Help setting up email with opensmtp.

2018-02-22 Thread edgar
Please provide your smtpd.conf.
On Feb 22, 2018 6:51 PM, leroy jordan  wrote:
>
> hello all,
>
> I'm trying to set up my email.conf. So I can send my Dmessage + log files.
> I don't know the way to attach the log files so I can send via my Gmail
> account. I've used this as  https://www.opensmtpd.org/faq/example1.html  a
> point of reference.  However,  when I try to start smtpd I get an error
> message saying that pki name not found: mail.example.com.
> So asking a two-part question?  I'm kind of confused as it says when I
> update my alias run newaliases.  Output message pki name not found:
> mail.example.com.
>
> Thinks Leroy Jordan