question about sendmail

John Duncan agley at beagle.com.au
Wed Aug 30 16:44:43 PDT 2006


On Wed, Aug 30, 2006 at 07:54:19PM +0200, Saverio Iacovelli wrote:
> 1)iacovelli_mail at xxxxxxxx is my mailbox on
> www.yahoo.it. I did not test sendmail.
> 2) I mistaked, I read README file, after I read
> sendmail.cf, but I don't know how add  feature and how
> configure it. Can I found a .cf if example?
> 
> 
> Saverio

     Well Saverio,
                  First of all we need to know if you are running a
network, or a stand-alone machine. The fact that you are with Yahoo
for mail makes it a lot harder, they have some undocumented quirks
apparently.

                 If you intend to persevere with DragonFlyBSD I would
really suggest changing to a mail provider that is more interested in
using Open Source solutions, you will have a lot less problems. That
said I believe Yahoo uses SMTP AUTH but uses some fancy redirecting
at their mail servers to control spam. This may have changed since I
looked around, I have seen talk about something called DomainKeys on
the internet.

                 Most of the information you seek can be found in the
FreeBSD Handbook,but changes to their ideas are needed for DragonFly.
I always make a user with the same username as I have with the mail
provider and send my mail from this account.

                 To get SMTP AUTH support from pkgsrc install
security/cyrus-sasl2 security/cy2-plain security/cy2-login, nearly
all the ISP's only support these two. Then rebuild the system with the
following in /etc/make.conf

SENDMAIL_CFLAGS+= -I/usr/pkg/include -DSASL=2
SENDMAIL_LDFLAGS+= -L/usr/pkg/lib
SENDMAIL_LDADD+= -lsasl2

                Next go to /etc/mail and in the aliases file make the
user you intend to use for mailing the alias for root, in the form of
user at yourhostname. Then run newaliases.
Now odds are you are not permanently on-line so you will have to run the
mail queues manually as root to work sendmail.

# /usr/sbin/sendmail -q -v
# /usr/sbin/sendmail -Ac -q -v

               after you set up the configuration files.

               Now go to /usr/share/sendmail/cf/cf and /etc/mail this is
where these config files live. I am going to assume you are not on-line
all the time. There is no need to change dragonfly.submit.mc so submit.cf
will be O.K. Copy dragonfly.mc to your hostname.mc ( this is just a
convention ) and put the following after the line about Dialup users.

define(`SMART_HOST', `smtp.yourmailhost.com.it')dnl
define(`SMTP_MAILER_FLAGS', `e')dnl
define(`confCON_EXPENSIVE', `True')dnl
define(`confTO_QUEUEWARN', `16h')dnl
MASQUERADE_AS(`yahoo.it')dnl
FEATURE(`masquerade_envelope')dnl
FEATURE(`authinfo', `hash /etc/mail/authinfo.db')dnl
define(`confAUTH_MECHANISMS', `LOGIN PLAIN')dnl
define(`confAUTH_OPTIONS', `A p y')dnl
TRUST_AUTH_MECH(`LOGIN PLAIN')dnl

                Obviously you may need to change the name of your SMARTHOST
to suit. This is where the spam redirection comes in for Yahoo, you may have
to put all or part of this SMARTHOST name into square brackets.

                To make this hostname.mc into a cf file last time I tried you
just can't run make in /etc/mail because it will try to pick up freebsd.mc
every time ( a leftover from FreeBSD days I suppose ) so do this

# m4 /usr/share/sendmail/cf/m4/cf.m4 hostname.mc > hostname.cf

               Then back-up your sendmail.cf in /etc/mail and install this
hostname.cf as /etc/mail/sendmail.cf.

               To get DragonFly to use the sasl libraries after you have
rebuilt Sendmail put this in /etc/rc.conf

ldconfig_paths="$ldconfig_paths /usr/pkg/lib"

               Now you just need to set up your authinfo by making a file in
/etc/mail called authinfo and hashing it into a database.
              This is what is in mine

Authinfo:smtp.yourmailhost.com.it "U:root" "I:username at xxxxxxxx" "P:password" "M:LOGIN PLAIN"

             This needs to be one line. As you can see I have made a guess at
your setup so change anything that is wrong. Make it into a hash like

# makemap hash authinfo < authinfo

or

# /usr/sbin/sendmail -bi -oA/etc/mail/authinfo

            After all this I would just reboot to straighten
everything out.


         Now to be clear this is just for sending mail to a SMARTHOST as
root using Sendmail as supplied in DragonFly, it may not work with Yahoo
but it does work with my ISP. Also it is for a setup where your machine
has no network set-up locally in other words a stand-alone machine. I
am assumming this is your set-up.

                               Best of Luck,
                                  John Duncan


-- 
The best-laid schemes o' mice an' men
Gang aft agley                                   Robert Burns 1785





More information about the Users mailing list