MoonPoint Support Logo

 

Shop Amazon Warehouse Deals - Deep Discounts on Open-box and Used ProductsAmazon Warehouse Deals



Advanced Search
January
Sun Mon Tue Wed Thu Fri Sat
       
30 31
2026
Months
JanFeb Mar
Apr May Jun
Jul Aug Sep
Oct Nov Dec


Wed, Jan 28, 2026 2:57 pm

Masquerading a "from" address with sendmail

Many years ago, I distributed email to the mailing list for an organization through my email server. The person who sent out a monthly newsletter to the members of the organization had a Verizon email address and would send the newsletter via my server running Sendmail, which would then send the mail onwards to the organization's members. Since my server wasn't a designated email server for verizon.net addresses, I configured Sendmail to change the "from" domain to my server's domain name, moonpoint.com, so the sending address wouldn't be johnslartibartfast444@verizon.net but would be johnslartibartfast444@moonpoint.com; otherwise many recipients' email servers would reject the email since it didn't come from an email server designated to send email for verizon.net users. I put the following lines in /etc/mail/sendmail.mc (the last two lines are the ones I added to the Masquerade section of the file):
dnl # The following example makes mail from this host and any additional
dnl # specified domains appear to be sent from mydomain.com
dnl #
dnl MASQUERADE_AS(`mydomain.com')dnl
dnl #
dnl # masquerade not just the headers, but the envelope as well
dnl #
dnl FEATURE(masquerade_envelope)dnl
dnl #
dnl # masquerade not just @mydomainalias.com, but @*.mydomainalias.com as well
dnl #
dnl FEATURE(masquerade_entire_domain)dnl
dnl #
dnl MASQUERADE_DOMAIN(localhost)dnl
dnl MASQUERADE_DOMAIN(localhost.localdomain)dnl
dnl MASQUERADE_DOMAIN(mydomainalias.com)dnl
dnl MASQUERADE_DOMAIN(mydomain.lan)dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
dnl MAILER(cyrusv2)dnl
MASQUERADE_DOMAIN(`verizon.net')dnl
MASQUERADE_AS(`moonpoint.com')dnl

After I edited the sendmail.mc file, I rebuilt the sendmail.cf file by restarting sendmail with the command service sendmail restart , which put the following line in sendmail.cf:

C{M}verizon.net

The person who was sending the newsletter died several years ago and I took over maintaining the membership list for the organization as well as distributing the email version of the newsletters to members. Though the account from which the newsletter is sent is intended to be used only for sending the newsletter and members are advised to send an email related to the organization to the organization's Gmail email addresses, occasionally members will reply directly to the "from" address used for the newsletter. When checking the account for that address, I found that someone with a verizon.net address had sent a reply to the account, but if I replied my reply would go not to his verizon.net address, but to his email name followed by my domain name, which would result in the email bouncing since that address would not be a valid address on my server. I corrected the problem by removing the two MASQUERADE lines in sendmail.mc that resulted in the change to the domain name part of email addresses if any email came from a verizon.net address and then restarted sendmail, which resulted in the C{M}verizon.net line being removed from sendmail.cf.

The sendmail.mc file is a human-readable macro configuration file, while the sendmail.cf file is the more complex configuration file actually used by the Sendmail message transfer agent (MTA). The .mc file serves as the source, which is processed by the m4 macro to generate the final, often uncommented sendmail.cf file used by sendmail. The command m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf can be used to rebuild the .cf configuration file after one makes changes to the sendmail.mc file, but the changes won't take effect until sendmail is restarted. Or, on many newer versions of the Linux operating system, one can simply restart sendmail and a new .cf file will be automatically generated and applied to sendmail, if any changes have been made to the .mc file

References:

  1. 18.4. The sendmail.cf and sendmail.mc Files
    Linux Network Administrators Guide

Related articles:

  1. Modifying the "from" domain of a message with sendmail
    Date: June 1, 2018

[/network/email/sendmail] permanent link

Sun, Jan 18, 2026 4:51 pm

Installing Calibre on Ubuntu Linux

I installed Calibre 8.8.0 on a Ubuntu Linux system through the Ubuntu App Center (I had to filter by Debian packages rather than by Snap packages in the App Center to see Calibre packages as there isn't a Snap package for the software). But when I checked to see if that was the latest version on the Calibre website, I found the latest version is 8.16.2. Also, the Calibre Download for Linux page states "Please do not use your distribution provided calibre package, as those are often buggy/outdated. Instead use the Binary install described below." So I uninstalled the version I installed and then reinstalled the software using the command provided on that Calibre webpage, sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin - a command that can be run on any version of Linux.

[ More Info ]

[/ebook/calibre] permanent link

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo