Articles of sendmail

Apache,虚拟主机和sendmail的默认发件人

所以这是我的问题…我有两个站点托pipe在一台机器上使用Apache的虚拟主机。 我想使用适当的电子邮件地址从两个不同的网站(domain.com和domain2.com)发送电子邮件。 我目前在php.ini中有这个值: sendmail_path = /usr/sbin/sendmail -t -i [email protected] 但是,当我尝试从domain2.com上的脚本发送电子邮件时,它显然是与一个From: [email protected]标题交付。 Apache不允许你在<VirtualHost>指令中设置这样的规则: php_admin_value sendmail_path "/usr/sbin/sendmail -t -i [email protected]" 那么完成这个的最好方法是什么? 我已经尝试从domain2.com的<VirtualHost>指令中设置php_admin_value mail.force_extra_parameters "[email protected]" ,但所有电子邮件仍然来自domain.com。 有任何想法吗?

用sendmail将邮件logging为附件

我正在使用logrotate来旋转我的日志文件。 我已经设置了每周创build新的日志文件。 不过,我想先把邮件作为附件邮寄给我。 /var/log/httpd文件当前包含: /var/log/httpd/*log { missingok notifempty sharedscripts firstaction {I think I need to mail the logfiles here???} postrotate /sbin/service httpd reload > /dev/null 2>/dev/null || true endscript } 是否有可能做我想要的? 如果是这样的话:我需要添加firstaction以便它的firstaction : 使用sendmail将附件( /var/log/httpd/*log )作为附件发送给我 在邮件中添加一些主题,例如: HTTPD logfiles {week #}

使用Gmail作为sendmail的电子邮件转发

我曾经可以使用gmail帐户和使用Internet上的指南之一configuration的sendmail发送电子邮件,例如: http : //appgirl.net/blog/configuring-sendmail-to-relay-through-gmail-smtp / 这是一个小型服务器,我最近把它移到了另一个房子里。 而sendmail已经停止工作。 networking设置中唯一不同的是一个新的路由器。 发生什么事: 在日志文件中,我看到以下错误: … stat = Deferred:smtp.gmail.com:没有路由到主机 当我从命令行运行时: strace sendmail -f A -t B -u“Subject”-m“Message”-tls = yes ssl = yes -s smtp.gmail.com:587 -xu A -xp XYZ 它挂在这个电话: recvfrom(3, "m0\201\203\0\1\0\0\0\0\0\0\4ares\3lan\0\0\34\0\1", 8192, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.1.254")}, [16]) = 26 close(3) = 0 time(NULL) = 1339997943 open("/etc/localtime", O_RDONLY) = 3 fstat64(3, […]

获取sendmail安装/使用PHP邮件()

我在Ubuntu VPS上运行WordPress。 当WordPress试图发送电子邮件像密码重置或注册电子邮件它永远不会交付。 WordPress使用php的mail()函数。 我觉得这是不工作,因为我的VPS没有安装sendmail。 所以我进入SSH,并安装了sudo apt-get install sendmail ,这似乎是成功的。 遵循更多的Googlesearchbuild议,我编辑了php.ini文件以获得sendmailpath。 我把它定位为/usr/sbin/sendmail ,我认为这是许多* nix服务器的典型特征。 检查我在FTP上浏览到这个目录。 “sendmail”目录似乎是一个快捷方式。 这是正确的/预期的? 无论哪种方式的PHP邮件function不工作。 我已经创build了一个phpinfo文件和一个testing邮件php文件,其中只包含一个mail()函数,并将我的电子邮件作为收件人。 注意: 我的VPS还没有域名,只有一个IP地址。 这会影响sendmail的function吗? 我的phpinfo在这里供您参考:http: http://95.142.166.209/phpinfo.php 我是否也需要postfix? 我不认为我有… 这里是一些邮件日志。 我最后执行了邮件function: Nov 27 18:41:02 sergeserver sm-msp-queue[5450]: unable to qualify my own domain name (sergeserver) — using short name Nov 27 19:00:01 sergeserver sm-msp-queue[5497]: My unqualified host name (sergeserver) […]

在批量邮件脚本中发送数千封电子邮件时达到Sendmailexception。 sendmail具有给定进程的电子邮件发送限制吗?

我有点绝望与我们的networking服务器的问题。 我们的网站是一个有很多用户和活动的社区。 我们向用户发送他们感兴趣的活动的个性化邮件。 我们在处理这些邮件的脚本中遇到问题。 我们的批量电子邮件脚本在发送数千封电子邮件时失败 。 它通常工作正常,但当它发送比平常更多的电子邮件(aprox。25.000电子邮件)时,它会反复抛出exception: Unable to send mail. mail(): Could not execute mail delivery program '/usr/sbin/sendmail -t -i ' 奇怪的是, sendmail在其他进程(如Web服务器)中正常工作 ,sendmail在PHP(Zend)中的调用方式相同。 Sendmail只在PHP批量邮件脚本中失败,因为大量电子邮件已经无错地发送了。 当第一个exception抛出时,下一个sendmail调用也会失败 。 似乎已经达到了一些队列限制,但仅限于此过程! PHP脚本的代码 PHP批量邮件scipt主循环执行了数千次。 在每个循环传递调用sendMail与不同的$email和$user : // Sometimes, hundred thousands iterations foreach($notifications as $j => $notification){ … $mail->setNotification($notification); $this->sendMail($mail, $user); … } $this->sendmail($mail, $user)调用Zend发送邮件的内部方法。 它调用PHP本地方法邮件 。 /** * […]

端口25被阻止,但防火墙closures

好吧,这让我疯狂。 在CentOS上运行sendmail。 它正在运行,并在25: [root@mysqlslavebackup ~]# nmap -sS -O -sV 127.0.0.1 Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-03-21 10:46 PDD<br> Interesting ports on localhost.localdomain (127.0.0.1):<br> Not shown: 1665 closed ports<br> PORT STATE SERVICE VERSION<br> 22/tcp open ssh OpenSSH 4.3 (protocol 2.0)<br> 25/tcp open smtp Sendmail 8.13.8/8.13.8<br> 53/tcp open domain<br> 111/tcp open rpc<br> 631/tcp open ipp […]

dsn = 5.6.0,stat =转发电子邮件时数据格式错误

我们的Linux主机(CentOS)有几个共享域,其中一个是example.com( 在这个消息中使用假主机和用户名 ); 我们使用/etc/mail/virtusertable将所有发送到example.com的邮件发送到“exmpl”用户,并且~exmpl/.procmailrc根据需要转发邮件。 这个方法允许exmpl维护自己的转发,而/ etc / mail / aliases不支持。 实际上,virtusertable已经知道example.com的收件人,并拒绝邮件给未知的收件人。 我们很久以前就学到了这一课。 但是,以这种方式转发的邮件失败了: Apr 30 21:33:30 bogus sendmail[25645]: r412XUQ8025645: [email protected], ctladdr=exmpl (504/504), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30965, relay=[127.0.0.1] [127.0.0.1], dsn=5.6.0, stat=Data format error 这似乎很奇怪,因为“人”是bogus.org上的有效用户,而事实上bogus.org是example.com上同一台机器上的主域。 我们如何解决这个问题?

在执行HELO握手时失去与mx.servername的连接

我是pipe理邮件服务器的新手,因此当邮件服务器可以发送到某些电子邮件如Gmail,telus和shaw而不是其他电子邮件地址时,我不知所措。 只是具体的我猜。 以下是邮件日志中的一个示例: <[email protected]>, relay=mx.dockyardsliving.ca[65.254.254.50]:25, delay=67513, delays=67512/0.01/0.35/0, dsn=4.4.2, status=deferred (lost connection with mx.dockyardsliving.ca[65.254.254.50] while performing the HELO handshake) 下面是我的main.cf文件: smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) biff = no append_dot_mydomain = no readme_directory = no smtpd_tls_cert_file = /etc/ssl/certs/mailserver.pem smtpd_tls_key_file = /etc/ssl/private/mailserver.pem smtpd_use_tls=yes smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache # information on enabling SSL in the smtp […]

通过Gmail SMTP发送电子邮件以避免本地投递尝试?

背景 我们使用Google Apps通过我们的域example.com发送电子邮件: [ec2-user@example ~]$ dig MX example.com … ;; ANSWER SECTION: example.com. 300 IN MX 1 aspmx.l.google.com. example.com. 300 IN MX 5 alt1.aspmx.l.google.com. example.com. 300 IN MX 5 alt2.aspmx.l.google.com. example.com. 300 IN MX 10 aspmx2.googlemail.com. example.com. 300 IN MX 10 aspmx3.googlemail.com. … 在同一个域上,我们有一个运行的EC2实例,使用Amazon Linux AMI(基于Centos)。 sendmail对non-ex.com地址工作正常。 但是,example.com地址会尝试在本地投递邮件,这对仅存在于Google Apps上的用户无效。 有趣的是,尽pipelocal-host-names是空的。 题 为了避免本地交付,我们可以设置sendmail以便通过Google的SMTP服务器发送所有电子邮件(需要authentication)? 这是个好主意吗? 还是有更好的解决scheme? 附加信息 […]

Sendmail保持监听本地IP

我正在运行RHEL 6,并已经做了以下修改: [root@ark mail]# grep 0.0.0.0 sendmail.mc DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')dnl [root@ark mail]# make sendmail.cf 确保它适用于: [root@ark mail]# grep 0.0.0.0 sendmail.cf O DaemonPortOptions=Port=smtp,Addr=0.0.0.0, Name=MTA #O ClientPortOptions=Family=inet, Address=0.0.0.0 #O ConnectOnlyTo=0.0.0.0 [root@ark mail]# makemap -v hash access.db < access key=`connect:localhost.localdomain', val=`RELAY' key=`connect:localhost', val=`RELAY' key=`connect:127.0.0.1', val=`RELAY' key=`connect:[my.remote.ip]', val=`RELAY' 但是它仍然听取127.0.0.1: [root@ark mail]# netstat -lptun | grep 25 tcp 0 0 127.0.0.1:25 […]