As root you can redeliver all mail in the mail server queue via:
sendmail -v -q
Sendmailresend all mails in sendmail queueSubmitted by sandip on Sun, 07/11/2010 - 23:31.As root you can redeliver all mail in the mail server queue via: sendmail -v -qUsing a .forward to send mail to multiple accountsSubmitted by sandip on Thu, 05/06/2010 - 14:00.If you put multiple addresses in a .forward file, a copy will be sent to each. remoteuser1@domain.tld, remoteuser2@domain.tld, remoteuser3@domain.tld If you want to keep a copy of each message in the original account without causing a .forward infinite loop, put a backslash in front of the account name. \localuser, remoteuser1@domain.tld, remoteuser2@domain.tld, remoteuser3@domain.tld Relay email via SMTP provider using sendmailSubmitted by sandip on Wed, 12/16/2009 - 00:02.The below is specific to CentOS-5.4 and may work similarly with other distros.
Edit ”/etc/mail/sendmail.mc”: define(`SMART_HOST', `{smtprelay.domain.tld}')dnlAuthInfo:smtprelay.domain.tld "U:{username}" "P:{password}" "M:PLAIN"cd /etc/mailNow mails sent to localhost is relayed via your SMTP provider. Rewriting Sender addresses for Entire Domain in SendmailSubmitted by sandip on Sun, 06/28/2009 - 23:13.
dnl # BEGIN: Rewriting Sender addresses for Entire Domainweb1_user1 user1@domain.tld# makemap -hash /etc/mail/genericstable < /etc/mail/genericstableFeature "genericstable" tells sendmail to use the generics table. Feature "generics_entire_domain" allows to add hosts to genericstable without having to rebuild sendmail.cf. Feature "masquerade_envelope" applies the rewriting process to the mail envelope as well as to the mail header. "GENERICS_DOMAIN" defines the domains to which you wish to apply the generics table. sendmail use of clientmqueue and mqueue foldersSubmitted by sandip on Tue, 04/28/2009 - 10:31.When submitting mail by using sendmail as a mail submission program, sendmail copies all messages to "/var/spool/clientmqueue" first. Sendmail is a setgid smmsp program and thus gives any user the permission to do so (/var/spool/clientmqueue belongs to user and group smmsp). Later, another sendmail process, the sendmail mail transfer agent (MTA) copies the messages from /var/spool/clientmqueue to /var/spool/mqueue and sends them to their destination. /var/spool/clientmqueue is thus the holding area used by the MSP (Mail Submission Protocol) sendmail instance before it injects the messages into the main MTA (Mail Transport Agent) sendmail instance. Sendmail will save the message in /var/spool/clientmqueue for safe keeping before trying to connect to the MTA to get the message delivered. Normally there would be a 'queue runner' MSP sendmail instance which every half hour would retry sending any message that couldn't be sent immediately. Each message will generate a 'df' (message routing info) and 'qf' (message headers and body) file. You can list out all of the messages and their status by: # mailq -v -AcWhen files accumulate in /var/spool/clientmqueue, this is probably due to sendmail localhost MTA not running, and thus the mails don't get send. Sendmail tipsSubmitted by sandip on Sun, 06/22/2008 - 22:41.
/etc/mail/sendmail.mcSecurity enhancements:
Put limits on Sendmail forks and other settings to stop a DOS attack from overwhelming server. Munge the Sendmail server identification. Recipient throttle to identify when an envelope arrives with more than 4 invalid users, presuming that this is a dictionary attack. Limit the number of recipients in a single message. dnl #Enable DNS BlockLists: dnl #All of the above should go before the line: FEATURE(`blacklist_recipients')dnlNotes: The above Double Bounce Address throws the double bounces into the bit bucket. The delay_checks feature causes it to log the sender from address and other info, when it rejects spam. Create an alias in "/etc/aliases" called dev-null and point it to "/dev/null":dev-null: /dev/nullConnect:xxx.xxx.xxx.xxx OKwhere xxx.xxx.xxx.xxx is the server IP. This keeps you from blocking yourself, if you happen to get listed in one of the blocklists used! To apply the configurations, run:# newaliasesDebugging sendmailSubmitted by sandip on Fri, 06/20/2008 - 16:01.The -b switch instructs sendmail to "Become"/operate in a mode. $ sendmail -d0.11 -bpYou can verify aliases with the -bv switch: $ sendmail -bv rootTo run sendmail verbosely, use the -v switch: $ cat /dev/null | sendmail -v root sendmail access.db by exampleSubmitted by sandip on Wed, 02/06/2008 - 00:02.The sendmail access database file can be created to accept or reject mail from selected domains. Since "/etc/mail/access" is a database, after creating the text file, use makemap to create the database map. # makemap hash /etc/mail/access.db < /etc/mail/accessBelow is what my access file currently looks like and can be used as a starting point. All internal addresses have been changed except for spammers!! # by default we allow relaying from localhost... localhost.localdomain RELAY localhost RELAY 127.0.0.1 RELAY # Allow Connect from local server IPs Connect:207.44.206.144 OK # Accept Mail # accept mail from PayPal paypal.com OK # Reject Mail posterclub@e.allposters.com REJECT posterclub@email.allposters.com REJECT plastmarket.com REJECT jr@jrtr.org REJECT 7b2.606@fe01.atl2.webusenet.com REJECT mysoldpad.com REJECT # Discard Mail 1and1-private-registration.com DISCARD # forum admin mails: fictionaluser@gmail.com DISCARD # Reject full mailbox fictionaluser@linuxweblog.com ERROR:4.2.2:450 mailbox full fictionaluser@linuxweblog.net REJECT # Blacklist recipients linuxweblog.net ERROR:550 That host does not accept mail # Spam friend domains: exempt domains from dnsbl list checking Spam:linuxweblog.org FRIEND # Spam friend users: exempt email users from dnsbl list checking # example: # Spam:user@domain.tld FRIEND # clients Spam:fictionalclient@hotmail.com FRIEND # Auto REJECT via hourly cron added below STARTTLS: CRLFile missing (RESOLVED)Submitted by sandip on Fri, 10/19/2007 - 10:20.When starting sendmail, I would get the below messgage: Oct 18 23:59:01 srv02 sendmail[20857]: alias database /etc/aliases rebuilt by rootAlthough, sendmail would still run without the CRL File and just complain about it missing. A quick way to include it in the sendmail configuration is to download revoke.crl from cacert.org, add the below option in sendmail.mc and rebuild the sendmail conf file as below. Download revoke.crl: # cd /usr/share/ssl/certsAdd the below line to "/etc/mail/sendmail.mc" just below the "confSERVER_KEY": define(`confCRL', `/usr/share/ssl/certs/revoke.crl')Rebuild sendmail conf by running make: # cd /etc/mailCheck sendmail.cf with the revoke.crl listed as below: O CRLFile=/usr/share/ssl/certs/revoke.crlNow restarting sendmail should not complain about the missing Certificate Revocation List (CRL) File. Sendmail config regenerationSubmitted by sandip on Wed, 11/08/2006 - 15:09.Regenerate sendmail config: # m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cfRegenerate access file: # makemap hash /etc/mail/access.db < /etc/mail/accessGenerate new aliases: # newaliases |
User loginRecent blog posts
Who's onlineThere are currently 0 users and 40 guests online.
|