MoonPoint Support Logo

 


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



Advanced Search
December
Sun Mon Tue Wed Thu Fri Sat
           
14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
2018
Months
Dec


Fri, Jun 01, 2018 10:11 pm

Modifying the "from" domain of a message with sendmail

A user sends a monthly email newsletter to a distribution list on an email server I maintain that uses sendmail. He sends the message to an email alias on the system where sendmail converts the alias to all of the email addresses in the mailing list and the sends it out through a smart host to be delivered to all of the recipients of the newsletter. The sender sends the message from his verizon.net address and I needed to convert the "from" address from a verizon.net email address to a local email address on the server running sendmail. To do so, I placed the following lines at the end of /etc/mail/sendmail.mc. For the example below, I use the example.com domain as the local domain name for the server.

MASQUERADE_DOMAIN(`verizon.net')dnl
MASQUERADE_AS(`example.com')dnl

Note: the "dnl" at the end of each line has the letter "l", not the number "1" at the end of the line. And a backtick, i.e., `, is used before "verizon.net" while a single quote is used after it.

[ More Info ]

[/network/email/sendmail] permanent link

Sat, Jan 06, 2018 5:01 pm

Configuring Sendmail to always allow Steam email

A family member wasn't receiving email for a Steam account she created to play a PC game. Her email comes through a Sendmail email server I manage and I found that a Domain Name System-based Blackhole List (DNSBL), the Spam and Open Relay Blocking System (SORBS), had blocked email from the IP address that Valve had for the email server used to send email to her about the account. When I checked the sendmail log file, I found the following two entries:

Dec 29 21:10:26 moonpoint sendmail[27413]: ruleset=check_relay, arg1=smtp03.stea
mpowered.com, arg2=127.0.0.6, relay=smtp03.steampowered.com [208.64.202.39], rej
ect=550 5.7.1 Spam Block:mail from 208.64.202.39 refused - see http://dnsbl.sorb
s.net/
Dec 29 21:17:35 moonpoint sendmail[27661]: ruleset=check_relay, arg1=smtp01.stea
mpowered.com, arg2=127.0.0.6, relay=smtp01.steampowered.com [208.64.202.37], rej
ect=550 5.7.1 Spam Block:mail from 208.64.202.37 refused - see http://dnsbl.sorb
s.net/

Checking, I found the following IP addresses and fully qualified domain names (FQDNs) for Steam email servers:

IP AddressFQDN
208.64.202.36 smtp.steampowered.com
208.64.202.37 smtp01.steampowered.com
208.64.202.38 smtp02.steampowered.com
208.64.202.39 smtp03.steampowered.com
208.64.202.40 steammail.steampowered.com

To ensure that none of the DNSBLs I use with Sendmail will ever block email from the Steam email servers, I added the following lines to /etc/mail/access:

Connect:208.64.202.36                           OK
Connect:208.64.202.37                           OK
Connect:208.64.202.38                           OK
Connect:208.64.202.39                           OK
Connect:208.64.202.40                           OK

I then used the makemap hash command to rebuild the access database.

# makemap hash /etc/mail/access </etc/mail/access
#

Once I did that, she was able to receive the Steam-related email.

[/network/email/sendmail] permanent link

Thu, Jan 05, 2017 4:02 pm

Email stuck in the sendmail queue

A user repoted that she didn't receive an email someone sent her today. I checked the /var/log/maillog file to see if the mail server, which is running Sendmail, received the email. When I searched on part of the sender's email address, I saw the message had been received by the mail server:

# grep sbear /var/log/maillog
Jan  5 14:08:08 moonpoint sendmail[6276]: v05IxmvR006276: from=<sbearab1@y0hoo.c
om>, size=2339942, class=0, nrcpts=1, msgid=<1226622358.574156.1483642780691@mai
l.y0hoo.com>, proto=ESMTP, daemon=MTA, relay=omp1011.mail.ne1.y0hoo.com [98.138.
87.11]

So I checked Sendmail's queue with the mailq command and saw the message was stuck there. Note: Mailq is identical to sendmail -bp .

# mailq
                        /var/spool/mqueue (1 request)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
v05IxmvR006276  2338155 Thu Jan  5 14:08 <sbearab1@y0hoo.com>
                 (host map: lookup (yahoo.com): deferred)
                                         <abad_kitty@moonpoint.com>
                Total requests: 1
#

The sendmail queue can be flushed with the command sendmail -q -v .

#  sendmail -q -v

Running /var/spool/mqueue/v05IxmvR006276 (sequence 1 of 1)
<abad_kitty@moonpoint.com>... aliased to ann
ann... Connecting to local...
ann... Sent
# mailq
/var/spool/mqueue is empty
                Total requests: 0
#

The meaning of the -q and -v options to the sendmail command are shown below:

  -q[time]
              Process saved messages in the queue at given intervals.  If time
              is  omitted,  process the queue once.  Time is given as a tagged
              number, with `s' being seconds, `m' being minutes (default), `h'
              being  hours, `d' being days, and `w' being weeks.  For example,
              `-q1h30m' or `-q90m' would both set  the  timeout  to  one  hour
              thirty  minutes.   By  default,  sendmail  will run in the back-
              ground.  This option can be used safely with -bd.

      -v     Go into verbose mode.  Alias expansions will be announced, etc.

[/network/email/sendmail] permanent link

Sat, Sep 03, 2016 9:26 pm

SparkPost smart host issue with Sendmail

I recently created a SparkPost account to use SparkPost for smart host email delivery service for an organization's monthly newsletter distribution by email. SparkPost provides a free level of service that will allow one to send up to 100,000 messages per month. I had switched back to another service, but when I discovered a problem with deliveries through the other service yesterday, I reconfigured Sendmail to use the SparkPost SMTP server as the smart host. To use the SparkPost SMTP server, smtp.sparkpostmail.com, as the smart host, I had the following lines in /etc/mail/sendmail.mc, but email was not reaching recipients.

dnl # Uncomment and edit the following line if your outgoing mail needs to
dnl # be sent out through an external mail server:
dnl #
define(`RELAY_MAILER_ARGS', `TCP $h 587')
define(`ESMTP_MAILER_ARGS', `TCP $h 587')
define(`SMART_HOST', `smtp.sparkpostmail.com')dnl

[ More Info ]

[/network/email/sendmail] permanent link

Sat, Sep 03, 2016 1:37 pm

Deleting the files associated with a mailq entry

While troubleshooting an email delivery problem on a CentOS 7 Linux server running Sendmail, I saw an unexpected entry when I checked the mail queue with the mailq command.

# mailq
                /var/spool/mqueue (7 requests)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
u83BWu3X020476     1010 Sat Sep  3 07:32 <apache@example.com>
                 (Deferred: Connection refused by mail.user-mail.net.)
                                         <donniemenniti12345@yahoo.com>

The system was running Apache, but I would not expect any email to originate from Apache destined for a Yahoo email address.

The contents of queued email are stored in the /var/spool/mqueue directory. For a queued message there will normally be two files, one beginning with the letters "df" and the other with the letters "qf", containing the queue id, in this case u83BWu3X020476, as the rest of the file name.

# ls /var/spool/mqueue/??u83BWu3X020476
/var/spool/mqueue/dfu83BWu3X020476  /var/spool/mqueue/qfu83BWu3X020476
#

Note: you will only be able to access these files from the root account.

[ More Info ]

[/network/email/sendmail] permanent link

Fri, Sep 02, 2016 10:32 pm

No longer need to run m4 to rebuild sendmail.cf under CentOS 7

When I was running Sendmail on a CentOS 5 server, I needed to use the m4 command after modifying /etc/sendmail.mc to rebuild /etc/sendmail.cf from that file, i.e., m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf. E.g., see Configuring Sendmail to Use a Smart Host, but that is no longer needed with CentOS 7 and, though I went from CentOS 5 to 7, may have gone away as a needed step in CentOS 6. Now, if you modify /etc/sendmail.mc, when you restart sendmail, e.g., with service sendmail restart, the sendmail.cf file is automatically rebuilt.

[ More Info ]

[/network/email/sendmail] permanent link

Thu, Aug 18, 2016 10:46 pm

Bitdefender milter causing Sendmail restart failure

I needed to change the smart host setting for a Sendmail email server, so I edited /etc/mail/sendmail.mc and rebuilt /etc/mail/sendmail.cf with the m4 command. I then attempted to restart Sendmail, but it did not restart.

# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
# service sendmail restart
Redirecting to /bin/systemctl restart  sendmail.service
Job for sendmail.service failed because the control process exited with error code. See "systemctl status sendmail.service" and "journalctl -xe" for details.

When I issued a systemctl status sendmail.service command for further information, I saw the following:

# systemctl status sendmail.service
‚óŹ sendmail.service - Sendmail Mail Transport Agent
   Loaded: loaded (/usr/lib/systemd/system/sendmail.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2016-08-18 15:40:49 EDT; 11s ago
  Process: 25578 ExecStart=/usr/sbin/sendmail -bd $SENDMAIL_OPTS $SENDMAIL_OPTARG (code=exited, status=78)
  Process: 25573 ExecStartPre=/etc/mail/make aliases (code=exited, status=0/SUCCESS)
  Process: 25570 ExecStartPre=/etc/mail/make (code=exited, status=0/SUCCESS)
 Main PID: 3394 (code=exited, status=0/SUCCESS)

Aug 18 15:40:49 moonpoint.com systemd[1]: Starting Sendmail Mail Transport A....
Aug 18 15:40:49 moonpoint.com sendmail[25578]: 554 5.0.0 /etc/mail/sendmail....d
Aug 18 15:40:49 moonpoint.com sendmail[25578]: NOQUEUE: SYSERR(root): /etc/m...d
Aug 18 15:40:49 moonpoint.com sendmail[25578]: NOQUEUE: SYSERR(root): InputF...y
Aug 18 15:40:49 moonpoint.com sendmail[25578]: 451 4.0.0 InputFilter BitDefe...y
Aug 18 15:40:49 moonpoint.com systemd[1]: sendmail.service: control process ...8
Aug 18 15:40:49 moonpoint.com systemd[1]: Failed to start Sendmail Mail Tran....
Aug 18 15:40:49 moonpoint.com systemd[1]: Unit sendmail.service entered fail....
Aug 18 15:40:49 moonpoint.com systemd[1]: sendmail.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

When I undid the changes I had made to sendmail.mc, the issue remained. When I used the journalctl command to check on the problem, I saw the following:

# journalctl -xe
-- 
-- Unit sendmail.service has failed.
-- 
-- The result is failed.
Aug 18 15:43:25 moonpoint.com systemd[1]: Dependency failed for Sendmail Mail Tr
-- Subject: Unit sm-client.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit sm-client.service has failed.
-- 
-- The result is dependency.
Aug 18 15:43:25 moonpoint.com systemd[1]: Job sm-client.service/start failed wit
Aug 18 15:43:25 moonpoint.com systemd[1]: Unit sendmail.service entered failed s
Aug 18 15:43:25 moonpoint.com systemd[1]: sendmail.service failed.
Aug 18 15:43:25 moonpoint.com polkitd[771]: Unregistered Authentication Agent fo
Aug 18 15:43:53 moonpoint.com sshd[25845]: Address 168.176.56.13 maps to wimax13
Aug 18 15:43:53 moonpoint.com sshd[25845]: Invalid user log from 168.176.56.13
Aug 18 15:43:53 moonpoint.com sshd[25845]: input_userauth_request: invalid user 
Aug 18 15:43:53 moonpoint.com sshd[25845]: pam_unix(sshd:auth): check pass; user
Aug 18 15:43:53 moonpoint.com sshd[25845]: pam_unix(sshd:auth): authentication f
Aug 18 15:43:55 moonpoint.com sshd[25845]: Failed password for invalid user log 
Aug 18 15:43:56 moonpoint.com sshd[25845]: Connection closed by 168.176.56.13 [p
lines 1490-1512/1512 (END)

[ More Info ]

[/network/email/sendmail] permanent link

Mon, Aug 01, 2016 11:08 pm

Determining the version of Microsoft Windows from the command line

You can determine the version of Microsoft Windows on a system from a command line interface (CLI), e.g., a command prompt, using the systeminfo command. Since that command will provide a lot of other information on the system, you can filter the output to see only the operating system (OS) version by piping its output into the findstr command using the "|" pipe character. The command below will show only the operating system version:
C:\>systeminfo | findstr /R "^OS.Version"
OS Version:                10.0.10586 N/A Build 10586

C:\>

The /R option indicates that the findstr command should perform its search based on a regular expression. The "^" character is a character that when included in a regular expression means that what follows should be at the beginning of the line. Without it, you could see something like the following, instead, since "BIOS Version also matches:

C:\>systeminfo | findstr /R "OS.Version"
systeminfo | findstr /R "OS.Version"
OS Version:                10.0.10586 N/A Build 10586
BIOS Version:              Dell Inc. A04, 11/21/2011

C:\>

The period between "OS" and "Version" indicates in a regular expression that any one character in that space will match; in this case there is a space character between the two words, which will match the period in a regular expression. If you want to have a period treated as a period rather than serving its function as a regular expression character, you can "escape" its meaning by using the backslash, i.e. "\", escape character.

[ More Info ]

[/network/email/sendmail] permanent link

Sat, Jul 30, 2016 10:39 pm

BitDefender Free Antispam for Mail Servers (FRAMS) with Sendmail

I have been using several email blacklists on a CentOS 7 server where I use Sendmail to handle email. The blacklists, aka blocklists, I've been employing are DNS-based Blackhole Lists (DNSBLs). A DNSBL is a list of IP addresses known to be associated with the transmission of spam. The ones I've been using are listed below:

I configured Sendmail to use those blacklists by putting the following lines in /etc/mail/sendmail.mc:

FEATURE(`blacklist_recipients')dnl
FEATURE(`dnsbl', `sbl.spamhaus.org', `550 Spam Block: mail from $&{client_addr} refused - See http://www.spamhaus.org/sbl/')dnl
FEATURE(`dnsbl', `psbl.surriel.com', `550 Spam Block: mail from $&{client_addr} refused - see http://psbl.surriel.com/')dnl
FEATURE(`dnsbl',`dnsbl.sorbs.net',`550 Spam Block: mail from $&{client_addr} refused - see http://dnsbl.sorbs.net/')dnl
FEATURE(`dnsbl',`dnsrbl.swinog.ch',`550 Spam Block: mail from $&{client_addr} refused - see http://antispam.imp.ch/spamikaze/remove.php')dnl
FEATURE(`enhdnsbl', `bl.spamcop.net', `"Spam blocked see: http://spamcop.net/bl.shtml?"$&{client_addr}', `t')dnl

If you add those lines to the Sendmail configuration file, you need to regenerate /etc/mail/sendmail.cf with the command m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf. Then restart sendmail with service sendmail restart.

Still, despite those multiple anti-spam blacklists, a lot of spam is getting through to accounts on the mail server. So I decided to install Free Antispam for Mail Servers (FRAMS) from Bitdefender, which describes the software thusly:

Bitdefender Free Antispam for Mail Servers provides essential features for increased productivity in any organization by blocking spam on Linux-based mail servers. Bitdefender's award winning antispam engines provide antiphishing, content and attachment filtering. It's extremely easy to install and administrators have an easy to use web-based interface and powerful command line management.

[ More Info ]

[/network/email/sendmail] permanent link

Mon, Jul 25, 2016 10:22 pm

Checking sendmail mail delivery from the command line

A user reported problems with email deliveries this morning, but when I checked the outgoing mail queue with the mailq command on the CentOS 7 server running sendmail, the queue was empty.
# mailq
/var/spool/mqueue is empty
		Total requests: 0
#

I tried sending a test message from the mail sever to an external email account with the mailx command. For the body of the message, I put some text into a file named test.txt and used the < character to provide the contents of the file as input to mailx for the body of the message. I didn't receive any error message and I didn't see any messages stuck in the mail queue when I checked it after I sent the message. But the message was not received at the destination email account.

# mailx -s "Testing" moonpoint@example.com <test.txt
# mailq
/var/spool/mqueue is empty
		Total requests: 0
#

So I then used the sendmail command, instead, to send a test message to see if it would provide me with any information that I could use for troubleshooting the problem. I created a file with the following contents to send as a test message.

# cat temp.txt
Subject: Sendmail test

This is a test.
This is only a test.

You can send a test message whose contents are contained in a text file from a command line interface using a sendmail command in the form sendmail recipient_email_address < input_file. But when I did that, I saw a "Connection refused by [127.0.0.1]" message.

[ More Info ]

[/network/email/sendmail] permanent link

Once You Know, You Newegg AliExpress by Alibaba.com

Shop Amazon Local - Subscribe to Deals in Your Neighborhood

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo