Sending Mail with Mailx, Sendmail and Postfix

The purpose of this document is to help users who want to setup customized email services on their local systems. However, most users should have little need to send an emails in such a way, say from a command line shell script or receiving emails as a server service from other hosts. Also, most users will only want to send emails and not receive them, hence using Mailx (nail) is much simpler by not setting up a mail server at all. Also, if you are just looking to receive pop/smtp mail, this document does not pertain to that either.

Sendmail is a professional mail server service allowing your system to handle incoming and outgoing mail requests. However, Sendmail is complicated to configure and overused for most users needs. If you are not looking to receive mail and are instead looking to simply send mail (i.e. from a script or whatever), you don't need sendmail. Just as you can send mail from an email client, you can send mail from your system without it using the internal site relays.

Topics Discussed In This Document
Mailx (nail) Client Mailer
  • Send email from your system using internal relays _(recommended)_
Sendmail Mail Server
  • Compile and configure a complicated mail server on your system
PostFix Mail Server
  • Configure an alternative mail server to sendmail
Mailx / nail instead of sendmail

Mailx / nail instead of sendmail

Instead you could use the "nail rpm" package which installs nail which will probably meet your needs in sending emails from scripts and such. Another example of not using sendmail would be setting up "thunderbird" with "us.ibm.com" as the outgoing mail smtp server.


  1. Switch to root (by typing su - or use the sudo command to open the nail.rc file:
    vi /etc/nail.rc
  2. Add (somewhere in the middle of the file):
    set smtp=us.ibm.com
    set from=intranetID@us.ibm.com

  3. Create a test email (use mailx not mail, it may be called nail too):
    [quickm@host etc]$ mailx mquick@us.ibm.com
    Subject: test

    This is a test email using "nail", I hope this works because the reader
    of this document will be really annoyed with me :-)



NOTE: type . and press enter key to end the body section of the text
Note: with nail => nail -s "Requested Report" -a report.txt user@host.com < /dev/null

RPM Package required (or build binary) : nail rpm package



Mail Services - Sendmail mail server configuration

Sendmail service allows users to send AND receive emails over various networks. Sendmail isn't needed for sending emails as you can use your own ISP or even setup nail for sending email right from your system. other options include procmail, mail.local, exim, and uucp. (not discussed). Note, this is unsupported and really should only serve as a reference overview.

Major files and tools

  • system-switch-mail (Redhat and Fedora only)
  • system-switch-mail-gnome - note, may update MTAs? (Redhat and Fedora only)
  • /usr/share/comps/i386/comps.xml - list of rpm packages
  • rpm -qi spamassassin
  • make -C /etc/mail/
  • chkconfig sendmail --level 35 on
  • service sendmail restart

List of basic terms

  • MTAs (Mail transfer agents) - sendmail, postfix, qmail
  • MUAs (Mail user agents) - mail, Mozilla, elm
  • MDAs (Mail delivery agents) - procmail, maildrop
  • sendmail - Installs the most popular mail server of the same name
  • imap - Supports IMAP and the POP incoming e-mail protocols
  • sendmail-cf - templates; use to generate sendmail configuration file
  • spamassassin - antispam program; start from sendmail or postfix
  • squirrelmail - Installs a Web-based e-mail server
  • postfix - Includes an alternative to sendmail

Additional Configurations Terms

  • sendmail.cf - The main sendmail configuration file.
  • sendmail.mc - A macro which you can edit and then generate a new sendmail.cf file.
  • domaintable - Allows you to map different domains.
  • helpfile - Supports help commands when you manage your mail server from the sendmail prompt.
  • local-host-names - Allows you to add hostnames or aliases for your computer as a sendmail server.
  • Makefile - Duh, Supports compiling the sendmail.mc file.
  • spamassassin - spamblocker, configuration files that can help you minimize spam. If you want to configure it on locally received e-mail, add the following line to /etc/procmailrc:
  • INCLUDERC=/etc/mail/spamassassin/spamassassin-default.rc
  • statistic - Collects statistics on sendmail usage in binary format. read it with 'mailstats'
  • submit.cf - main outgoing sendmail configuration file.
  • submit.mc - macro; used to generate new submit.cf file.
  • trusted-users - Lists special users which can send e-mail without warnings.
  • virtusertable - e-mail forwarding; if you have users outside your network who use sendmail.

Process when send mail starts:

1st reads sendmail.cf
then reads submit.cf

Setting up the basic sendmail feature at IBM:


su -; cd /etc/mail

Modify '/etc/mail/sendmail.mc'.
Change: define(`SMART_HOST',`[your.relay.machine.ip]')

For Outgoing mail (SMTP) server enter a mail server as follows:

If you are located in EMEA, your SMTP server name is relay.uk.ibm.com
If you are located in EMEA, your SMTP server name is relay.de.ibm.com
If you are located anywhere else (e.g. US, Canada, AP, etc.), your SMTP server name is relay.us.ibm.com

3 make from sendmail.mc
backup current sendmail.cf file

It has been noticed that relays may not talk to other regions, in particular the relay.us.ibm.com relay fails to send emails to other regions (i.e. Europe ). Users may want to try us.ibm.com instead (in the US.)
make -C /etc/mail  or just type make

4 Start sendmail and test

service sendmail restart

5 set it to start at boot

chkconfig --level 35 sendmail on

6 Testing:

[quickm@host etc]$ mailx testemail@host.com
Subject: test
This is a test email using "nail", I hope this works !


NOTE: type . and press enter key to end the body section of the text


Postfix Mail server -sendmail replacement

What is Postfix? It is Wietse Venema's mailer that started life at IBM research as an alternative to the widely-used Sendmail program. "Postfix attempts to be fast, easy to administer, and secure. The outside has a definite Sendmail-ish flavor, but the inside is completely different. " - http://www.postfix.org/ .

For more information about this product, use their external website : http://www.postfix.org/

Configuration etc.

  • Port 110
  • /etc/postfix/main.cf
  • /var/log/maillog
  • the postfix package installed

Generic configuration steps

  1. Install the postfix package either manually, via yum, or graphcial tool. In the Open Client for Linux Redhat / Fedora editions, it can be installed with:
    yum install postfix
    yum install system-switch-mail       (Redhat / Fedora only)

  2. Next configure postfix for all interfaces:
    (setup all interfaces)
    [issue this]# postconf -e "inet_interfaces = all"

  3. If sendmail is running, turn it off
    (turn off sendmail)
    [issue this]# service sendmail stop
  4. Switch the MTA using the system-switch-mail command:
    [issue this]# system-switch-mail

  5. Check the hosts file for a proper hostname configuration
    (confirm "hostname" is ok)
    cat /etc/hosts     ( myhost.subnet.net)

    Look for a line which starts with and contains your hostname after : samba.fishkill.ibm.com samba
    (example hostname being samba)

  6. Now Start the postfix service:
    (start postfix, use restart, not start)
    service postfix restart
  7. To set postfix to startup during boot up :
    chkconfig --list postfix  (setup if needed)
    chkconfig --level 35 postfix on (turns it on)
    chkconfig --list postfix

Testing postfix .

  1. Send an email to postfix
    (try mailing to postfix)
    mail -s `echo $USER` root@myhost.subnet.net < /etc/redhat-release
  1. Telnet to the mail port:
    (telnet localhost 110)
    [quickm@morocco quickm]$ telnet localhost 110
    Connected to localhost.localdomain (
    Escape character is '^]'.
    +OK POP3 localhost.localdomain v2003.83rh server ready
    +OK User name accepted, password please
    +OK Mailbox open, 0 messages
    +OK Sayonara
    Connection closed by foreign host.


install fetchmail packages
create ~/.fetchmailrc with chmod 600


Josi Bunder said... @ November 2, 2014 at 4:38 AM

Best web hosting companies. Reviews, rates, statistics of top hosting companies.
Find best hosting company at HostingCompaniesz.com

Akbar Ali said... @ October 23, 2015 at 12:10 AM

Send Unlimited Marketing Mails?
It's 100% Cheap & Inbox Guaranteed Delivery.

Take 14 Days Free Trial.
Add 1000 contacts & send unlimited campaigns.

Visit: http://j.mp/outboxmailer-affiliate-004 at Just $59/month

- You Can SEND UNLIMITED MailS without limits.
- Custom HTML editor, Web forms, Follow ups, and Auto-Responder.
- 99.5% Inbox Delivery and Real time reporting.
- Simple and Easy.


Take 14 Days Free Trial.
Add 1000 contacts & send unlimited campaigns.

In other network, they are charging +1000 USD for 1 Million Mails / contacts.
But in http://j.mp/outboxmailer-affiliate-004 is cheap at Just $59/month.?

Clash Of Clans YT said... @ October 26, 2015 at 9:06 PM

Download This Software + Crack/Serial Free Working Here:











Juan Rios said... @ January 5, 2016 at 3:10 PM

I land here lookin for replacement of postfix with sendmail...


Ros Chanpiseth said... @ February 16, 2016 at 8:17 AM

can you show how to use fetchmail on postfix

king fanny said... @ June 1, 2016 at 8:24 PM

geniun key for windows 8 professional , buy windows 10 activator discount , windows 10 pro n serial key , emule windows 8 enterprise , microsoft windows 7 product key free , windows 10 activation run command , windows 10 serial number vs product key , office 2016 registry purchase , sSB3cA

windows 10 enterprise license

cheap office 2013 key

windows 8.1 pro product key

Kartik Sharma said... @ August 2, 2016 at 2:07 AM

send emails to your clients 305press - Miami email marketing newsletter service opt-in marketing send emails to your clients. Check here best Email marketing in Miami.

Kartik Sharma said... @ August 10, 2016 at 3:20 AM

miami email marketing 305press - Miami email marketing newsletter service opt-in marketing send emails to your clients. Check here best Email marketing in Miami.

Parana Impact said... @ September 26, 2016 at 12:00 AM

These kinds of list will going to be a big help for all email marketing programs. With the help of this list everything will be so easy.If you want to know about email list marketing B2B marketing company in UK , Newyork & USA
services then check it here at.
IBM Users Email List

Best Web Hosting said... @ November 10, 2016 at 10:11 AM

It's true Bluehost is the industry leading hosting provide and they are best For wordpress Hosting,
BlueHost Basic Plan Discount – $3.49/mo* for first contract
No coupon or promotion code needed – Just purchase via our promo link (see below) and you’ll get an extra 55% discount from your first BlueHost bill.
BlueHost WEb Hosting Discount

alvin walker said... @ February 25, 2017 at 6:49 AM

or busy networks (or gateway / firewall Linux server) it is mandatory to increase the kernel's internal ARP cache size. The following kernel variables are used:USA Sales Leads

part time jobs said... @ February 28, 2017 at 6:02 AM

Instant download below

1000 Million Emails List

USA Email Database

john smith said... @ March 16, 2017 at 6:59 AM

More than 20 Million US Businesses with emails and lists are available for instant download. USA mailing lists

yunkie navarsqui said... @ April 1, 2017 at 2:19 PM

hello, guys, I'm a professional hacker, click read more to see all
ready for any kind of project.
you want to spy on cell phone, computer,?
want to hack any kind of email?
want to get root privilege of any server?
or you want to learn,
well I m hacker, and tool seller boy,
roots + Cpanel + shell + RDP + SMTP + scam page + mailer + email Extractor + fresh lead,

Skype: alfaz999
ICQ : 659915666
email 1: hacktorich@gmail.com
email 2: sonic.programmer1@yahoo.com

Unknown said... @ April 16, 2017 at 2:54 PM



random : 25$ per one
fullz : 35$ per one (come with <-- Dob + SSN + MMN + Driving license + )

1:Smtp : 15$ for ip (4$ for Domain)
2:Shell : 25$ per one
3:Cpanel : 10$ per one
4:Scam page 50$ for simple (60$ for undetectable)
5:RDP : 25$ any country
6:PHP mailer : 20$ per one

Socks 70$ any country
RDP: 3$ any country
HMA: 30$ unlimited 12 month
Vip72: 260$ unlimited 6 month
card validator : 60$ (for fixing un-valide card number and bin checker)
wu Java bypass Script ,(by pass any page with your giving commands)

zeus : 250$ (with fud crypted jpg,pdf or doc file)
key loger : 150$ (for email,pm and btc logs)
ninja Rat : 130$ (with fud crypted jpeg,pdf or doc file)
cidital : 150$ (with fud crypted jpeg,pdf or doc file)

SSH Brute Force scaner: 200$ (windows based) (ssh roots or required for run)
smtp scanner : 350$ (linux bassed) (ssh/root required for run )
rdp scnnaer : 400$ (linux bassed) (ssh/root required for run)
Smtp+rdp multi scanner : 600$ (linux bassed) (ssh/root required for run)
cpanel scanner : 500$ (linux bassed) (ssh/root + 10 cpanel or shell required for run)
root scanner : 800$ (linux bassed) (ssh/root required for run)

-------- Contact us ---------
skype: rushr00t000
hang out: hackitbackd00r@gmail.com
yahoo IMI: hackitbackdoor@yahoo.com

Ivan 000 said... @ May 24, 2017 at 10:07 PM

Hello all

am looking few years that some guys comes into the market they called themselves

hacker, carder or spammer they rip the peoples with different ways and it’s a badly

impact to real hacker now situation is that peoples doesn’t believe that real hackers

and carder scammer exists. We are also teaching all types of hacking within a few days

make funds your own.

Anyone want to make deal with us any type we are available but

first will show the proof that our work is real then make a deal like

..Wire Bank Transfer




..Hacking stuff

..BTC Generator

..PM Adder

..keylogger / scam pages / shell / hosting / SMTP / RDP / FTP

Shipping product. Rippers / scammer stay away serious / needy contact about it.


alfia oliver said... @ June 11, 2017 at 9:49 AM

Hello World, im d hacker offering following services click read more to see my full add
tools i do sell , Mailer | web mail | SMTP | RDP | Shell | C panel | Roots | scam page | Linux scanner |
any kind of virus or spy-where with fully fuded encrypted and with doc or PDF exploit |
Do you looking a hacker to hack email, phone, website, web server, mobo application | database , unlock iPhone, or any thing els, about computer
write me email or chat instant with ICQ or Skype
Gmail : zero.borya@gmail.com
yahoo : zeroborya@yahoo.com
Skype : zeroborya@yahoo.com
ICQ : 667961933

Flip Jork said... @ July 2, 2017 at 6:00 AM

this means selecting a hosted email platform that is focused on serving organizations like yours. Buy Email Leads

alfia oliver said... @ July 3, 2017 at 8:49 AM

Hell0 w0rld
Am teaching

Credit Card (cc) for sale
Randome Each price
Fullz Each price

Bank logins with High Balance

Spam tools kit
Carding Tools

Windows Based Spam tools Scanners
Linux Based Spam tools Scanners

Keyloggers / Stealer with hostings+Crypter+Exploits

PM / BTC adders / generator
For contact info
g mail =zero.borya@gmail.com
skype = zeroborya@yahoo
ICQ = 667961933

Ivan 000 said... @ July 6, 2017 at 1:27 PM

Hello All
I'm offering following hacking services
..hacking Tools
..Spamming Tools
..Scam pages
..spam tools scanners make your own tools

Other hacking svs
..Western union Trf
..wire bank trf
..credit / debit cards
..email hacking /tracing
..Mobile hacking / mobile spam

fully proof work
Availability 24/7 only given below addresses
Contact info
Icq: 718684828
Skype: live:Salvrosti

kate Johnson said... @ August 10, 2017 at 11:25 AM

Hello everyone, my name is Kate and I want to recommend a reliable hacker who helped hack my husband's cell phone remotely.

Which gave me full access to all his texts and, and now he has nothing to hide from me. If you require his service, contact ghosthacker2351@gmail.com, tell him Kate referred you he'll help.

nick vjuice said... @ September 14, 2017 at 2:04 PM

********** Welcome to Shop ************

- I'm is Professional seller,more than 8 years experience,i have sold cvv credit card to many customers all over the world.
- Selling cvv, fullz many country as: Canada,USA,Australia,UK...all And many country in Europe: Fr,Ger,Spain,Ita...
- I hope we will work together for a long time.
- Always sell cvv quality with high balance.
- I have a website but if you want buy cvv good price please contact me.

Contact me:
- Y!m : westernunionhacker
- Mail: westernunionhacker@yahoo.com

___________________ CCV !! CCN ______________________

List cc and my price..

- Us (Visa,Master) = 5$ per 1
- Us (Amex,Dis) = 6$ per 1
- Us Bin 10$ , US Dob 15$
- Us fullz info = 25$ per 1
- Uk (Visa,Master) = 10$ per 1
- Uk (Amex,Dis) = 15$ per 1
- Uk Bin 15$ , UK Dob 20$
- Uk fullz info = 30$ per 1
- Ca (Visa,Master) = 15$ per 1
- Ca (Amex,Dis) = 20$ per 1
- Ca Bin 15$ , CA Dob 20$
- Ca fullz info = 30$ per 1
- Au (Visa,Master) = 15$ per 1
- Au (Amex,Dis) = 20$ per 1
- Au Bin 17$ , AU Dob 25$
- Au fullz info = 30$ per 1
- Eu (Visa,Master) = 20$ per 1
- Eu (Amex,Dis) = 23$ per 1
- Eu Bin 25$ , AU Dob 30$
- Eu fullz info = 40$ per 1
- RDP = 20$
- SMTP = 25$ ( All Country )
- Italy = 20$ per 1 (fullz info = 35$)
- Spain = 20$ per 1 (fullz info = 35$)
- Denmark = 25$ per1 (fullz info = 35$)
- Sweden = 20$ per 1 (fullz info = 35$)
- France = 20$ per 1 (fullz info = 35$)
- Germany = 20$ per 1 (fullz info = 35$)
- Ireland = 20$ per 1 (fullz info = 35$)
- Mexico = 15$ per 1 (fullz info = 30$)
- Asia = 15$ per 1 (fullz info = 30$)

_________i Only Exchange WU to PM , WU to WMZ_________

- 100$ WU = 100$ PM
- 200$ WU = 200$ PM
- 100$ WU = 110$ WMZ
- 200$ WU = 210$ WMZ

________________ Do WU transfer ______________________

- 700$ for MTCN 8000$
- 550$ for MTCN 6000$
- 400$ for MTCN 4000$
- 200$ for MTCN 1500$

__________ Bank Logins Prices US UK CA AU EU _____________

. Bank Us : ( Bank of america,HALIFAX,BOA,CHASE,Wells Fargo...)
. Balance 3000$ = 150$
. Balance 5000$ = 250$
. Balance 8000$ = 400$
. Balance 12000$ = 600$
. Balance 15000$ = 800$
. Balance 20000$ = 1000$

- Bank UK : ( LLOYDS TSB,BARCLAYS,Standard Chartered,HSBC...)
. Balance 5000 GBP = 300$
. Balance 12000 GBP = 600$
. Balance 16000 GBP = 700$
. Balance 20000 GBP = 1000$
. Balance 30000 GBP = 1200$

__________________ PayPal account _______________________

= Account PayPal 1500$ = 200$
= Account PayPal 2500$ = 250$
= Account PayPal 4000$ = 350$
= Account PayPal 7000$ = 550$

_____________ Dumps track 1 track 2 with pin _____________

- Dumps,Tracks 1&2 Us = 70$ per 1
- Dumps,Tracks 1&2 UK = 80$ per 1
- Dumps,Tracks 1&2 Ca = 100$ per 1
- Dumps,Tracks 1&2 Au = 100$ per 1
- Dumps,Tracks 1&2 Eu = 110$ per 1

-Sample Dump + Pin:
Track1 : B4096663104697113^FORANTO/CHRI STOPHER M^09061012735200521000000 ,
Track2 : 4096663104697113=0906101273525 21
Pin : 1783

-WARRANTY time is 10 HOURS. Any cvv purchase over 10 hours can not warranty.
-If you buy over 30 cvvs, i will sell for you best price.
-I will discount for you if you are re-seller or you order everyday many on the next day.
-I will prove to you that I am the best sellers. And make sure you will enjoy doing business with me.
-I accept PM (Perfect money) ,WU (western union) , BTC (Bitcoins) or Money Gram...

Contact me
- Skype: Leads_provider
- Mail: westernunionhacker@yahoo.com

smart buzz said... @ September 18, 2017 at 4:06 AM

Hello All
I'm offering following hacking services

..Western union Trf
..wire bank trf
..credit / debit cards
..Perfect Money / Bintcoing adders
..email hacking /tracing
..Mobile hacking / mobile spam

..hacking Tools
..Spamming Tools
..Scam pages
..spam tools scanners make your own tools

Fake peoples have just words to scam peoples
they just cover their self that they are hacker
but when you ask them a questions they don't have answer
they don't have even knowledge what is hacking
am dealing with real peoples who interested and honest
also teaching hacking subjects in reasonable price
with private tools and proof.

Availability 24/7 contact only given below addresses
Icq: 718684828
Skype: live:Salvrosti

Post a Comment