# Sendmail help required



## umarif (Apr 11, 2019)

I am a new one and I want to setup Sendmail as a primary mail server.
can someone please guide me step by step how I should do it?

I am using FreeBSD 11.2-RELEASE (GENERIC) DNS (BIND 9.12.3-P4) is working fine.

when I send email from command
`mail -v myemailid@domain.com`

and I look into mail log

```
tail /var/log/maillog

Apr 11 11:25:25 mail2 sendmail[43452]: x3B6PH0T043452: to=myemailid@domain.com, ctladdr=umar (1001/0), delay=00:00:08, xdelay=00:00:00, mailer=relay, pri=30148, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (x3B6PPlr043453 Message accepted for delivery)
Apr 11 11:25:35 mail2 sm-mta[43455]: STARTTLS=client, relay=aspmx.l.google.com., version=TLSv1.2, verify=FAIL, cipher=ECDHE-RSA-AES128-GCM-SHA256, bits=128/128
Apr 11 11:25:36 mail2 sm-mta[43455]: x3B6PPlr043453: to=<test@abc.com>, ctladdr=<umar@mail2.mydomain.com> (1001/0), delay=00:00:11, xdelay=00:00:11, mailer=esmtp, pri=30488, relay=aspmx.l.google.com. [64.233.184.26], dsn=2.0.0, stat=Sent (OK  1554963971 x64si2523971wmb.196 - gsmtp)
```
I receive emails in my required email box but why I am getting it "relay=aspmx.l.google.com." in maillog
While I am not using google.com

Regards
Umar


----------



## SirDice (Apr 11, 2019)

I suspect Google is configured as a so-called smarthost. All non-local mail is then relayed to the smarthost and it's the smarthost's job to figure out where to send it next.

If you've never configured a mail server before Sendmail is somewhat unforgiving. It's syntax is horrid and it's incredibly easy to screw up. You're probably better off replacing it with mail/postfix or mail/exim. They're a lot easier to configure and there's plenty of tutorials to be found on the internet.

If you just need something simple that will accept mail and send it out, have a look at mail/dma.


----------



## umarif (Apr 12, 2019)

SirDice
Thank you for your comments, I am from a public sector university, our university need to send emails in bulk. We have 200,000+ students if all mails go through this so-called smart host, it will block my mail server after 10,000 emails. That is not good, I want to send emails from my local host only, without involving Google’s smtp server


----------



## SirDice (Apr 12, 2019)

umarif said:


> I am from a public sector university, our university need to send emails in bulk. We have 200,000+ students


I strongly urge you to find or hire someone that knows how to configure a mail server. Setting up a mail server is not easy. The only thing easy about a mail server is having it get abused by spammers and malware.


----------



## ucomp (Apr 12, 2019)

umarif said:


> ...
> will block my mail server after 10,000 emails. That is not good....



No, that's good.
There's only 1 man worldwide who is allowed to send more than 10.000 messages from his localhost :



 
... just kidding.
Here is one of the (superficial)discussions about relaying , not sendmail-related but after reading should be little clearer why the following is not possible without knowing the details of your environment :


umarif said:


> I want to send emails from my local host only


As SirDice hinted: that's a job for the IT-department of your university... imagine what happens when 200.000 amateurs are configuring the MTAs of your university ;-)


----------

