No mechanism available - postfix-mta

I'm trying to setup a mail server. I followed this guide:
http://www.howtoforge.com/virtual-users-and-domains-with-postfix-courier-mysql-and-squirrelmail-ubuntu-12.10
Everything works with squirrelmail, i can send and receive emails. When i try to connect to the server with outlook, it connects fine, i can receive emails, but i can not send them.
I tried sending via telnet:
EHLO ***
AUTH LOGIN
334 VXNlcm5hbWU6
my64bitEncodedUsername
334 UGFzc3dvcmQ6
my64bitEncodedPass
535 5.7.8 Error: authentication failed: no mechanism available
In /var/log/mail.log i get ony this line:
postfix/smtpd[19421]: warning: *****[*******]: SASL LOGIN authentication failed: no mechanism available
My /etc/postfix/sasl/smtpd.conf file:
pwcheck_method: saslauthd
mech_list: plain login
allow_plaintext: true
auxprop_plugin: sql
sql_engine: mysql
sql_hostnames: 127.0.0.1
sql_user: ****
sql_passwd: ****
sql_database: mail
sql_select: select password from users where email = '%u#%r'
postconf -n output:
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
content_filter = amavis:[127.0.0.1]:10024
debug_peer_level = 3
inet_interfaces = all
inet_protocols = all
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mydestination = *****, localhost, localhost.localdomain
myhostname = ******
mynetworks = 127.0.0.0/8
myorigin = /etc/mailname
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
readme_directory = no
receive_override_options = no_address_mappings
recipient_delimiter = +
relayhost =
smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
smtpd_tls_loglevel = 1
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
virtual_alias_domains =
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_gid_maps = static:5000
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_uid_maps = static:5000

To add in main.cf:
smtpd_sasl_type = cyrus
cyrus_sasl_config_path = /etc/postfix/sasl/
and then restart postfix

Under Ubuntu 14.04, this solved it for me:
apt-get install libsasl2-modules

check out this: http://bit.ly/1lgj1tf might be of help, it helped me though. for shortcut,
type:
smtpd_sasl_type = cyrus
cyrus_sasl_config_path = /etc/postfix/sasl/
restart postfix

Related

Does anyone know how to bcc in R?

library("mailR")
sender <- "sender#gmail.com"
bcc<- c("BCC Recipient <bcc1#gmail.com.tr>","BCC Recipient<bcc2#gmail.com.tr>")
send.mail(from = sender,
bcc<- c("BCC Recipient <bcc1#gmail.com.tr>","BCC Recipient<bcc2#gmail.com.tr>"),
subject = "subject",
body = "BODY
",
authenticate=TRUE,
smtp = list(host.name = "smtp.gmail.com", port = 465,
user.name = "YOURUSERNAME#gmail.com",
passwd = "YOURPASSWORD", ssl = TRUE),
send = TRUE,
attach.files = c("C:/Users/admin/Desktop/Forecast.csv"),
file.names = c("Demand_Forecast.csv"))
Do u know how to send mail with bcc, what is the format?It is working but recipents can see eachother
You have mistakenly used the assignment operator inside the function send.mail().
This should work:
library("mailR")
sender <- "sender#gmail.com"
bcc<- c("BCC Recipient <bcc1#gmail.com.tr>","BCC Recipient<bcc2#gmail.com.tr>")
send.mail(from = sender,
bcc = c("BCC Recipient <bcc1#gmail.com.tr>","BCC Recipient<bcc2#gmail.com.tr>"),
subject = "subject",
body = "BODY",
authenticate=TRUE,
smtp = list(host.name = "smtp.gmail.com", port = 465,
user.name = "YOURUSERNAME#gmail.com",
passwd = "YOURPASSWORD", ssl = TRUE),
send = TRUE,
attach.files = c("C:/Users/admin/Desktop/Forecast.csv"),
file.names = c("Demand_Forecast.csv"))

How to send different contents to different recipients with mailR

I am trying to send different contents to different recipients, but all recipients get all contents. Any help?
library(mailR)
msg<- data.frame(recipients=c("first#mail.com","second#mail.com","third#mail.com"),
messages=c("firstmsg","secondmsg","thirdmsg"))
for ( i in msg$recipients)
{
for (j in msg$messages) {
send.mail(from="myemail#mail.com",
to= i,
body = j,
subject = "subject",
encoding = "utf-8",
smtp= list(host.name = "smtp.gmail.com", port = 465,
user.name = "myemail#mail.com", passwd = "mypassword", ssl = TRUE),
authenticate = TRUE, send = TRUE, attach.files=NULL, debug = FALSE)
}
}
You are using a double loop which will go through each value of j for each value of i in your loop. One approach would be to use list indexing:
msg<-data.frame(recipients=c("first#mail.com","second#mail.com",
"third#mail.com"),messages=c("firstmsg","secondmsg","thirdmsg"))
for i in 1:nrow(msg)
{
send.mail(from="myemail#mail.com",
to= msg$recipients[i],
body = msg$message[i],
subject = "subject",
encoding = "utf-8",
smtp= list(host.name = "smtp.gmail.com", port = 465,
user.name = "myemail#mail.com", passwd = "mypassword", ssl = TRUE),
authenticate = TRUE, send = TRUE, attach.files=NULL, debug = FALSE)
}

how to set alias all#example.com means all the user in my email on postfix

I use my centos 6.5 server to install a mailserver.And it works well.But there is two question.
How can i set all#example.com means all the users.This is mean that when i send email to all#example.com,all the users can received.
How can i let dovecot if Dovecot can’t find the users in MySQL, it may still be looking for system users.
here is my postfix main.cf:
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = all
inet_protocols = all
local_recipient_maps =
mail_owner = postfix
mailbox_size_limit = 0
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = localhost
mydomain = example.com
myhostname = example.com
mynetworks = 127.0.0.0/8 [::1]/128
myorigin = /etc/mailname
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
recipient_delimiter = +
relayhost =
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/pki/dovecot/certs/dovecot.pem
smtpd_tls_key_file = /etc/pki/dovecot/private/dovecot.pem
smtpd_use_tls = yes
unknown_local_recipient_reject_code = 550
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_transport = dovecot
You can use mailing list like as mailman or you use virtual_alias_maps (postfix+mysql)
https://workaround.org/ispmail/lenny/postfix-database-mappings
Dovecot has Pigeonhole Dovecot, it has limitation of forwarding mails to 4 Maximum (hard coded in the code so you have to edit the source code and rebuild the dovecot package)
I suggest you use the first option of mailing list.

Postfix - 530-5.5.1 Authentication Required

I'm trying to get postfix to deliver mail to gmail. I've followed this article on configuring it, but I still gives me an error:
relay=smtp.gmail.com[173.194.66.108]:587, delay=0.46, delays=0.05/0/0.37/0.04,
dsn=5.5.1, status=bounced (host smtp.gmail.com[173.194.66.108] said: 530-5.5.1
Authentication Required.
http://mhawthorne.net/posts/postfix-configuring-gmail-as-relay.html
What am I missing?
Here's my postfix config:
alias_maps = hash:/etc/aliases
biff = no
canonical_maps = hash:/etc/postfix/canonical
command_directory = /usr/sbin
config_directory = /etc/postfix
content_filter =
daemon_directory = /usr/lib/postfix
data_directory = /var/lib/postfix
debug_peer_level = 3
debug_peer_list = smtp.gmail.com
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin $daemon_directory/$process_name $process_id & sleep 5
defer_transports =
delay_warning_time = 1h
disable_dns_lookups = no
disable_mime_output_conversion = no
html_directory = /usr/share/doc/packages/postfix-doc/html
inet_interfaces = localhost
inet_protocols = all
mail_owner = postfix
mail_spool_directory = /var/mail
mailbox_command =
mailbox_size_limit = 0
mailbox_transport =
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
masquerade_classes = envelope_sender, header_sender, header_recipient
masquerade_domains =
masquerade_exceptions = root
message_size_limit = 0
message_strip_characters = \0
mydestination = $myhostname, localhost.$mydomain
myhostname = suse.home
mynetworks_style = subnet
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/packages/postfix-doc/README_FILES
relay_clientcerts =
relayhost = [smtp.gmail.com]:587
relocated_maps = hash:/etc/postfix/relocated
sample_directory = /usr/share/doc/packages/postfix-doc/samples
sender_canonical_maps = hash:/etc/postfix/sender_canonical
sendmail_path = /usr/sbin/sendmail
setgid_group = maildrop
smtp_enforce_tls = no
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile =
smtp_tls_CApath = /etc/postfix/ssl/cacerts
smtp_tls_cert_file =
smtp_tls_key_file =
smtp_tls_session_cache_database = btree:/var/lib/postfix/smtpd_tls_session_cache
smtp_use_tls = yes
smtpd_client_restrictions =
smtpd_helo_required = no
smtpd_helo_restrictions =
smtpd_recipient_restrictions = permit_mynetworks,reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sender_restrictions = hash:/etc/postfix/access
smtpd_tls_CAfile =
smtpd_tls_CApath =
smtpd_tls_ask_ccert = no
smtpd_tls_cert_file =
smtpd_tls_key_file =
smtpd_tls_received_header = no
smtpd_use_tls = no
strict_8bitmime = no
strict_rfc821_envelopes = no
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 550
virtual_alias_domains = hash:/etc/postfix/virtual
virtual_alias_maps = hash:/etc/postfix/virtual
You most likely need to go to Google's unlock page, as the new IP address trying to send the mail is raising security concerns.
Once you have unlocked via the browser, the script will be able to send.

Oracle XE stopped working. TNS listener refused connection

I'm working on an application which uses Oracle XE 11g as its RDBMS. It was working for several weeks but now I started to get an error message about the connection being refused.
I restarted my system but it did not help. I uninstalled XE, deleted all remaining files (even from registry) and reinstalled it. Now I get another error message:
Listener refused the connection with the following error: ORA-12505,
TNS:listener does not currently know of SID given in connect
descriptor
I've read about this error and others suggested adding a new SID to the listener.ora file:
(SID_DESC =
(SID_NAME = XE)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
)
If I do this I get another error message:
ORA-01034: ORACLE not available ORA-27101: shared memory realm does
not exist
My configuration files are:
listener.ora
SID_LIST_LISTENER = (SID_LIST =
(SID_DESC =
(SID_NAME = XE)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
)
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
) )
LISTENER = (DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = AAROLD.in.mycompany.com)(PORT = 1521))
) )
DEFAULT_SERVICE_LISTENER = (XE)
tnsnames.ora
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = AAROLD.in.mycompany.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
lsnrctl status returns with:
LSNRCTL for 32-bit Windows: Version 11.2.0.2.0 - Production on 19-M┴RC. -2013 15:12:24
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 32-bit Windows: Version 11.2.0.2.0 - Production
Start Date 19-M┴RC. -2013 15:01:12
Uptime 0 days 0 hr. 11 min. 11 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Default Service XE
Listener Parameter File C:\oraclexe\app\oracle\product\11.2.0\server\network\admin\listener.ora
Listener Log File C:\oraclexe\app\oracle\diag\tnslsnr\AAROLD\listener\alert\log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=AAROLD.in.mycompany.com)(PORT=1521)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
Do you have any idea what can be the problem? I'm not an Oracle expert so I'm completely in the dark here.
I had the exact same problem and after spending almost 4 hours trying to find and answer, finally adding
(SID_DESC =
(SID_NAME = XE)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
)
to my listener.ora and restarting both XE services solved the issue. I am using 11.2.0 (XE) on windows 7 x64 with out any hitch till yesterday. A reboot of my PC this morning caused the listener to not find the SID.
Now I am backing up both listener.ora and tnsnames.ora.
btw, forgot to mention I changed the hostname in both the files from bob.mycompany.com to localhost.
On Windows 7 64 bit, Orcale XE 11
my OracleXXETNSListener service was not running and did terminate immediately when I tried to start it.
Adding
(SID_DESC = (SID_NAME = XE) (ORACLE_HOME =
C:\oraclexe\app\oracle\product\11.2.0\server) )
to my
C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN\listener.ora
changing the hostname to localhost
restarting the OracleServiceXE service under System - Services solved the issue.
So the complete listener.ora section looks like:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\servers\oraclexe\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\servers\oraclexe\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = XE)
(ORACLE_HOME = C:\servers\oraclexe\app\oracle\product\11.2.0\server)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
DEFAULT_SERVICE_LISTENER = (XE)
Update:
Now it is 5 years later and I had the same issue with OracleXE 18c on Win10. The TNS listener would not start right after successful installation because oracleXE\dbhomeXE\NETWORK\ADMIN\listener.ora
was pointing to localhost.docker.internal instead of localhost.
I had a similar problem, and I fixed it by removing the "IPC" lines from both listener.ora and tnsnames.ora.
On listener.ora, I removed:
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
On tnsnames.ora, I removed:
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
It may have been a overkill, but it's finally fixed, after several hours!
Your Oracle DB is down. It may have some problem starting up.
Go to command prompt and type:
SQL>sqlplus / as sysdba
If you get a message "connected to an idle instance" then type
SQL>startup
and let me know the message you get. If you don't get the "connected to an idle instance" message on SqlPlus startup, the type:
SQL>set lines 80 pages 50
SQL>select * from v$database;
and post the output here.
I had the same problem, the error was I have changed the name of my machine . This was solved by editing listener.ora and renaming the HOST:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = hostname_of_my_machine)(PORT = 1521))
)
)

Resources