
What does /etc/mailname do? - susam
https://wiki.debian.org/EtcMailName
======
susam
I posted this two days ago. I believe a moderator must have rescued this post
today to bring it to the front page.

By the way, I posted this link because I've been running my own mail transfer
agent (MTA) for my personal vanity domain to send/receive emails for about 10
years now and I often forget why I need to edit /etc/mailname while setting up
the MTA, so I posted this link to HN as a bookmark for myself. (Who else uses
HN submissions as bookmarks?)

I use Exim 4 as my MTA on Debian GNU/Linux. During its setup, among many other
things, I need to configure /etc/mailname with the domain name I want to see
in the "From:" field of outgoing security notification emails, e.g., email
notifications for failed sudo attempts.

If you want to take a look at my MTA setup, see this Makefile:
[https://github.com/susam/susam.in/blob/master/mta/Makefile](https://github.com/susam/susam.in/blob/master/mta/Makefile)

Related Show HN post:
[https://news.ycombinator.com/item?id=22299169](https://news.ycombinator.com/item?id=22299169)

~~~
hamnspam
Is it possible to run own SMTP server these days and send emails successfully?
I thought GMail will classify it as spam. How do you tell the big email
providers to not classify email originating from personal domain as spam?

~~~
inopinatus
Totally possible. Run SPF, DKIM, and DMARC, have correct forward and reverse
DNS, have reliable DNS servers for every lookup, forward with ARC, deliver
with a valid certificate, prefer IPv6, and have all associated IP addresses
and sender (SMTP envelope) domains with a very good reputation. This last part
takes months if not years to build, it’s not hard, but it’s not fast.

I use separate sender domains for a newsletter than for transactional mail.

You can monitor reputation with Gmail and Outlook postmaster tools, and there
are various sites that will mass query RBLs; worth checking occasionally. I
have a monthly reminder in the calendar. Sign up for the JMRP and SNDS.

Then just behave like a responsible sender. Don’t send unsolicited mail. Make
it easy to unsubscribe, with RFC8085 headers and easily found unsubscribe
links. Honour unsubscribes instantly. Honour spam reports instantly with a
suppression list. Make the first statement of your communication one that
describes the purpose; the second, the unsubscribe link. _Make it easier, both
functionally and emotionally, for recipients to unsubscribe rather than to
report you as junk_.

Run your emails through SpamAssassin before sending, and respect and
understand the scoring. Read the Gmail sender guidelines
([https://support.google.com/mail/answer/81126](https://support.google.com/mail/answer/81126)),
they are good advice.

Include a plain text part.

Do not trust anyone claiming you can pay to improve reputation. That is snake
oil.

~~~
anticodon
No.

GMail is arbitrarily blocking ip addresses or subnets and there's nothing you
can do about it.

One year ago I've purchased a VPS with a clean IP address (checked against all
DNSBLs), set up mail server with SMTP and IMAP server, set up SPF, DKIM and
DMARC and was able to successfully send emails to Gmail for 3 months.

After 3 months GMail stopped accepting mail from my server saying that my ip
address was used to send spam. I'm pretty much sure it wasn't me. My VPS OS
and mail server are up to date, there was no suspicious activity in the logs,
so it's very unlikely that I was hacked.

There're only three possible explanations for it: 1\. My VPS was hacked indeed
2\. Some bad guy from the same IP network sent spam (although GMail error
message specifically states that spam was sent by this exact IP address, not
an address from the same network). 3\. GMail just randomly blocks access to
any little guy trying to setup independent mail server just because they can.

I'll never know the truth but it was very disappointing experience. Also, lost
couple of semi-important emails this way.

~~~
oarsinsync
> 2\. Some bad guy from the same IP network sent spam (although GMail error
> message specifically states that spam was sent by this exact IP address, not
> an address from the same network).

This is the most likely situation. If a VPS provider is sufficiently cheap, it
will attract the wrong people, who will then get the entire VPS provider's IP
blocks blacklisted.

It's a shame, but it's the reality. There are lots of discussions around this
subject on various mailing lists, where people from the likes of Gmail have
chimed in stating as much.

I would reckon it takes as little as 10% of the addresses in a /24 (so ~25
IPs) to get that entire netblock blacklisted.

If you want a higher probability of clean IPs, you need to be using a provider
that is sufficiently expensive to not attract spammers.

Either that, or you need your own IPs.

~~~
tambre
> Either that, or you need your own IPs.

Or just use IPv6, which will probably fix this.

~~~
scintill76
Why is this considered a useful signal by Gmail? Isn't it cheaper for a
spammer to get throwaway IPv6 addresses?

~~~
inopinatus
Most spammers aren’t competent to provision an IPV6 service correctly,
especially one with matched PTR and SPF(TXT) records, and using throwaway v6
addresses makes SPF much harder. It’s also easy to spot, at which point you
can tag the sender domain with a bad reputation.

It’s no surprise that Gmail et al are more interested in sender domain
reputation, and also the graph of related domains, than they were a few years
ago.

------
mirimir
tl;dr - It depends on who's asking.

------
rstuart4133
It's described pretty well here:
[https://wiki.debian.org/EtcMailName](https://wiki.debian.org/EtcMailName)

On Debian update-exim4.conf writes whatever is in there into exim4
configuration files it builds in /etc/exim4. I have no idea why they do that -
exim4 could just as happily read it from that file every time it needs it.

~~~
cs101
Isn't this link same as OP?

