How to Configure Sendmail to Allow Email Relay from a Specific IP? Read the article to learn more.

Email Relay involves forwarding email messages from one server to another. When configured, Sendmail can accept and forward emails from a trusted IP address without further authentication.
Prerequisites
- Root or Sudo Access: Administrative privileges are required for configuration.
- Backup Configuration Files: Always back up the Sendmail configuration files to prevent data loss:
sudo cp -r /etc/mail /etc/mail.bak
How to Configure Sendmail in 6 Steps
Step 1: Edit the Access Database
The access database controls which systems can relay emails via Sendmail.
Open the Access File:
Edit the /etc/mail/access file using a text editor:
sudo vim /etc/mail/access
Add IP Address Entry:
Allow relaying for a specific IP address by adding:
Connect:XXX.XXX.X.XXX RELAY
Replace XXX.XXX.X.XXX with the desired IP address.
Allow Multiple IPs:
To allow relaying for multiple IPs, add a line for each IP in the same format:
Connect:192.168.1.100 RELAY
Connect:192.168.1.101 RELAY
Save and Exit:
Save the file and exit the editor.
Step 2: Rebuild the Access Database
Rebuild the access database to make the changes effective.
Run the following command to create a new access.db file:
sudo makemap hash /etc/mail/access < /etc/mail/access
Step 3: Edit the Main Configuration File
Open sendmail.mc:
Edit the /etc/mail/sendmail.mc file:
sudo vim /etc/mail/sendmail.mc
Uncomment Authentication Options:
Ensure the authentication line is not commented out. Modify:
dnl define(`confAUTH_OPTIONS’, `A p’)dnl
To:
define(`confAUTH_OPTIONS’, `A p’)dnl
Check for SMTP Authentication (optional):
If SMTP authentication is used, verify this line exists:
FEATURE(`authinfo’, `hash -o /etc/mail/authinfo/authinfo.db’)dnl
Save and Exit:
Save changes and close the file.
Step 4: Regenerate Configuration Files
Compile the changes into the sendmail.cf file.
Run the following command:
sudo make -C /etc/mail
Step 5: Restart the Sendmail Service
Restart the Sendmail service to apply the new configuration.
Restart Command:
sudo service sendmail restart
Verify Service Status (optional):
Check if the service is running correctly:
sudo service sendmail status
Step 6: Test Email Relay
To confirm the setup, send a test email from the configured IP address.
Send Test Email:
Run the following command:
echo “Test email from $(hostname -f)” | mail -s “Test Email” recipient@example.com
Check Logs:
Review mail logs for success or error messages:
sudo tail /var/log/maillog
Important Considerations no one will tell you about sendmail
1. Open relaying can expose the server to spam abuse. Restrict relaying strictly to trusted IP addresses.
2. Regularly review /var/log/maillog for suspicious activity or unauthorized relay attempts.
3. Combining IP-based relay with SMTP authentication adds an extra layer of security.
Kol3ktor :)
There’s a quiet insistence in your prose, a gentle pull toward reflection. It asks nothing overtly, yet encourages the mind to wander and consider with intent.
https://xmc.pl
jljl13
That’s a solid breakdown of the game – strategy is everything! Seeing platforms like jljl13 download cater to local payment options like GCash is smart; accessibility matters. Good insights on balancing risk & reward!
iamanus
Great insights! As someone who often searches for efficient AI tools, platforms like AIGO Tools save time and offer curated, vetted solutions-especially helpful for busy professionals looking to boost productivity.
mxbetcasino
Mxbetcasino, un casino más para la lista! Ya veremos si vale la pena. A ver si la pasamos bien y ganamos algo. Visita mxbetcasino.
pg13
Looking for something a bit tamer? pg13game is surprisingly fun. It has a good mix of casual and slightly more challenging games to keep you entertained. Perfect for killing some time. Give pg13 a go!
batpkrgame
Right, downloading batpkrgame now. Poker game with bats? Sounds a bit weird but could be fun! I’ll report back if I win big. Go try it yourself: batpkrgame
clb88game
CLB88game is cool. Quick access and lots to choose from. I’m not winning yet, but hey, that’s gambling. You should see if you have better luck though clb88game.
ssgame
Guys, ssgame offered some solid gaming. The experience was smooth. I’d recommend you give it a shot. Solid option.
okkingapp
Okkingapp looks like a fun way to spend my free time. Download here: okkingapp
377bet2
Thinking of trying out 377bet2. Has anyone used it before? I’m looking some insight before dipping. 377bet2
Emanuelkib
https://t.me/s/pov_1win